@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.
- package/dist/alerts/alerts.test.d.ts +1 -0
- package/dist/alerts/delivery.d.ts +45 -0
- package/dist/alerts/evaluator.d.ts +12 -0
- package/dist/alerts/health.d.ts +34 -0
- package/dist/alerts/index.d.ts +6 -0
- package/dist/alerts/model.d.ts +170 -0
- package/dist/alerts/store.d.ts +90 -0
- package/dist/alerts/telemetry.d.ts +3 -0
- package/dist/api/client.d.ts +197 -0
- package/dist/api/handler.d.ts +18 -0
- package/dist/api/handler.test.d.ts +1 -0
- package/dist/api/index.d.ts +6 -0
- package/dist/api/openapi.d.ts +2 -0
- package/dist/api/service.d.ts +28 -0
- package/dist/api/types.d.ts +119 -0
- package/dist/auth/encryption.d.ts +3 -0
- package/dist/auth/index.d.ts +8 -0
- package/dist/auth/mailer.d.ts +9 -0
- package/dist/auth/oidc.d.ts +36 -0
- package/dist/auth/oidc.test.d.ts +1 -0
- package/dist/auth/store.d.ts +121 -0
- package/dist/auth/store.test.d.ts +1 -0
- package/dist/auth/totp.d.ts +11 -0
- package/dist/auth/totp.test.d.ts +1 -0
- package/dist/auth/types.d.ts +138 -0
- package/dist/automation/index.d.ts +2 -0
- package/dist/automation/store.d.ts +46 -0
- package/dist/automation/store.test.d.ts +1 -0
- package/dist/automation/types.d.ts +66 -0
- package/dist/aws/acm.d.ts +0 -4
- package/dist/aws/application-autoscaling.d.ts +0 -5
- package/dist/aws/backup.d.ts +42 -0
- package/dist/aws/bedrock.d.ts +0 -5
- package/dist/aws/client.d.ts +3 -6
- package/dist/aws/cloudformation.d.ts +0 -4
- package/dist/aws/cloudfront-media.test.d.ts +1 -0
- package/dist/aws/cloudfront-origin.test.d.ts +1 -0
- package/dist/aws/cloudfront.d.ts +87 -3
- package/dist/aws/cloudwatch-logs.d.ts +2 -4
- package/dist/aws/cloudwatch.d.ts +1 -1
- package/dist/aws/comprehend.d.ts +0 -5
- package/dist/aws/connect.d.ts +0 -4
- package/dist/aws/cost-explorer-cache.d.ts +1 -15
- package/dist/aws/cost-explorer.d.ts +18 -9
- package/dist/aws/cost-explorer.test.d.ts +1 -0
- package/dist/aws/dynamodb.d.ts +0 -4
- package/dist/aws/ec2.d.ts +0 -4
- package/dist/aws/ecr.d.ts +0 -4
- package/dist/aws/ecs.d.ts +17 -7
- package/dist/aws/efs.d.ts +0 -4
- package/dist/aws/elasticache.d.ts +0 -4
- package/dist/aws/elbv2.d.ts +0 -7
- package/dist/aws/email.d.ts +0 -10
- package/dist/aws/eventbridge.d.ts +0 -4
- package/dist/aws/iam.d.ts +1 -5
- package/dist/aws/imap-server.d.ts +0 -7
- package/dist/aws/index.d.ts +4 -3
- package/dist/aws/index.js +31 -31
- package/dist/aws/kendra.d.ts +0 -5
- package/dist/aws/lambda.d.ts +3 -5
- package/dist/aws/opensearch.d.ts +0 -4
- package/dist/aws/personalize.d.ts +0 -5
- package/dist/aws/polly.d.ts +0 -5
- package/dist/aws/rds.d.ts +59 -4
- package/dist/aws/rekognition.d.ts +0 -5
- package/dist/aws/route53-domains.d.ts +0 -4
- package/dist/aws/route53.d.ts +0 -4
- package/dist/aws/s3.d.ts +10 -6
- package/dist/aws/scheduler.d.ts +0 -4
- package/dist/aws/secrets-manager.d.ts +0 -4
- package/dist/aws/setup-sms.d.ts +0 -14
- package/dist/aws/sms.d.ts +0 -10
- package/dist/aws/smtp-server.d.ts +0 -11
- package/dist/aws/sns.d.ts +0 -4
- package/dist/aws/sqs.d.ts +0 -4
- package/dist/aws/ssm.d.ts +0 -4
- package/dist/aws/sts.d.ts +0 -4
- package/dist/aws/support.d.ts +0 -4
- package/dist/aws/textract.d.ts +0 -5
- package/dist/aws/transcribe.d.ts +0 -4
- package/dist/aws/translate.d.ts +0 -5
- package/dist/aws/voice.d.ts +0 -11
- package/dist/aws/xray.d.ts +1 -0
- package/dist/backups/aws-database-source.d.ts +19 -0
- package/dist/backups/aws-database-source.test.d.ts +1 -0
- package/dist/backups/aws-infrastructure-source.d.ts +43 -0
- package/dist/backups/aws-infrastructure-source.test.d.ts +1 -0
- package/dist/backups/control-plane-source.d.ts +16 -0
- package/dist/backups/control-plane-source.test.d.ts +1 -0
- package/dist/backups/docker-volume-source.d.ts +31 -0
- package/dist/backups/docker-volume-source.test.d.ts +1 -0
- package/dist/backups/filesystem-source.d.ts +34 -0
- package/dist/backups/filesystem-source.test.d.ts +1 -0
- package/dist/backups/index.d.ts +10 -0
- package/dist/backups/logical-database-source.d.ts +16 -0
- package/dist/backups/logical-database-source.test.d.ts +1 -0
- package/dist/backups/model.d.ts +121 -0
- package/dist/backups/s3-destination.d.ts +85 -0
- package/dist/backups/s3-destination.test.d.ts +1 -0
- package/dist/backups/service.d.ts +80 -0
- package/dist/backups/service.test.d.ts +1 -0
- package/dist/backups/store.d.ts +30 -0
- package/dist/backups/store.test.d.ts +1 -0
- package/dist/bin/cli.js +3360 -1802
- package/dist/{chunk-tjjgajbh.js → chunk-01d86gt1.js} +301 -9
- package/dist/{chunk-73vcqg6z.js → chunk-0z43x8re.js} +7 -7
- package/dist/{chunk-tnztxpcb.js → chunk-32e7ya18.js} +61 -49
- package/dist/{chunk-qpj3edwz.js → chunk-4cjrg98a.js} +3 -7
- package/dist/{chunk-hsk6fe6x.js → chunk-50jpda9q.js} +2 -2
- package/dist/{chunk-93hjhs78.js → chunk-703nkybg.js} +1 -1
- package/dist/{chunk-d5vqwj8s.js → chunk-9m6b4m74.js} +755 -720
- package/dist/chunk-e05phx5f.js +10 -0
- package/dist/{chunk-f29w04w5.js → chunk-exbcsab2.js} +10 -4
- package/dist/{chunk-eq08r166.js → chunk-f55nkpvb.js} +2 -2
- package/dist/{chunk-3bfv1z4v.js → chunk-fv1bj3yt.js} +63 -56
- package/dist/chunk-fw3q88wk.js +48641 -0
- package/dist/{chunk-3knnr7wh.js → chunk-he9a874b.js} +170 -2
- package/dist/{chunk-zn0nxxa8.js → chunk-hpv68b4a.js} +1070 -1070
- package/dist/chunk-k114qwg9.js +12 -0
- package/dist/{chunk-r16e02bc.js → chunk-vdk53yyq.js} +3900 -4101
- package/dist/{chunk-jp2a8yad.js → chunk-vvkd46k1.js} +15 -13
- package/dist/{chunk-vd87cpvn.js → chunk-wj3s95p9.js} +62 -46
- package/dist/{chunk-mj1tmhte.js → chunk-x9s0cqfx.js} +1 -1
- package/dist/{chunk-3rsfns7x.js → chunk-ybcz6sxc.js} +2048 -387
- package/dist/{chunk-arsh1g5h.js → chunk-zqtpg06c.js} +14 -11
- package/dist/compose/index.d.ts +6 -0
- package/dist/compose/parser.d.ts +13 -0
- package/dist/compose/parser.test.d.ts +1 -0
- package/dist/compose/runtime.d.ts +10 -0
- package/dist/compose/service.d.ts +18 -0
- package/dist/compose/store.d.ts +59 -0
- package/dist/compose/store.test.d.ts +1 -0
- package/dist/compose/templates.d.ts +17 -0
- package/dist/compose/types.d.ts +164 -0
- package/dist/configuration/backends.d.ts +66 -0
- package/dist/configuration/backends.test.d.ts +1 -0
- package/dist/configuration/dotenv.d.ts +14 -0
- package/dist/configuration/dotenv.test.d.ts +1 -0
- package/dist/configuration/index.d.ts +6 -0
- package/dist/configuration/migrate.d.ts +10 -0
- package/dist/configuration/migrate.test.d.ts +1 -0
- package/dist/configuration/model.d.ts +50 -0
- package/dist/configuration/service.d.ts +144 -0
- package/dist/configuration/service.test.d.ts +1 -0
- package/dist/configuration/store.d.ts +33 -0
- package/dist/configuration/store.test.d.ts +1 -0
- package/dist/control-plane/authorization.d.ts +24 -0
- package/dist/control-plane/authorization.test.d.ts +1 -0
- package/dist/control-plane/index.d.ts +8 -0
- package/dist/control-plane/migrations.d.ts +7 -0
- package/dist/control-plane/search.d.ts +25 -0
- package/dist/control-plane/store.d.ts +117 -0
- package/dist/control-plane/store.test.d.ts +1 -0
- package/dist/control-plane/types.d.ts +381 -0
- package/dist/cost/reporting.d.ts +24 -0
- package/dist/cost/reporting.test.d.ts +1 -0
- package/dist/cost/resource-inventory.d.ts +32 -0
- package/dist/cost/resource-inventory.test.d.ts +1 -0
- package/dist/cost/resource-optimization.d.ts +59 -0
- package/dist/cost/resource-optimization.test.d.ts +1 -0
- package/dist/data-services/adapters.d.ts +39 -0
- package/dist/data-services/aws-transports.d.ts +29 -0
- package/dist/data-services/aws-transports.test.d.ts +1 -0
- package/dist/data-services/capabilities.d.ts +2 -0
- package/dist/data-services/data-services.test.d.ts +1 -0
- package/dist/data-services/docker-transport.d.ts +55 -0
- package/dist/data-services/docker-transport.test.d.ts +1 -0
- package/dist/data-services/index.d.ts +8 -0
- package/dist/data-services/model.d.ts +79 -0
- package/dist/data-services/secrets.d.ts +13 -0
- package/dist/data-services/secrets.test.d.ts +1 -0
- package/dist/data-services/service.d.ts +51 -0
- package/dist/data-services/store.d.ts +17 -0
- package/dist/deploy/container-image.d.ts +28 -0
- package/dist/deploy/container-image.test.d.ts +1 -0
- package/dist/deploy/dashboard-audit.test.d.ts +1 -0
- package/dist/deploy/dashboard-auth.d.ts +4 -23
- package/dist/deploy/dashboard-backups.integration.test.d.ts +1 -0
- package/dist/deploy/dashboard-configuration.integration.test.d.ts +1 -0
- package/dist/deploy/dashboard-control-plane.d.ts +37 -0
- package/dist/deploy/dashboard-control-plane.test.d.ts +1 -0
- package/dist/deploy/dashboard-data-services.integration.test.d.ts +1 -0
- package/dist/deploy/dashboard-environment-scope.test.d.ts +1 -0
- package/dist/deploy/dashboard-guard.d.ts +12 -0
- package/dist/deploy/dashboard-guard.test.d.ts +1 -0
- package/dist/deploy/dashboard-identities.d.ts +15 -0
- package/dist/deploy/dashboard-identities.test.d.ts +1 -0
- package/dist/deploy/dashboard-jobs.integration.test.d.ts +1 -0
- package/dist/deploy/dashboard-login-page.d.ts +5 -5
- package/dist/deploy/dashboard-login-page.test.d.ts +1 -0
- package/dist/deploy/dashboard-oidc.integration.test.d.ts +1 -0
- package/dist/deploy/dashboard-onboarding.integration.test.d.ts +1 -0
- package/dist/deploy/dashboard-policy.d.ts +4 -2
- package/dist/deploy/dashboard-queue-worker.integration.test.d.ts +1 -0
- package/dist/deploy/dashboard-release.integration.test.d.ts +1 -0
- package/dist/deploy/dashboard-route-manifest.d.ts +14 -0
- package/dist/deploy/dashboard-route-manifest.test.d.ts +1 -0
- package/dist/deploy/dashboard-security.integration.test.d.ts +1 -0
- package/dist/deploy/dashboard-session.d.ts +3 -14
- package/dist/deploy/dashboard-source.integration.test.d.ts +1 -0
- package/dist/deploy/dashboard-users.d.ts +3 -0
- package/dist/deploy/fullstack-container.d.ts +87 -0
- package/dist/deploy/fullstack-container.test.d.ts +1 -0
- package/dist/deploy/index.d.ts +7 -2
- package/dist/deploy/index.js +65 -25
- package/dist/deploy/local-dashboard-server.d.ts +30 -0
- package/dist/deploy/quick-deploy.d.ts +1 -1
- package/dist/deploy/serverless-operations.d.ts +1 -0
- package/dist/deploy/site-target.d.ts +16 -0
- package/dist/deploy/static-api-origin.d.ts +107 -0
- package/dist/deploy/static-api-origin.test.d.ts +1 -0
- package/dist/deploy/static-site-helper.d.ts +0 -16
- package/dist/deploy/telemetry-access.d.ts +5 -0
- package/dist/deploy/telemetry-access.test.d.ts +1 -0
- package/dist/deploy/telemetry-collection.d.ts +44 -0
- package/dist/deploy/telemetry-collection.test.d.ts +1 -0
- package/dist/dns/index.js +3 -3
- package/dist/dns/route53-adapter.d.ts +1 -1
- package/dist/drivers/hetzner/cloud-init.d.ts +1 -1
- package/dist/drivers/index.d.ts +2 -2
- package/dist/drivers/index.js +6 -6
- package/dist/drivers/shared/notifications.d.ts +1 -1
- package/dist/drivers/shared/rpx-gateway.d.ts +1 -0
- package/dist/fleet/fleet.test.d.ts +1 -0
- package/dist/fleet/index.d.ts +144 -0
- package/dist/fleet/queue.d.ts +3 -0
- package/dist/fleet/ssh-driver.d.ts +34 -0
- package/dist/index.d.ts +28 -4
- package/dist/index.js +1132 -424
- package/dist/jobs/adapters.d.ts +23 -0
- package/dist/jobs/index.d.ts +7 -0
- package/dist/jobs/jobs.test.d.ts +1 -0
- package/dist/jobs/model.d.ts +100 -0
- package/dist/jobs/provider-adapters.d.ts +49 -0
- package/dist/jobs/reconcile.d.ts +19 -0
- package/dist/jobs/schedule.d.ts +9 -0
- package/dist/jobs/service.d.ts +30 -0
- package/dist/jobs/store.d.ts +48 -0
- package/dist/maintenance/drivers.d.ts +117 -0
- package/dist/maintenance/index.d.ts +6 -0
- package/dist/maintenance/maintenance.test.d.ts +1 -0
- package/dist/maintenance/manifest.d.ts +15 -0
- package/dist/maintenance/queue.d.ts +9 -0
- package/dist/maintenance/service.d.ts +31 -0
- package/dist/maintenance/store.d.ts +84 -0
- package/dist/maintenance/types.d.ts +192 -0
- package/dist/media.d.ts +62 -0
- package/dist/media.test.d.ts +1 -0
- package/dist/object-storage/index.d.ts +0 -24
- package/dist/onboarding/archive.d.ts +12 -0
- package/dist/onboarding/artifact-store.d.ts +22 -0
- package/dist/onboarding/detection.d.ts +8 -0
- package/dist/onboarding/index.d.ts +9 -0
- package/dist/onboarding/migrations.d.ts +3 -0
- package/dist/onboarding/onboarding.test.d.ts +1 -0
- package/dist/onboarding/plan.d.ts +3 -0
- package/dist/onboarding/registry.d.ts +41 -0
- package/dist/onboarding/service.d.ts +16 -0
- package/dist/onboarding/store.d.ts +30 -0
- package/dist/onboarding/types.d.ts +204 -0
- package/dist/placement/builds.d.ts +20 -0
- package/dist/placement/drivers.d.ts +54 -0
- package/dist/placement/index.d.ts +6 -0
- package/dist/placement/placement.test.d.ts +1 -0
- package/dist/placement/queue.d.ts +4 -0
- package/dist/placement/service.d.ts +34 -0
- package/dist/placement/store.d.ts +49 -0
- package/dist/placement/types.d.ts +109 -0
- package/dist/preview/index.d.ts +3 -0
- package/dist/preview/service.d.ts +45 -0
- package/dist/preview/service.test.d.ts +1 -0
- package/dist/preview/store.d.ts +47 -0
- package/dist/preview/store.test.d.ts +1 -0
- package/dist/preview/types.d.ts +99 -0
- package/dist/push/apns.d.ts +0 -26
- package/dist/push/fcm.d.ts +0 -23
- package/dist/push/index.d.ts +2 -2
- package/dist/push/index.js +1 -1
- package/dist/queue/deployment-handlers.d.ts +27 -0
- package/dist/queue/deployment-handlers.test.d.ts +1 -0
- package/dist/queue/index.d.ts +4 -0
- package/dist/queue/queue.d.ts +57 -0
- package/dist/queue/queue.test.d.ts +1 -0
- package/dist/queue/types.d.ts +93 -0
- package/dist/queue/worker.d.ts +32 -0
- package/dist/queue/worker.test.d.ts +1 -0
- package/dist/regions/drivers.d.ts +139 -0
- package/dist/regions/index.d.ts +5 -0
- package/dist/regions/queue.d.ts +4 -0
- package/dist/regions/regions.test.d.ts +1 -0
- package/dist/regions/service.d.ts +23 -0
- package/dist/regions/store.d.ts +41 -0
- package/dist/regions/types.d.ts +132 -0
- package/dist/release/index.d.ts +6 -0
- package/dist/release/queue.d.ts +15 -0
- package/dist/release/queue.test.d.ts +1 -0
- package/dist/release/runtime.d.ts +35 -0
- package/dist/release/runtime.test.d.ts +1 -0
- package/dist/release/service.d.ts +28 -0
- package/dist/release/store.d.ts +88 -0
- package/dist/release/store.test.d.ts +1 -0
- package/dist/release/strategy.d.ts +8 -0
- package/dist/release/types.d.ts +103 -0
- package/dist/runtime/adapters/aws.d.ts +5 -0
- package/dist/runtime/adapters/docker.d.ts +53 -0
- package/dist/runtime/adapters/systemd.d.ts +26 -0
- package/dist/runtime/index.d.ts +9 -0
- package/dist/runtime/inventory.d.ts +6 -0
- package/dist/runtime/model.d.ts +130 -0
- package/dist/runtime/normalize.d.ts +5 -0
- package/dist/runtime/operations.d.ts +113 -0
- package/dist/runtime/service.d.ts +32 -0
- package/dist/runtime/streams.d.ts +49 -0
- package/dist/security/artifacts.d.ts +105 -0
- package/dist/security/artifacts.test.d.ts +1 -0
- package/dist/security/container-release.d.ts +35 -0
- package/dist/security/container-release.test.d.ts +1 -0
- package/dist/security/index.d.ts +8 -0
- package/dist/security/integration.d.ts +41 -0
- package/dist/security/integration.test.d.ts +1 -0
- package/dist/security/posture-store.d.ts +80 -0
- package/dist/security/posture-store.test.d.ts +1 -0
- package/dist/security/pre-deploy-scanner.d.ts +0 -4
- package/dist/security/scanners.d.ts +81 -0
- package/dist/security/scanners.test.d.ts +1 -0
- package/dist/security/types.d.ts +150 -0
- package/dist/source/git-workspace.d.ts +26 -0
- package/dist/source/git-workspace.test.d.ts +1 -0
- package/dist/source/index.d.ts +6 -0
- package/dist/source/providers.d.ts +199 -0
- package/dist/source/providers.test.d.ts +1 -0
- package/dist/source/service.d.ts +18 -0
- package/dist/source/store.d.ts +149 -0
- package/dist/source/store.test.d.ts +1 -0
- package/dist/source/types.d.ts +191 -0
- package/dist/source/webhooks.d.ts +33 -0
- package/dist/source/webhooks.test.d.ts +1 -0
- package/dist/ssl/acme-client.d.ts +0 -6
- package/dist/storage/compose.d.ts +4 -0
- package/dist/storage/compose.test.d.ts +1 -0
- package/dist/storage/drivers.d.ts +107 -0
- package/dist/storage/drivers.test.d.ts +1 -0
- package/dist/storage/index.d.ts +5 -0
- package/dist/storage/model.d.ts +112 -0
- package/dist/storage/service.d.ts +95 -0
- package/dist/storage/storage.test.d.ts +1 -0
- package/dist/storage/store.d.ts +40 -0
- package/dist/telemetry/correlation.test.d.ts +1 -0
- package/dist/telemetry/index.d.ts +4 -0
- package/dist/telemetry/model.d.ts +145 -0
- package/dist/telemetry/policy.d.ts +8 -0
- package/dist/telemetry/policy.test.d.ts +1 -0
- package/dist/telemetry/redaction.d.ts +9 -0
- package/dist/telemetry/store.d.ts +34 -0
- package/dist/telemetry/store.test.d.ts +1 -0
- package/dist/ui/404.html +1506 -17
- package/dist/ui/accept-invitation.html +1163 -0
- package/dist/ui/{server/backups.html → access-denied.html} +344 -55
- package/dist/ui/account/automation.html +1669 -0
- package/dist/ui/account/security.html +1646 -0
- package/dist/ui/applications/compose.html +1590 -0
- package/dist/ui/applications/new.html +1868 -0
- package/dist/ui/data/backups.html +1757 -0
- package/dist/ui/data/services.html +1723 -0
- package/dist/ui/data/volumes.html +1639 -0
- package/dist/ui/index.html +392 -29
- package/dist/ui/integrations.html +1865 -0
- package/dist/ui/operations/alerts.html +1610 -0
- package/dist/ui/operations/configuration.html +1746 -0
- package/dist/ui/operations/jobs.html +1709 -0
- package/dist/ui/operations/maintenance.html +1540 -0
- package/dist/ui/operations/observability.html +1742 -0
- package/dist/ui/{serverless/scheduler.html → operations/previews.html} +447 -46
- package/dist/ui/operations/queue.html +1615 -0
- package/dist/ui/{server/workers.html → operations/regions.html} +413 -49
- package/dist/ui/operations/releases.html +1596 -0
- package/dist/ui/operations/workloads.html +1775 -0
- package/dist/ui/security.html +1767 -0
- package/dist/ui/server/actions.html +446 -57
- package/dist/ui/server/activity.html +346 -1
- package/dist/ui/server/capacity.html +1542 -0
- package/dist/ui/server/database.html +443 -36
- package/dist/ui/server/deployments.html +439 -53
- package/dist/ui/server/diagnostics.html +346 -1
- package/dist/ui/server/firewall.html +476 -50
- package/dist/ui/server/fleet.html +1577 -0
- package/dist/ui/server/logs.html +389 -25
- package/dist/ui/server/metrics.html +346 -1
- package/dist/ui/server/security.html +346 -1
- package/dist/ui/server/services.html +421 -46
- package/dist/ui/server/sites.html +476 -95
- package/dist/ui/server/ssh-keys.html +476 -46
- package/dist/ui/server/team.html +700 -77
- package/dist/ui/server/terminal.html +444 -54
- package/dist/ui/serverless/alarms.html +430 -42
- package/dist/ui/serverless/assets.html +421 -46
- package/dist/ui/serverless/cost.html +346 -1
- package/dist/ui/serverless/data.html +422 -47
- package/dist/ui/serverless/deployments.html +421 -46
- package/dist/ui/serverless/firewall.html +346 -1
- package/dist/ui/serverless/functions.html +423 -48
- package/dist/ui/serverless/logs.html +389 -25
- package/dist/ui/serverless/metrics.html +346 -1
- package/dist/ui/serverless/queues.html +448 -62
- package/dist/ui/serverless/secrets.html +448 -42
- package/dist/ui/serverless/traces.html +350 -5
- package/dist/ui/serverless.html +434 -58
- package/dist/ui-src/pages/404.stx +18 -0
- package/dist/ui-src/pages/accept-invitation.stx +50 -0
- package/dist/ui-src/pages/access-denied.stx +18 -0
- package/dist/ui-src/pages/account/automation.stx +187 -0
- package/dist/ui-src/pages/account/security.stx +249 -0
- package/dist/ui-src/pages/applications/compose.stx +38 -0
- package/dist/ui-src/pages/applications/new.stx +76 -0
- package/dist/ui-src/pages/data/backups.stx +214 -0
- package/dist/ui-src/pages/data/services.stx +257 -0
- package/dist/ui-src/pages/data/volumes.stx +40 -0
- package/dist/ui-src/pages/index.stx +24 -10
- package/dist/ui-src/pages/integrations.stx +186 -0
- package/dist/ui-src/pages/operations/alerts.stx +40 -0
- package/dist/ui-src/pages/operations/configuration.stx +164 -0
- package/dist/ui-src/pages/operations/jobs.stx +238 -0
- package/dist/ui-src/pages/operations/maintenance.stx +15 -0
- package/dist/ui-src/pages/operations/observability.stx +76 -0
- package/dist/ui-src/pages/operations/previews.stx +62 -0
- package/dist/ui-src/pages/operations/queue.stx +158 -0
- package/dist/ui-src/pages/operations/regions.stx +12 -0
- package/dist/ui-src/pages/operations/releases.stx +39 -0
- package/dist/ui-src/pages/operations/workloads.stx +151 -0
- package/dist/ui-src/pages/partials/head.stx +148 -15
- package/dist/ui-src/pages/partials/nav.stx +491 -74
- package/dist/ui-src/pages/partials/op-confirm.stx +6 -6
- package/dist/ui-src/pages/security.stx +264 -0
- package/dist/ui-src/pages/server/actions.stx +17 -26
- package/dist/ui-src/pages/server/capacity.stx +16 -0
- package/dist/ui-src/pages/server/database.stx +31 -16
- package/dist/ui-src/pages/server/deployments.stx +28 -30
- package/dist/ui-src/pages/server/firewall.stx +25 -30
- package/dist/ui-src/pages/server/fleet.stx +10 -0
- package/dist/ui-src/pages/server/logs.stx +11 -9
- package/dist/ui-src/pages/server/metrics.stx +8 -16
- package/dist/ui-src/pages/server/services.stx +19 -28
- package/dist/ui-src/pages/server/sites.stx +75 -72
- package/dist/ui-src/pages/server/ssh-keys.stx +24 -30
- package/dist/ui-src/pages/server/team.stx +286 -149
- package/dist/ui-src/pages/server/terminal.stx +6 -28
- package/dist/ui-src/pages/serverless/alarms.stx +17 -31
- package/dist/ui-src/pages/serverless/assets.stx +13 -22
- package/dist/ui-src/pages/serverless/cost.stx +15 -3
- package/dist/ui-src/pages/serverless/data.stx +12 -25
- package/dist/ui-src/pages/serverless/deployments.stx +14 -23
- package/dist/ui-src/pages/serverless/firewall.stx +5 -1
- package/dist/ui-src/pages/serverless/functions.stx +20 -26
- package/dist/ui-src/pages/serverless/logs.stx +11 -10
- package/dist/ui-src/pages/serverless/metrics.stx +18 -17
- package/dist/ui-src/pages/serverless/queues.stx +34 -42
- package/dist/ui-src/pages/serverless/secrets.stx +31 -34
- package/dist/ui-src/pages/serverless/traces.stx +2 -6
- package/dist/ui-src/pages/serverless.stx +40 -74
- package/package.json +11 -11
- package/dist/chunk-b17vf1g1.js +0 -13787
- package/dist/chunk-b82pbxyp.js +0 -1572
- package/dist/chunk-pqfzdg68.js +0 -12
- package/dist/chunk-z58fqnjm.js +0 -10
- package/dist/ui-src/pages/server/backups.stx +0 -91
- package/dist/ui-src/pages/server/workers.stx +0 -99
- package/dist/ui-src/pages/serverless/scheduler.stx +0 -89
|
@@ -1,1255 +1,1255 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Route53Client
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-32e7ya18.js";
|
|
4
4
|
import {
|
|
5
5
|
S3Client
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-wj3s95p9.js";
|
|
7
7
|
import {
|
|
8
8
|
AWSClient
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-zqtpg06c.js";
|
|
10
10
|
import {
|
|
11
11
|
__require
|
|
12
12
|
} from "./chunk-v0bahtg2.js";
|
|
13
13
|
|
|
14
|
-
// src/aws/
|
|
15
|
-
|
|
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",
|
|
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
|
|
23
|
-
const
|
|
24
|
-
|
|
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: "/
|
|
74
|
+
path: "/",
|
|
28
75
|
headers: {
|
|
29
|
-
"Content-Type": "application/
|
|
76
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
30
77
|
},
|
|
31
|
-
body
|
|
78
|
+
body
|
|
32
79
|
});
|
|
33
|
-
return
|
|
80
|
+
return response;
|
|
34
81
|
}
|
|
35
|
-
async
|
|
36
|
-
const
|
|
37
|
-
|
|
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
|
|
55
|
-
await this.
|
|
56
|
-
|
|
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
|
|
67
|
-
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
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
|
|
93
|
-
await this.
|
|
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
|
|
104
|
-
await this.
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
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
|
|
146
|
-
await this.
|
|
147
|
-
|
|
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
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
|
170
|
-
await this.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
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
|
|
181
|
-
|
|
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
|
|
204
|
-
|
|
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
|
|
219
|
-
|
|
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
|
|
237
|
-
|
|
238
|
-
|
|
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
|
-
|
|
242
|
-
|
|
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
|
-
|
|
246
|
-
const
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
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
|
|
270
|
-
const
|
|
271
|
-
|
|
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
|
|
287
|
-
const
|
|
288
|
-
|
|
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
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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
|
|
306
|
-
|
|
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
|
-
|
|
316
|
-
const
|
|
317
|
-
return
|
|
199
|
+
async updateRoleDescription(params) {
|
|
200
|
+
const response = await this.request("UpdateRoleDescription", params);
|
|
201
|
+
return this.parseRole(response);
|
|
318
202
|
}
|
|
319
|
-
async
|
|
320
|
-
await this.
|
|
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
|
|
336
|
-
await this.
|
|
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
|
|
352
|
-
await this.
|
|
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
|
|
368
|
-
|
|
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
|
|
393
|
-
const
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
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
|
-
|
|
411
|
-
|
|
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
|
-
|
|
415
|
-
const
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
"
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
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
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
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
|
|
493
|
-
|
|
494
|
-
|
|
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
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
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
|
-
|
|
524
|
-
|
|
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
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
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
|
|
588
|
-
const
|
|
589
|
-
const
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
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
|
-
|
|
288
|
+
VersionId: parseXmlValue(response, "VersionId") || "",
|
|
289
|
+
IsDefaultVersion: parseXmlValue(response, "IsDefaultVersion") === "true",
|
|
290
|
+
CreateDate: parseXmlValue(response, "CreateDate")
|
|
611
291
|
};
|
|
612
292
|
}
|
|
613
|
-
async
|
|
614
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
694
|
-
|
|
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
|
|
708
|
-
|
|
709
|
-
return this.parseUser(response);
|
|
308
|
+
async attachGroupPolicy(params) {
|
|
309
|
+
await this.request("AttachGroupPolicy", params);
|
|
710
310
|
}
|
|
711
|
-
async
|
|
712
|
-
|
|
713
|
-
return this.parseUser(response);
|
|
311
|
+
async detachGroupPolicy(params) {
|
|
312
|
+
await this.request("DetachGroupPolicy", params);
|
|
714
313
|
}
|
|
715
|
-
async
|
|
716
|
-
|
|
717
|
-
|
|
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 {
|
|
325
|
+
return { AttachedPolicies: policies, IsTruncated: isTruncated, Marker: marker };
|
|
721
326
|
}
|
|
722
|
-
async
|
|
723
|
-
await this.request("
|
|
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
|
|
726
|
-
await this.request("
|
|
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
|
-
|
|
341
|
+
parsePolicy(xml) {
|
|
729
342
|
return {
|
|
730
|
-
|
|
731
|
-
|
|
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
|
-
|
|
353
|
+
UpdateDate: parseXmlValue(xml, "UpdateDate")
|
|
736
354
|
};
|
|
737
355
|
}
|
|
738
|
-
|
|
739
|
-
const memberXmls = parseXmlArray(xml, "
|
|
356
|
+
parsePolicies(xml) {
|
|
357
|
+
const memberXmls = parseXmlArray(xml, "Policies", "member");
|
|
740
358
|
return memberXmls.map((memberXml) => ({
|
|
741
|
-
|
|
742
|
-
|
|
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
|
-
|
|
369
|
+
UpdateDate: parseXmlValue(memberXml, "UpdateDate")
|
|
747
370
|
}));
|
|
748
371
|
}
|
|
749
|
-
|
|
750
|
-
const
|
|
751
|
-
return
|
|
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
|
-
|
|
754
|
-
const
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
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
|
|
762
|
-
|
|
763
|
-
|
|
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 {
|
|
767
|
-
}
|
|
768
|
-
async updateGroup(params) {
|
|
769
|
-
await this.request("UpdateGroup", params);
|
|
406
|
+
return { PolicyNames: policyNames, IsTruncated: isTruncated, Marker: marker };
|
|
770
407
|
}
|
|
771
|
-
async
|
|
772
|
-
await this.request("
|
|
408
|
+
async putGroupPolicy(params) {
|
|
409
|
+
await this.request("PutGroupPolicy", params);
|
|
773
410
|
}
|
|
774
|
-
async
|
|
775
|
-
await this.request("
|
|
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
|
|
778
|
-
await this.request("
|
|
419
|
+
async deleteGroupPolicy(params) {
|
|
420
|
+
await this.request("DeleteGroupPolicy", params);
|
|
779
421
|
}
|
|
780
|
-
async
|
|
781
|
-
const response = await this.request("
|
|
782
|
-
const
|
|
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 {
|
|
427
|
+
return { PolicyNames: policyNames, IsTruncated: isTruncated, Marker: marker };
|
|
786
428
|
}
|
|
787
|
-
|
|
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
|
-
|
|
790
|
-
|
|
791
|
-
|
|
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
|
-
|
|
797
|
-
|
|
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
|
|
807
|
-
const response = await this.request("
|
|
808
|
-
|
|
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
|
|
811
|
-
const response = await this.request("
|
|
812
|
-
|
|
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
|
|
815
|
-
const response = await this.request("
|
|
816
|
-
const
|
|
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 {
|
|
481
|
+
return { AccessKeyMetadata: keys, IsTruncated: isTruncated, Marker: marker };
|
|
820
482
|
}
|
|
821
|
-
async
|
|
822
|
-
await this.request("
|
|
483
|
+
async updateAccessKey(params) {
|
|
484
|
+
await this.request("UpdateAccessKey", params);
|
|
823
485
|
}
|
|
824
|
-
async
|
|
825
|
-
|
|
826
|
-
|
|
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
|
-
|
|
829
|
-
|
|
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
|
|
832
|
-
await this.request("
|
|
509
|
+
async createInstanceProfile(params) {
|
|
510
|
+
const response = await this.request("CreateInstanceProfile", params);
|
|
511
|
+
return this.parseInstanceProfile(response);
|
|
833
512
|
}
|
|
834
|
-
async
|
|
835
|
-
await this.request("
|
|
513
|
+
async getInstanceProfile(params) {
|
|
514
|
+
const response = await this.request("GetInstanceProfile", params);
|
|
515
|
+
return this.parseInstanceProfile(response);
|
|
836
516
|
}
|
|
837
|
-
async
|
|
838
|
-
await this.request("
|
|
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
|
|
841
|
-
const response = await this.request("
|
|
842
|
-
const
|
|
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 {
|
|
529
|
+
return { InstanceProfiles: profiles, IsTruncated: isTruncated, Marker: marker };
|
|
846
530
|
}
|
|
847
|
-
|
|
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
|
-
|
|
850
|
-
|
|
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
|
-
|
|
860
|
-
const memberXmls = parseXmlArray(xml, "
|
|
549
|
+
parseInstanceProfiles(xml) {
|
|
550
|
+
const memberXmls = parseXmlArray(xml, "InstanceProfiles", "member");
|
|
861
551
|
return memberXmls.map((memberXml) => ({
|
|
862
|
-
|
|
863
|
-
|
|
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
|
|
880
|
-
const response = await this.request("
|
|
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
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
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
|
|
897
|
-
|
|
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
|
|
904
|
-
|
|
905
|
-
|
|
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 {
|
|
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
|
|
919
|
-
await this.request("
|
|
600
|
+
async createAccountAlias(params) {
|
|
601
|
+
await this.request("CreateAccountAlias", params);
|
|
920
602
|
}
|
|
921
|
-
async
|
|
922
|
-
await this.request("
|
|
603
|
+
async deleteAccountAlias(params) {
|
|
604
|
+
await this.request("DeleteAccountAlias", params);
|
|
923
605
|
}
|
|
924
|
-
async
|
|
925
|
-
await this.request("
|
|
606
|
+
async simulatePrincipalPolicy(params) {
|
|
607
|
+
const response = await this.request("SimulatePrincipalPolicy", params);
|
|
608
|
+
return this.parseSimulationResults(response);
|
|
926
609
|
}
|
|
927
|
-
|
|
928
|
-
|
|
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
|
-
|
|
931
|
-
|
|
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
|
|
934
|
-
await this.request(
|
|
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
|
|
937
|
-
await this.request(
|
|
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
|
|
940
|
-
await this.request(
|
|
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
|
|
943
|
-
|
|
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
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
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
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
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
|
|
960
|
-
const
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
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
|
-
|
|
998
|
-
const
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
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
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
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
|
|
1013
|
-
|
|
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
|
|
1016
|
-
const
|
|
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
|
-
|
|
1019
|
-
PolicyName: parseXmlValue(response, "PolicyName") || "",
|
|
1020
|
-
PolicyDocument: decodeURIComponent(parseXmlValue(response, "PolicyDocument") || "")
|
|
832
|
+
SendDataPoints: result.GetSendStatisticsResponse?.GetSendStatisticsResult?.SendDataPoints?.member
|
|
1021
833
|
};
|
|
1022
834
|
}
|
|
1023
|
-
async
|
|
1024
|
-
await this.request(
|
|
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
|
|
1027
|
-
const
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
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
|
|
1034
|
-
|
|
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
|
|
1037
|
-
const
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
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
|
|
1045
|
-
|
|
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
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
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
|
-
|
|
1055
|
-
|
|
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
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
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
|
|
1066
|
-
await this.request(
|
|
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
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
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
|
|
1076
|
-
const
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
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
|
-
|
|
1093
|
-
|
|
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
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
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
|
-
|
|
1118
|
-
|
|
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
|
-
|
|
1126
|
-
const
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
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
|
|
1160
|
-
await this.request(
|
|
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
|
|
1163
|
-
|
|
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
|
-
|
|
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
|
-
|
|
1168
|
-
|
|
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
|
-
|
|
1175
|
-
const
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
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
|
|
1185
|
-
const
|
|
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
|
-
|
|
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
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
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
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
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-
|
|
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 {
|
|
1779
|
+
export { IAMClient, SESClient, EmailClient, email };
|