@mtndev/cli 0.0.0-dev-20260626045346 → 0.0.0-pr-20-20261020022402
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/CHANGELOG.md +86 -1
- package/cjs/__chunks/2FSYDFUV.cjs +146 -0
- package/cjs/__chunks/3A5ZYU5M.cjs +105 -0
- package/cjs/__chunks/3NOHGUCF.cjs +9 -0
- package/cjs/__chunks/3T2LXW7J.cjs +387 -0
- package/cjs/__chunks/4XT5JEAS.cjs +1 -0
- package/cjs/__chunks/AZEB4H4I.cjs +208 -0
- package/cjs/__chunks/B5ENMOCD.cjs +288 -0
- package/cjs/__chunks/B6XM5KSF.cjs +338 -0
- package/cjs/__chunks/BDU2UCE5.cjs +1 -0
- package/cjs/__chunks/BLMSMR5E.cjs +46 -0
- package/cjs/__chunks/CMUD7LLN.cjs +47 -0
- package/cjs/__chunks/DTQ2LB3I.cjs +49 -0
- package/cjs/__chunks/FM5MVRQF.cjs +23 -0
- package/cjs/__chunks/FRHST54J.cjs +135 -0
- package/cjs/__chunks/FU4VP2LN.cjs +1 -0
- package/cjs/__chunks/G5K4PVIL.cjs +26 -0
- package/cjs/__chunks/{NSRFG4DF.cjs → GU3R54MK.cjs} +45 -18
- package/cjs/__chunks/GUL36IFZ.cjs +61 -0
- package/cjs/__chunks/GZMTNK5N.cjs +1 -0
- package/cjs/__chunks/H74JSDBU.cjs +30 -0
- package/cjs/__chunks/{EMMC33QA.cjs → JB7T7PKQ.cjs} +170 -33
- package/cjs/__chunks/JSL2JDMW.cjs +1 -0
- package/cjs/__chunks/K4QNHRTP.cjs +163 -0
- package/cjs/__chunks/KU76LC42.cjs +192 -0
- package/cjs/__chunks/LFDSHANP.cjs +34 -0
- package/cjs/__chunks/LHE24ECK.cjs +192 -0
- package/cjs/__chunks/LIKQ3SI4.cjs +1 -0
- package/cjs/__chunks/LXDF5QVZ.cjs +313 -0
- package/cjs/__chunks/LXOOJR2R.cjs +74 -0
- package/cjs/__chunks/N5MXFOQZ.cjs +167 -0
- package/cjs/__chunks/N7D56LPP.cjs +25 -0
- package/cjs/__chunks/NFXQNOQH.cjs +393 -0
- package/cjs/__chunks/NLKJIUEX.cjs +126 -0
- package/cjs/__chunks/NT2XXAI6.cjs +89 -0
- package/cjs/__chunks/NWZGFHKH.cjs +121 -0
- package/cjs/__chunks/R3GUC7O7.cjs +110 -0
- package/cjs/__chunks/RPVAXPJ4.cjs +1 -0
- package/cjs/__chunks/S3LVCWPN.cjs +23 -0
- package/cjs/__chunks/SBBNW2BF.cjs +249 -0
- package/cjs/__chunks/T2A7TN4F.cjs +81 -0
- package/cjs/__chunks/TKNNDDIB.cjs +97 -0
- package/cjs/__chunks/TNSRDJPR.cjs +1 -0
- package/cjs/__chunks/UWHPE2GI.cjs +20 -0
- package/cjs/__chunks/W6K7BV74.cjs +1 -0
- package/cjs/__chunks/WBOQ6AUN.cjs +320 -0
- package/cjs/__chunks/WHGN5PZI.cjs +299 -0
- package/cjs/__chunks/WOYF2L6T.cjs +11 -0
- package/cjs/__chunks/X26XY2N6.cjs +18 -0
- package/cjs/__chunks/XMKOKRXZ.cjs +16 -0
- package/cjs/__chunks/XTJPQ3EX.cjs +1 -0
- package/cjs/__chunks/YRHFKTW2.cjs +63 -0
- package/cjs/commands/aws/ec2/allow-ip/handler.cjs +12 -0
- package/cjs/commands/aws/ec2/allow-ip/handler.d.ts +6 -0
- package/cjs/commands/aws/ec2/allow-ip/index.cjs +55 -0
- package/cjs/commands/aws/ec2/allow-ip/index.d.ts +3 -0
- package/cjs/commands/aws/ec2/allow-ip/schema.cjs +13 -0
- package/cjs/commands/aws/ec2/allow-ip/schema.d.ts +33 -0
- package/cjs/commands/aws/ec2/allow-ip/utils.cjs +39 -0
- package/cjs/commands/aws/ec2/allow-ip/utils.d.ts +189 -0
- package/cjs/commands/aws/iam/admin-group.cjs +15 -0
- package/cjs/commands/aws/iam/admin-group.d.ts +55 -0
- package/cjs/commands/aws/iam/break-glass/handler.cjs +12 -0
- package/cjs/commands/aws/iam/break-glass/handler.d.ts +7 -0
- package/cjs/commands/aws/iam/break-glass/index.cjs +19 -0
- package/cjs/commands/aws/iam/break-glass/index.d.ts +2 -0
- package/cjs/commands/aws/iam/break-glass/schema.cjs +12 -0
- package/cjs/commands/aws/iam/break-glass/schema.d.ts +25 -0
- package/cjs/commands/aws/iam/check-admin/handler.cjs +10 -0
- package/cjs/commands/aws/iam/check-admin/handler.d.ts +5 -0
- package/cjs/commands/aws/iam/check-admin/index.cjs +17 -0
- package/cjs/commands/aws/iam/check-admin/index.d.ts +2 -0
- package/cjs/commands/aws/iam/check-admin/schema.cjs +12 -0
- package/cjs/commands/aws/iam/check-admin/schema.d.ts +19 -0
- package/cjs/commands/aws/iam/policies/s3-restrictions-deny-non-s3-services.cjs +28 -0
- package/cjs/commands/aws/iam/policies/sts-federation.cjs +19 -0
- package/cjs/commands/aws/iam/policies/user-admins-deny-list.cjs +183 -0
- package/cjs/commands/aws/iam/policies/user-admins-deny-regions-list.cjs +49 -0
- package/cjs/commands/aws/iam/policies/user-admins-self-service-iam.cjs +64 -0
- package/cjs/commands/aws/iam/policies/user-admins-write-list.cjs +125 -0
- package/cjs/commands/aws/iam/remove-admin/handler.cjs +11 -0
- package/cjs/commands/aws/iam/remove-admin/handler.d.ts +6 -0
- package/cjs/commands/aws/iam/remove-admin/index.cjs +18 -0
- package/cjs/commands/aws/iam/remove-admin/index.d.ts +2 -0
- package/cjs/commands/aws/iam/remove-admin/schema.cjs +12 -0
- package/cjs/commands/aws/iam/remove-admin/schema.d.ts +28 -0
- package/cjs/commands/aws/iam/setup-acl/handler.cjs +14 -0
- package/cjs/commands/aws/iam/setup-acl/handler.d.ts +6 -0
- package/cjs/commands/aws/iam/setup-acl/index.cjs +33 -0
- package/cjs/commands/aws/iam/setup-acl/index.d.ts +3 -0
- package/cjs/commands/aws/iam/setup-acl/schema.cjs +7 -0
- package/cjs/commands/aws/iam/setup-acl/schema.d.ts +24 -0
- package/cjs/commands/aws/iam/setup-acl/utils.cjs +20 -0
- package/cjs/commands/aws/iam/setup-acl/utils.d.ts +61 -0
- package/cjs/commands/aws/iam/users/handler.cjs +12 -0
- package/cjs/commands/aws/iam/users/handler.d.ts +5 -0
- package/cjs/commands/aws/iam/users/index.cjs +41 -0
- package/cjs/commands/aws/iam/users/index.d.ts +3 -0
- package/cjs/commands/aws/iam/users/schema.cjs +7 -0
- package/cjs/commands/aws/iam/users/schema.d.ts +18 -0
- package/cjs/commands/aws/iam/users/utils.cjs +30 -0
- package/cjs/commands/aws/iam/users/utils.d.ts +119 -0
- package/cjs/commands/aws/index.cjs +229 -0
- package/cjs/commands/aws/index.d.ts +14 -0
- package/cjs/commands/aws/route53/add-record/handler.cjs +18 -0
- package/cjs/commands/aws/route53/add-record/handler.d.ts +36 -0
- package/cjs/commands/aws/route53/add-record/index.cjs +57 -0
- package/cjs/commands/aws/route53/add-record/index.d.ts +3 -0
- package/cjs/commands/aws/route53/add-record/schema.cjs +11 -0
- package/cjs/commands/aws/route53/add-record/schema.d.ts +45 -0
- package/cjs/commands/aws/route53/add-record/utils.cjs +37 -0
- package/cjs/commands/aws/route53/add-record/utils.d.ts +216 -0
- package/cjs/commands/aws/route53/remove-record/handler.cjs +14 -0
- package/cjs/commands/aws/route53/remove-record/handler.d.ts +6 -0
- package/cjs/commands/aws/route53/remove-record/index.cjs +18 -0
- package/cjs/commands/aws/route53/remove-record/index.d.ts +2 -0
- package/cjs/commands/aws/route53/remove-record/schema.cjs +8 -0
- package/cjs/commands/aws/route53/remove-record/schema.d.ts +30 -0
- package/cjs/commands/aws/schema.cjs +10 -0
- package/cjs/commands/aws/schema.d.ts +13 -0
- package/cjs/commands/aws/ses/send-email/handler.cjs +12 -0
- package/cjs/commands/aws/ses/send-email/handler.d.ts +5 -0
- package/cjs/commands/aws/ses/send-email/index.cjs +23 -0
- package/cjs/commands/aws/ses/send-email/index.d.ts +3 -0
- package/cjs/commands/aws/ses/send-email/schema.cjs +7 -0
- package/cjs/commands/aws/ses/send-email/schema.d.ts +39 -0
- package/cjs/commands/aws/ses/send-email/utils.cjs +11 -0
- package/cjs/commands/aws/ses/send-email/utils.d.ts +47 -0
- package/cjs/commands/aws/ses/smtp-password.cjs +10 -0
- package/cjs/commands/aws/ses/smtp-password.d.ts +21 -0
- package/cjs/commands/aws/utils/exec-aws.cjs +16 -0
- package/cjs/commands/aws/utils/exec-aws.d.ts +79 -0
- package/cjs/commands/aws/utils/resolve-policy-path.cjs +6 -0
- package/cjs/commands/aws/utils/resolve-policy-path.d.ts +8 -0
- package/cjs/commands/aws/utils/resolve-profile.cjs +11 -0
- package/cjs/commands/aws/utils/resolve-profile.d.ts +28 -0
- package/cjs/commands/aws/utils/tty.cjs +10 -0
- package/cjs/commands/aws/utils/tty.d.ts +24 -0
- package/cjs/commands/db/create-readonly-user/handler.cjs +11 -0
- package/cjs/commands/db/create-readonly-user/handler.d.ts +5 -0
- package/cjs/commands/db/create-readonly-user/index.cjs +40 -0
- package/cjs/commands/db/create-readonly-user/index.d.ts +3 -0
- package/cjs/commands/db/create-readonly-user/mysql.cjs +9 -0
- package/cjs/commands/db/create-readonly-user/mysql.d.ts +33 -0
- package/cjs/commands/db/create-readonly-user/postgres.cjs +9 -0
- package/cjs/commands/db/create-readonly-user/postgres.d.ts +31 -0
- package/cjs/commands/db/create-readonly-user/schema.cjs +12 -0
- package/cjs/commands/db/create-readonly-user/schema.d.ts +55 -0
- package/cjs/commands/db/create-readonly-user/utils.cjs +22 -0
- package/cjs/commands/db/create-readonly-user/utils.d.ts +112 -0
- package/cjs/commands/db/index.cjs +44 -0
- package/cjs/commands/db/index.d.ts +6 -0
- package/cjs/commands/doppler/handler.cjs +6 -4
- package/cjs/commands/doppler/index.cjs +32 -5
- package/cjs/commands/doppler/index.d.ts +1 -0
- package/cjs/commands/doppler/schema.cjs +10 -2
- package/cjs/commands/doppler/schema.d.ts +233 -17
- package/cjs/commands/doppler/set-secret.cjs +19 -0
- package/cjs/commands/doppler/set-secret.d.ts +113 -0
- package/cjs/commands/doppler/utils.cjs +6 -2
- package/cjs/commands/doppler/utils.d.ts +32 -8
- package/cjs/commands/icons/schema.d.ts +1 -1
- package/cjs/commands/index.cjs +91 -12
- package/esm/__chunks/2FTTEFEK.js +97 -0
- package/esm/__chunks/33UYMUQD.js +338 -0
- package/esm/__chunks/3BKWTHLJ.js +25 -0
- package/esm/__chunks/3HE4BEJX.js +105 -0
- package/esm/__chunks/3QLI5BDL.js +387 -0
- package/esm/__chunks/5GIUAFXL.js +89 -0
- package/esm/__chunks/73BJG53F.js +11 -0
- package/esm/__chunks/7VF4Q43Q.js +0 -0
- package/esm/__chunks/AEDEAYF5.js +0 -0
- package/esm/__chunks/AZCP3SFJ.js +0 -0
- package/esm/__chunks/B2DVQ2UL.js +61 -0
- package/esm/__chunks/CVQVHLW5.js +0 -0
- package/esm/__chunks/D62SPZXC.js +0 -0
- package/esm/__chunks/DLEJ25GZ.js +121 -0
- package/esm/__chunks/DMYFNF54.js +192 -0
- package/esm/__chunks/DNFTUMGD.js +23 -0
- package/esm/__chunks/DVKD6YSR.js +49 -0
- package/esm/__chunks/EMSH4P76.js +20 -0
- package/esm/__chunks/FFKFVMIE.js +167 -0
- package/esm/__chunks/FNXUONAV.js +110 -0
- package/esm/__chunks/G4NJHFFU.js +320 -0
- package/esm/__chunks/IEOGAQYI.js +46 -0
- package/esm/__chunks/IZFGBYGE.js +34 -0
- package/esm/__chunks/J34UVKLA.js +26 -0
- package/esm/__chunks/JZPBBBIG.js +74 -0
- package/esm/__chunks/KWUJP5MG.js +135 -0
- package/esm/__chunks/M35URMT4.js +313 -0
- package/esm/__chunks/NF3M2L6C.js +81 -0
- package/esm/__chunks/PNPPDYKC.js +299 -0
- package/esm/__chunks/QFXN4EHM.js +393 -0
- package/esm/__chunks/QKDDLIWD.js +146 -0
- package/esm/__chunks/QSE66AKY.js +208 -0
- package/esm/__chunks/QUF7PS4R.js +18 -0
- package/esm/__chunks/S7IJPJ4R.js +126 -0
- package/esm/__chunks/SD3E3EPH.js +163 -0
- package/esm/__chunks/T3TTUHTW.js +30 -0
- package/esm/__chunks/TIOVE6HR.js +0 -0
- package/esm/__chunks/TXKMEIDQ.js +0 -0
- package/esm/__chunks/U7HAE2RF.js +288 -0
- package/esm/__chunks/UXWY7BYE.js +63 -0
- package/esm/__chunks/VKAKISRG.js +192 -0
- package/esm/__chunks/WD2YR6I7.js +0 -0
- package/esm/__chunks/WOZFZKFY.js +0 -0
- package/esm/__chunks/XI7GZDE2.js +0 -0
- package/esm/__chunks/XOUWDB3T.js +249 -0
- package/esm/__chunks/XQN2TA4S.js +23 -0
- package/esm/__chunks/XXK32TIM.js +16 -0
- package/esm/__chunks/{O262GK4B.js → YGWTVPZE.js} +164 -27
- package/esm/__chunks/{6L5RNR7G.js → YRG7PT33.js} +44 -17
- package/esm/__chunks/ZHKVJO2U.js +47 -0
- package/esm/__chunks/ZO55YUSY.js +9 -0
- package/esm/commands/aws/ec2/allow-ip/handler.d.ts +6 -0
- package/esm/commands/aws/ec2/allow-ip/handler.js +12 -0
- package/esm/commands/aws/ec2/allow-ip/index.d.ts +3 -0
- package/esm/commands/aws/ec2/allow-ip/index.js +55 -0
- package/esm/commands/aws/ec2/allow-ip/schema.d.ts +33 -0
- package/esm/commands/aws/ec2/allow-ip/schema.js +13 -0
- package/esm/commands/aws/ec2/allow-ip/utils.d.ts +189 -0
- package/esm/commands/aws/ec2/allow-ip/utils.js +39 -0
- package/esm/commands/aws/iam/admin-group.d.ts +55 -0
- package/esm/commands/aws/iam/admin-group.js +15 -0
- package/esm/commands/aws/iam/break-glass/handler.d.ts +7 -0
- package/esm/commands/aws/iam/break-glass/handler.js +12 -0
- package/esm/commands/aws/iam/break-glass/index.d.ts +2 -0
- package/esm/commands/aws/iam/break-glass/index.js +19 -0
- package/esm/commands/aws/iam/break-glass/schema.d.ts +25 -0
- package/esm/commands/aws/iam/break-glass/schema.js +12 -0
- package/esm/commands/aws/iam/check-admin/handler.d.ts +5 -0
- package/esm/commands/aws/iam/check-admin/handler.js +10 -0
- package/esm/commands/aws/iam/check-admin/index.d.ts +2 -0
- package/esm/commands/aws/iam/check-admin/index.js +17 -0
- package/esm/commands/aws/iam/check-admin/schema.d.ts +19 -0
- package/esm/commands/aws/iam/check-admin/schema.js +12 -0
- package/esm/commands/aws/iam/policies/s3-restrictions-deny-non-s3-services.js +28 -0
- package/esm/commands/aws/iam/policies/sts-federation.js +19 -0
- package/esm/commands/aws/iam/policies/user-admins-deny-list.js +183 -0
- package/esm/commands/aws/iam/policies/user-admins-deny-regions-list.js +49 -0
- package/esm/commands/aws/iam/policies/user-admins-self-service-iam.js +64 -0
- package/esm/commands/aws/iam/policies/user-admins-write-list.js +125 -0
- package/esm/commands/aws/iam/remove-admin/handler.d.ts +6 -0
- package/esm/commands/aws/iam/remove-admin/handler.js +11 -0
- package/esm/commands/aws/iam/remove-admin/index.d.ts +2 -0
- package/esm/commands/aws/iam/remove-admin/index.js +18 -0
- package/esm/commands/aws/iam/remove-admin/schema.d.ts +28 -0
- package/esm/commands/aws/iam/remove-admin/schema.js +12 -0
- package/esm/commands/aws/iam/setup-acl/handler.d.ts +6 -0
- package/esm/commands/aws/iam/setup-acl/handler.js +14 -0
- package/esm/commands/aws/iam/setup-acl/index.d.ts +3 -0
- package/esm/commands/aws/iam/setup-acl/index.js +33 -0
- package/esm/commands/aws/iam/setup-acl/schema.d.ts +24 -0
- package/esm/commands/aws/iam/setup-acl/schema.js +7 -0
- package/esm/commands/aws/iam/setup-acl/utils.d.ts +61 -0
- package/esm/commands/aws/iam/setup-acl/utils.js +20 -0
- package/esm/commands/aws/iam/users/handler.d.ts +5 -0
- package/esm/commands/aws/iam/users/handler.js +12 -0
- package/esm/commands/aws/iam/users/index.d.ts +3 -0
- package/esm/commands/aws/iam/users/index.js +41 -0
- package/esm/commands/aws/iam/users/schema.d.ts +18 -0
- package/esm/commands/aws/iam/users/schema.js +7 -0
- package/esm/commands/aws/iam/users/utils.d.ts +119 -0
- package/esm/commands/aws/iam/users/utils.js +30 -0
- package/esm/commands/aws/index.d.ts +14 -0
- package/esm/commands/aws/index.js +229 -0
- package/esm/commands/aws/route53/add-record/handler.d.ts +36 -0
- package/esm/commands/aws/route53/add-record/handler.js +18 -0
- package/esm/commands/aws/route53/add-record/index.d.ts +3 -0
- package/esm/commands/aws/route53/add-record/index.js +57 -0
- package/esm/commands/aws/route53/add-record/schema.d.ts +45 -0
- package/esm/commands/aws/route53/add-record/schema.js +11 -0
- package/esm/commands/aws/route53/add-record/utils.d.ts +216 -0
- package/esm/commands/aws/route53/add-record/utils.js +37 -0
- package/esm/commands/aws/route53/remove-record/handler.d.ts +6 -0
- package/esm/commands/aws/route53/remove-record/handler.js +14 -0
- package/esm/commands/aws/route53/remove-record/index.d.ts +2 -0
- package/esm/commands/aws/route53/remove-record/index.js +18 -0
- package/esm/commands/aws/route53/remove-record/schema.d.ts +30 -0
- package/esm/commands/aws/route53/remove-record/schema.js +8 -0
- package/esm/commands/aws/schema.d.ts +13 -0
- package/esm/commands/aws/schema.js +10 -0
- package/esm/commands/aws/ses/send-email/handler.d.ts +5 -0
- package/esm/commands/aws/ses/send-email/handler.js +12 -0
- package/esm/commands/aws/ses/send-email/index.d.ts +3 -0
- package/esm/commands/aws/ses/send-email/index.js +23 -0
- package/esm/commands/aws/ses/send-email/schema.d.ts +39 -0
- package/esm/commands/aws/ses/send-email/schema.js +7 -0
- package/esm/commands/aws/ses/send-email/utils.d.ts +47 -0
- package/esm/commands/aws/ses/send-email/utils.js +11 -0
- package/esm/commands/aws/ses/smtp-password.d.ts +21 -0
- package/esm/commands/aws/ses/smtp-password.js +10 -0
- package/esm/commands/aws/utils/exec-aws.d.ts +79 -0
- package/esm/commands/aws/utils/exec-aws.js +16 -0
- package/esm/commands/aws/utils/resolve-policy-path.d.ts +8 -0
- package/esm/commands/aws/utils/resolve-policy-path.js +6 -0
- package/esm/commands/aws/utils/resolve-profile.d.ts +28 -0
- package/esm/commands/aws/utils/resolve-profile.js +11 -0
- package/esm/commands/aws/utils/tty.d.ts +24 -0
- package/esm/commands/aws/utils/tty.js +10 -0
- package/esm/commands/db/create-readonly-user/handler.d.ts +5 -0
- package/esm/commands/db/create-readonly-user/handler.js +11 -0
- package/esm/commands/db/create-readonly-user/index.d.ts +3 -0
- package/esm/commands/db/create-readonly-user/index.js +40 -0
- package/esm/commands/db/create-readonly-user/mysql.d.ts +33 -0
- package/esm/commands/db/create-readonly-user/mysql.js +9 -0
- package/esm/commands/db/create-readonly-user/postgres.d.ts +31 -0
- package/esm/commands/db/create-readonly-user/postgres.js +9 -0
- package/esm/commands/db/create-readonly-user/schema.d.ts +55 -0
- package/esm/commands/db/create-readonly-user/schema.js +12 -0
- package/esm/commands/db/create-readonly-user/utils.d.ts +112 -0
- package/esm/commands/db/create-readonly-user/utils.js +22 -0
- package/esm/commands/db/index.d.ts +6 -0
- package/esm/commands/db/index.js +44 -0
- package/esm/commands/doppler/handler.js +5 -3
- package/esm/commands/doppler/index.d.ts +1 -0
- package/esm/commands/doppler/index.js +32 -5
- package/esm/commands/doppler/schema.d.ts +233 -17
- package/esm/commands/doppler/schema.js +11 -3
- package/esm/commands/doppler/set-secret.d.ts +113 -0
- package/esm/commands/doppler/set-secret.js +19 -0
- package/esm/commands/doppler/utils.d.ts +32 -8
- package/esm/commands/doppler/utils.js +5 -1
- package/esm/commands/icons/schema.d.ts +1 -1
- package/esm/commands/index.js +86 -7
- package/package.json +13 -3
- package/vitest.config.ts +11 -0
- package/cjs/__chunks/4GFJUCSP.cjs +0 -52
- package/esm/__chunks/X3R5PSWH.js +0 -52
- /package/cjs/__chunks/{WNJ3ZYLI.cjs → 3BY5Y4W7.cjs} +0 -0
- /package/esm/__chunks/{46HGXFME.js → 5ZBVGSOK.js} +0 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _G5K4PVILcjs = require('./G5K4PVIL.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _R3GUC7O7cjs = require('./R3GUC7O7.cjs');
|
|
8
|
+
|
|
9
|
+
// src/commands/aws/ec2/allow-ip/utils.js
|
|
10
|
+
async function getCurrentPublicIp() {
|
|
11
|
+
const urls = ["https://checkip.amazonaws.com", "https://api.ipify.org"];
|
|
12
|
+
for (const url of urls) {
|
|
13
|
+
try {
|
|
14
|
+
const controller = new AbortController();
|
|
15
|
+
const timeout = setTimeout(() => controller.abort(), 8e3);
|
|
16
|
+
const response = await fetch(url, { signal: controller.signal });
|
|
17
|
+
clearTimeout(timeout);
|
|
18
|
+
if (!response.ok) continue;
|
|
19
|
+
const ip = (await response.text()).trim();
|
|
20
|
+
if (ip && ip.includes(".")) {
|
|
21
|
+
return ip;
|
|
22
|
+
}
|
|
23
|
+
} catch (e) {
|
|
24
|
+
continue;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
throw new Error("Could not determine your current public IP address");
|
|
28
|
+
}
|
|
29
|
+
function listEnabledRegions(params) {
|
|
30
|
+
const { profile, region, verbose } = params;
|
|
31
|
+
const data = _R3GUC7O7cjs.runAws.call(void 0, {
|
|
32
|
+
profile,
|
|
33
|
+
region,
|
|
34
|
+
args: [
|
|
35
|
+
"ec2",
|
|
36
|
+
"describe-regions",
|
|
37
|
+
"--query",
|
|
38
|
+
"Regions[?OptInStatus!=`not-opted-in`].RegionName"
|
|
39
|
+
],
|
|
40
|
+
verbose
|
|
41
|
+
});
|
|
42
|
+
const regions = Array.isArray(data) ? data : [];
|
|
43
|
+
return regions.map((value) => String(value)).sort();
|
|
44
|
+
}
|
|
45
|
+
function listInstances(params) {
|
|
46
|
+
const { profile, region, verbose } = params;
|
|
47
|
+
const data = _R3GUC7O7cjs.runAws.call(void 0, {
|
|
48
|
+
profile,
|
|
49
|
+
region,
|
|
50
|
+
args: ["ec2", "describe-instances"],
|
|
51
|
+
verbose
|
|
52
|
+
});
|
|
53
|
+
const instances = [];
|
|
54
|
+
for (const reservation of _nullishCoalesce(data.Reservations, () => ( []))) {
|
|
55
|
+
for (const raw of _nullishCoalesce(reservation.Instances, () => ( []))) {
|
|
56
|
+
const state = _nullishCoalesce(_optionalChain([raw, 'access', _ => _.State, 'optionalAccess', _2 => _2.Name]), () => ( "unknown"));
|
|
57
|
+
if (state === "terminated" || state === "shutting-down") {
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
let name = "";
|
|
61
|
+
for (const tag of _nullishCoalesce(raw.Tags, () => ( []))) {
|
|
62
|
+
if (tag.Key === "Name") {
|
|
63
|
+
name = _nullishCoalesce(tag.Value, () => ( ""));
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const securityGroupIds = (_nullishCoalesce(raw.SecurityGroups, () => ( []))).map((group) => group.GroupId).filter((id) => Boolean(id));
|
|
68
|
+
instances.push({
|
|
69
|
+
instanceId: raw.InstanceId,
|
|
70
|
+
name,
|
|
71
|
+
state,
|
|
72
|
+
instanceType: _nullishCoalesce(raw.InstanceType, () => ( "unknown")),
|
|
73
|
+
publicIp: _nullishCoalesce(raw.PublicIpAddress, () => ( null)),
|
|
74
|
+
securityGroupIds
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
instances.sort(
|
|
79
|
+
(a, b) => a.name.toLowerCase().localeCompare(b.name.toLowerCase()) || a.instanceId.localeCompare(b.instanceId)
|
|
80
|
+
);
|
|
81
|
+
return instances;
|
|
82
|
+
}
|
|
83
|
+
function describeSecurityGroups(params) {
|
|
84
|
+
const { profile, region, groupIds, verbose } = params;
|
|
85
|
+
if (groupIds.length === 0) {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
88
|
+
const data = _R3GUC7O7cjs.runAws.call(void 0, {
|
|
89
|
+
profile,
|
|
90
|
+
region,
|
|
91
|
+
args: ["ec2", "describe-security-groups", "--group-ids", ...groupIds],
|
|
92
|
+
verbose
|
|
93
|
+
});
|
|
94
|
+
const groups = (_nullishCoalesce(data.SecurityGroups, () => ( []))).map((raw) => ({
|
|
95
|
+
groupId: raw.GroupId,
|
|
96
|
+
groupName: _nullishCoalesce(raw.GroupName, () => ( "")),
|
|
97
|
+
description: _nullishCoalesce(raw.Description, () => ( ""))
|
|
98
|
+
}));
|
|
99
|
+
groups.sort((a, b) => a.groupName.localeCompare(b.groupName));
|
|
100
|
+
return groups;
|
|
101
|
+
}
|
|
102
|
+
function getSecurityGroupDetails(params) {
|
|
103
|
+
const { profile, region, groupId, verbose } = params;
|
|
104
|
+
const data = _R3GUC7O7cjs.runAws.call(void 0, {
|
|
105
|
+
profile,
|
|
106
|
+
region,
|
|
107
|
+
args: ["ec2", "describe-security-groups", "--group-ids", groupId],
|
|
108
|
+
verbose
|
|
109
|
+
});
|
|
110
|
+
const securityGroups = _nullishCoalesce(data.SecurityGroups, () => ( []));
|
|
111
|
+
if (securityGroups.length === 0) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
return securityGroups[0];
|
|
115
|
+
}
|
|
116
|
+
function isSingleHostCidr(cidrIp) {
|
|
117
|
+
return cidrIp.endsWith("/32") && cidrIp !== "0.0.0.0/0";
|
|
118
|
+
}
|
|
119
|
+
function portAllowsSsh(permission) {
|
|
120
|
+
const protocol = permission.IpProtocol;
|
|
121
|
+
if (protocol !== "tcp" && protocol !== "6") {
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
const fromPort = permission.FromPort;
|
|
125
|
+
const toPort = permission.ToPort;
|
|
126
|
+
if (fromPort === void 0 && toPort === void 0) {
|
|
127
|
+
return true;
|
|
128
|
+
}
|
|
129
|
+
if (fromPort === void 0 || toPort === void 0) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
return fromPort <= _G5K4PVILcjs.SSH_PORT && _G5K4PVILcjs.SSH_PORT <= toPort;
|
|
133
|
+
}
|
|
134
|
+
function listSshIngressRules(securityGroup) {
|
|
135
|
+
const rules = [];
|
|
136
|
+
for (const permission of _nullishCoalesce(securityGroup.IpPermissions, () => ( []))) {
|
|
137
|
+
if (!portAllowsSsh(permission)) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
const fromPort = _nullishCoalesce(permission.FromPort, () => ( _G5K4PVILcjs.SSH_PORT));
|
|
141
|
+
const toPort = _nullishCoalesce(permission.ToPort, () => ( _G5K4PVILcjs.SSH_PORT));
|
|
142
|
+
const ipProtocol = _nullishCoalesce(permission.IpProtocol, () => ( "tcp"));
|
|
143
|
+
for (const ipRange of _nullishCoalesce(permission.IpRanges, () => ( []))) {
|
|
144
|
+
const cidrIp = ipRange.CidrIp;
|
|
145
|
+
if (!cidrIp || !isSingleHostCidr(cidrIp)) {
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
rules.push({
|
|
149
|
+
cidrIp,
|
|
150
|
+
description: _nullishCoalesce(ipRange.Description, () => ( "")),
|
|
151
|
+
fromPort,
|
|
152
|
+
toPort,
|
|
153
|
+
ipProtocol
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return rules;
|
|
158
|
+
}
|
|
159
|
+
function extractRoamingFirstName(params) {
|
|
160
|
+
const { profile, identity } = params;
|
|
161
|
+
const arn = _nullishCoalesce(identity.Arn, () => ( ""));
|
|
162
|
+
const username = arn.includes("/") ? _nullishCoalesce(arn.split("/").pop(), () => ( "")) : "";
|
|
163
|
+
for (const candidate of [username, _nullishCoalesce(profile, () => ( ""))]) {
|
|
164
|
+
if (!candidate) continue;
|
|
165
|
+
const match = /^md-([^-]+)-/.exec(candidate);
|
|
166
|
+
if (match && match[1]) {
|
|
167
|
+
return match[1].charAt(0).toUpperCase() + match[1].slice(1).toLowerCase();
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
return _G5K4PVILcjs.DEFAULT_ROAMING_NAME;
|
|
171
|
+
}
|
|
172
|
+
function roamingRuleDescription(firstName) {
|
|
173
|
+
return `${firstName} Roaming`;
|
|
174
|
+
}
|
|
175
|
+
function resolveRoamingRule(sshRules, ruleDescription) {
|
|
176
|
+
const target = ruleDescription.toLowerCase();
|
|
177
|
+
for (const rule of sshRules) {
|
|
178
|
+
if (rule.description.trim().toLowerCase() === target) {
|
|
179
|
+
return rule;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
function ruleAlreadyAllowsIp(sshRules, newCidr) {
|
|
185
|
+
for (const rule of sshRules) {
|
|
186
|
+
if (rule.cidrIp === newCidr) {
|
|
187
|
+
return rule;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return null;
|
|
191
|
+
}
|
|
192
|
+
function buildIpPermissions(params) {
|
|
193
|
+
const {
|
|
194
|
+
cidrIp,
|
|
195
|
+
description,
|
|
196
|
+
fromPort = _G5K4PVILcjs.SSH_PORT,
|
|
197
|
+
toPort = _G5K4PVILcjs.SSH_PORT,
|
|
198
|
+
ipProtocol = "tcp"
|
|
199
|
+
} = params;
|
|
200
|
+
return JSON.stringify([
|
|
201
|
+
{
|
|
202
|
+
IpProtocol: ipProtocol,
|
|
203
|
+
FromPort: fromPort,
|
|
204
|
+
ToPort: toPort,
|
|
205
|
+
IpRanges: [{ CidrIp: cidrIp, Description: description }]
|
|
206
|
+
}
|
|
207
|
+
]);
|
|
208
|
+
}
|
|
209
|
+
function authorizeRule(params) {
|
|
210
|
+
const { profile, region, groupId, verbose, ...rule } = params;
|
|
211
|
+
_R3GUC7O7cjs.runAws.call(void 0, {
|
|
212
|
+
profile,
|
|
213
|
+
region,
|
|
214
|
+
args: [
|
|
215
|
+
"ec2",
|
|
216
|
+
"authorize-security-group-ingress",
|
|
217
|
+
"--group-id",
|
|
218
|
+
groupId,
|
|
219
|
+
"--ip-permissions",
|
|
220
|
+
buildIpPermissions(rule)
|
|
221
|
+
],
|
|
222
|
+
expectJson: false,
|
|
223
|
+
verbose
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
function revokeRule(params) {
|
|
227
|
+
const { profile, region, groupId, rule, verbose } = params;
|
|
228
|
+
_R3GUC7O7cjs.runAws.call(void 0, {
|
|
229
|
+
profile,
|
|
230
|
+
region,
|
|
231
|
+
args: [
|
|
232
|
+
"ec2",
|
|
233
|
+
"revoke-security-group-ingress",
|
|
234
|
+
"--group-id",
|
|
235
|
+
groupId,
|
|
236
|
+
"--ip-permissions",
|
|
237
|
+
buildIpPermissions({
|
|
238
|
+
cidrIp: rule.cidrIp,
|
|
239
|
+
description: rule.description,
|
|
240
|
+
fromPort: rule.fromPort,
|
|
241
|
+
toPort: rule.toPort,
|
|
242
|
+
ipProtocol: rule.ipProtocol
|
|
243
|
+
})
|
|
244
|
+
],
|
|
245
|
+
expectJson: false,
|
|
246
|
+
verbose
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
function instanceLabel(instance) {
|
|
250
|
+
const publicIp = instance.publicIp || "no public IP";
|
|
251
|
+
const name = instance.name || "(no name)";
|
|
252
|
+
return `${instance.instanceId} ${name} ${instance.state} ${instance.instanceType} ${publicIp}`;
|
|
253
|
+
}
|
|
254
|
+
function securityGroupLabel(group) {
|
|
255
|
+
return `${group.groupId} ${group.groupName} ${group.description}`;
|
|
256
|
+
}
|
|
257
|
+
function sshRuleLabel(rule) {
|
|
258
|
+
const description = rule.description || "(no description)";
|
|
259
|
+
return `${rule.cidrIp} ${description}`;
|
|
260
|
+
}
|
|
261
|
+
function printSshRules(sshRules, log = console.log) {
|
|
262
|
+
if (sshRules.length === 0) {
|
|
263
|
+
log(" (no single-host SSH rules on port 22)");
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
for (const rule of sshRules) {
|
|
267
|
+
log(` - ${sshRuleLabel(rule)}`);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
exports.getCurrentPublicIp = getCurrentPublicIp; exports.listEnabledRegions = listEnabledRegions; exports.listInstances = listInstances; exports.describeSecurityGroups = describeSecurityGroups; exports.getSecurityGroupDetails = getSecurityGroupDetails; exports.listSshIngressRules = listSshIngressRules; exports.extractRoamingFirstName = extractRoamingFirstName; exports.roamingRuleDescription = roamingRuleDescription; exports.resolveRoamingRule = resolveRoamingRule; exports.ruleAlreadyAllowsIp = ruleAlreadyAllowsIp; exports.authorizeRule = authorizeRule; exports.revokeRule = revokeRule; exports.instanceLabel = instanceLabel; exports.securityGroupLabel = securityGroupLabel; exports.sshRuleLabel = sshRuleLabel; exports.printSshRules = printSshRules;
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _BLMSMR5Ecjs = require('./BLMSMR5E.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _R3GUC7O7cjs = require('./R3GUC7O7.cjs');
|
|
7
|
+
|
|
8
|
+
// src/commands/aws/route53/add-record/utils.js
|
|
9
|
+
function bareHostedZoneId(rawId) {
|
|
10
|
+
return rawId.replace(/^\/hostedzone\//, "");
|
|
11
|
+
}
|
|
12
|
+
function withTrailingDot(name) {
|
|
13
|
+
const trimmed = name.trim();
|
|
14
|
+
if (trimmed === "") {
|
|
15
|
+
return trimmed;
|
|
16
|
+
}
|
|
17
|
+
return trimmed.endsWith(".") ? trimmed : `${trimmed}.`;
|
|
18
|
+
}
|
|
19
|
+
function withoutTrailingDot(name) {
|
|
20
|
+
return name.endsWith(".") ? name.slice(0, -1) : name;
|
|
21
|
+
}
|
|
22
|
+
function listHostedZones(params) {
|
|
23
|
+
const { profile, verbose } = params;
|
|
24
|
+
const data = _R3GUC7O7cjs.runAws.call(void 0, {
|
|
25
|
+
profile,
|
|
26
|
+
args: ["route53", "list-hosted-zones"],
|
|
27
|
+
verbose
|
|
28
|
+
});
|
|
29
|
+
const zones = [];
|
|
30
|
+
for (const zone of _nullishCoalesce(data.HostedZones, () => ( []))) {
|
|
31
|
+
const id = bareHostedZoneId(String(_nullishCoalesce(zone.Id, () => ( ""))));
|
|
32
|
+
const name = withTrailingDot(String(_nullishCoalesce(zone.Name, () => ( ""))));
|
|
33
|
+
if (!id || !name) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
zones.push({
|
|
37
|
+
id,
|
|
38
|
+
name,
|
|
39
|
+
privateZone: Boolean(_optionalChain([zone, 'access', _ => _.Config, 'optionalAccess', _2 => _2.PrivateZone])),
|
|
40
|
+
recordCount: Number(_nullishCoalesce(zone.ResourceRecordSetCount, () => ( 0)))
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return zones.sort((a, b) => a.name.localeCompare(b.name));
|
|
44
|
+
}
|
|
45
|
+
function findHostedZone(params) {
|
|
46
|
+
const { zones, zoneInput } = params;
|
|
47
|
+
const input = zoneInput.trim();
|
|
48
|
+
if (!input) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const bareId = bareHostedZoneId(input);
|
|
52
|
+
const byId = zones.find((zone) => zone.id === bareId);
|
|
53
|
+
if (byId) {
|
|
54
|
+
return byId;
|
|
55
|
+
}
|
|
56
|
+
const normalized = withTrailingDot(input).toLowerCase();
|
|
57
|
+
const matches = zones.filter(
|
|
58
|
+
(zone) => zone.name.toLowerCase() === normalized
|
|
59
|
+
);
|
|
60
|
+
if (matches.length === 1) {
|
|
61
|
+
return _nullishCoalesce(matches[0], () => ( null));
|
|
62
|
+
}
|
|
63
|
+
if (matches.length > 1) {
|
|
64
|
+
return _nullishCoalesce(_nullishCoalesce(matches.find((zone) => !zone.privateZone), () => ( matches[0])), () => ( null));
|
|
65
|
+
}
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
function hostedZoneLabel(zone) {
|
|
69
|
+
const visibility = zone.privateZone ? "private" : "public";
|
|
70
|
+
return `${withoutTrailingDot(zone.name)} (${zone.id}, ${visibility}, ${zone.recordCount} records)`;
|
|
71
|
+
}
|
|
72
|
+
function resolveRecordName(params) {
|
|
73
|
+
const { nameInput, zoneName } = params;
|
|
74
|
+
const zoneFqdn = withTrailingDot(zoneName);
|
|
75
|
+
const raw = nameInput.trim();
|
|
76
|
+
if (raw === "" || raw === "@") {
|
|
77
|
+
return zoneFqdn;
|
|
78
|
+
}
|
|
79
|
+
const asFqdn = withTrailingDot(raw);
|
|
80
|
+
const zoneLower = zoneFqdn.toLowerCase();
|
|
81
|
+
if (asFqdn.toLowerCase() === zoneLower) {
|
|
82
|
+
return zoneFqdn;
|
|
83
|
+
}
|
|
84
|
+
if (asFqdn.toLowerCase().endsWith(`.${zoneLower}`)) {
|
|
85
|
+
return asFqdn;
|
|
86
|
+
}
|
|
87
|
+
const relative = raw.replace(/\.$/, "");
|
|
88
|
+
return withTrailingDot(`${relative}.${withoutTrailingDot(zoneFqdn)}`);
|
|
89
|
+
}
|
|
90
|
+
function getRecordSetsAtName(params) {
|
|
91
|
+
const { profile, hostedZoneId, name, verbose } = params;
|
|
92
|
+
const targetName = withTrailingDot(name).toLowerCase();
|
|
93
|
+
let startRecordName = withTrailingDot(name);
|
|
94
|
+
let startRecordType;
|
|
95
|
+
let nextRecordIdentifier;
|
|
96
|
+
const collected = [];
|
|
97
|
+
for (let page = 0; page < 20; page += 1) {
|
|
98
|
+
const args = [
|
|
99
|
+
"route53",
|
|
100
|
+
"list-resource-record-sets",
|
|
101
|
+
"--hosted-zone-id",
|
|
102
|
+
hostedZoneId,
|
|
103
|
+
"--max-items",
|
|
104
|
+
"100"
|
|
105
|
+
];
|
|
106
|
+
if (startRecordName) {
|
|
107
|
+
args.push("--start-record-name", startRecordName);
|
|
108
|
+
}
|
|
109
|
+
if (startRecordType) {
|
|
110
|
+
args.push("--start-record-type", startRecordType);
|
|
111
|
+
}
|
|
112
|
+
if (nextRecordIdentifier) {
|
|
113
|
+
args.push("--start-record-identifier", nextRecordIdentifier);
|
|
114
|
+
}
|
|
115
|
+
const data = _R3GUC7O7cjs.runAws.call(void 0, { profile, args, verbose });
|
|
116
|
+
const sets = _nullishCoalesce(data.ResourceRecordSets, () => ( []));
|
|
117
|
+
for (const set of sets) {
|
|
118
|
+
const setName = withTrailingDot(String(_nullishCoalesce(set.Name, () => ( "")))).toLowerCase();
|
|
119
|
+
if (setName === targetName) {
|
|
120
|
+
collected.push(normalizeRecordSet(set));
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
if (setName > targetName) {
|
|
124
|
+
return collected;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
const truncated = data.IsTruncated === true;
|
|
128
|
+
if (!truncated) {
|
|
129
|
+
return collected;
|
|
130
|
+
}
|
|
131
|
+
startRecordName = data.NextRecordName ? String(data.NextRecordName) : startRecordName;
|
|
132
|
+
startRecordType = data.NextRecordType ? String(data.NextRecordType) : void 0;
|
|
133
|
+
nextRecordIdentifier = data.NextRecordIdentifier ? String(data.NextRecordIdentifier) : void 0;
|
|
134
|
+
}
|
|
135
|
+
return collected;
|
|
136
|
+
}
|
|
137
|
+
function getResourceRecordSet(params) {
|
|
138
|
+
const { type, ...rest } = params;
|
|
139
|
+
const targetType = type.toUpperCase();
|
|
140
|
+
const sets = getRecordSetsAtName(rest);
|
|
141
|
+
return _nullishCoalesce(sets.find((set) => set.type === targetType), () => ( null));
|
|
142
|
+
}
|
|
143
|
+
function findCnameConflicts(params) {
|
|
144
|
+
const { existingSets, type } = params;
|
|
145
|
+
const upperType = type.toUpperCase();
|
|
146
|
+
return existingSets.filter((set) => {
|
|
147
|
+
if (set.type === upperType) {
|
|
148
|
+
return false;
|
|
149
|
+
}
|
|
150
|
+
return upperType === "CNAME" || set.type === "CNAME";
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function normalizeRecordSet(set) {
|
|
154
|
+
const values = (_nullishCoalesce(set.ResourceRecords, () => ( []))).map(
|
|
155
|
+
(record) => String(_nullishCoalesce(record.Value, () => ( "")))
|
|
156
|
+
);
|
|
157
|
+
return {
|
|
158
|
+
name: withTrailingDot(String(_nullishCoalesce(set.Name, () => ( "")))),
|
|
159
|
+
type: String(_nullishCoalesce(set.Type, () => ( ""))).toUpperCase(),
|
|
160
|
+
ttl: typeof set.TTL === "number" ? set.TTL : void 0,
|
|
161
|
+
values,
|
|
162
|
+
isAlias: Boolean(set.AliasTarget),
|
|
163
|
+
aliasTarget: _nullishCoalesce(set.AliasTarget, () => ( void 0))
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function formatValues(values) {
|
|
167
|
+
if (values.length === 0) {
|
|
168
|
+
return "(none)";
|
|
169
|
+
}
|
|
170
|
+
if (values.length === 1) {
|
|
171
|
+
return _nullishCoalesce(values[0], () => ( "(none)"));
|
|
172
|
+
}
|
|
173
|
+
return values.map((value) => `
|
|
174
|
+
- ${value}`).join("");
|
|
175
|
+
}
|
|
176
|
+
function normalizeRecordValue(params) {
|
|
177
|
+
const { type, value } = params;
|
|
178
|
+
const trimmed = value.trim();
|
|
179
|
+
if (type === "CNAME" || type === "NS" || type === "MX" || type === "SRV") {
|
|
180
|
+
if (type === "MX") {
|
|
181
|
+
const parts = trimmed.split(/\s+/);
|
|
182
|
+
if (parts.length >= 2) {
|
|
183
|
+
const priority = parts[0];
|
|
184
|
+
const exchange = parts.slice(1).join(" ");
|
|
185
|
+
return `${priority} ${withTrailingDot(exchange)}`;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (type === "SRV") {
|
|
189
|
+
const parts = trimmed.split(/\s+/);
|
|
190
|
+
if (parts.length >= 4) {
|
|
191
|
+
const prefix = parts.slice(0, 3).join(" ");
|
|
192
|
+
const target = parts.slice(3).join(" ");
|
|
193
|
+
return `${prefix} ${withTrailingDot(target)}`;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return withTrailingDot(trimmed);
|
|
197
|
+
}
|
|
198
|
+
if (type === "TXT") {
|
|
199
|
+
if (trimmed.startsWith('"') && trimmed.endsWith('"') || trimmed.startsWith("'") && trimmed.endsWith("'")) {
|
|
200
|
+
return trimmed;
|
|
201
|
+
}
|
|
202
|
+
return `"${trimmed}"`;
|
|
203
|
+
}
|
|
204
|
+
return trimmed;
|
|
205
|
+
}
|
|
206
|
+
function planRecordChange(params) {
|
|
207
|
+
const { existing, newValue, mode = "replace" } = params;
|
|
208
|
+
if (!existing) {
|
|
209
|
+
return {
|
|
210
|
+
action: "create",
|
|
211
|
+
finalValues: [newValue],
|
|
212
|
+
summary: "Adding a new record (nothing exists at this name + type)."
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
if (existing.isAlias) {
|
|
216
|
+
return {
|
|
217
|
+
action: "overwrite",
|
|
218
|
+
finalValues: [newValue],
|
|
219
|
+
summary: "Overwriting an existing ALIAS record with a standard record set."
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
const alreadyPresent = existing.values.some(
|
|
223
|
+
(value) => value === newValue || value === `"${newValue}"`
|
|
224
|
+
);
|
|
225
|
+
if (alreadyPresent && mode !== "replace") {
|
|
226
|
+
return {
|
|
227
|
+
action: "noop",
|
|
228
|
+
finalValues: existing.values,
|
|
229
|
+
summary: "Record already has this value. Nothing to do."
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
if (alreadyPresent && mode === "replace" && existing.values.length === 1 && existing.values[0] === newValue) {
|
|
233
|
+
return {
|
|
234
|
+
action: "noop",
|
|
235
|
+
finalValues: existing.values,
|
|
236
|
+
summary: "Record already has exactly this value. Nothing to do."
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
if (mode === "append") {
|
|
240
|
+
return {
|
|
241
|
+
action: "append",
|
|
242
|
+
finalValues: [...existing.values, newValue],
|
|
243
|
+
summary: `Adding to the existing ${existing.type} record (${existing.values.length} value(s) \u2192 ${existing.values.length + 1}).`
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
return {
|
|
247
|
+
action: "overwrite",
|
|
248
|
+
finalValues: [newValue],
|
|
249
|
+
summary: existing.values.length === 1 ? `Overwriting existing value:
|
|
250
|
+
${existing.values[0]}
|
|
251
|
+
\u2192 ${newValue}` : `Replacing ${existing.values.length} existing values with a single new value.`
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
function upsertResourceRecordSet(params) {
|
|
255
|
+
const { profile, hostedZoneId, name, type, ttl, values, verbose } = params;
|
|
256
|
+
const changeBatch = {
|
|
257
|
+
Comment: `mtn aws route53 add-record: ${type} ${name}`,
|
|
258
|
+
Changes: [
|
|
259
|
+
{
|
|
260
|
+
Action: "UPSERT",
|
|
261
|
+
ResourceRecordSet: {
|
|
262
|
+
Name: withTrailingDot(name),
|
|
263
|
+
Type: type,
|
|
264
|
+
TTL: _nullishCoalesce(ttl, () => ( _BLMSMR5Ecjs.DEFAULT_TTL)),
|
|
265
|
+
ResourceRecords: values.map((value) => ({ Value: value }))
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
};
|
|
270
|
+
const data = _R3GUC7O7cjs.runAws.call(void 0, {
|
|
271
|
+
profile,
|
|
272
|
+
args: [
|
|
273
|
+
"route53",
|
|
274
|
+
"change-resource-record-sets",
|
|
275
|
+
"--hosted-zone-id",
|
|
276
|
+
hostedZoneId,
|
|
277
|
+
"--change-batch",
|
|
278
|
+
JSON.stringify(changeBatch)
|
|
279
|
+
],
|
|
280
|
+
verbose
|
|
281
|
+
});
|
|
282
|
+
return _nullishCoalesce(data.ChangeInfo, () => ( data));
|
|
283
|
+
}
|
|
284
|
+
function deleteResourceRecordSet(params) {
|
|
285
|
+
const { profile, hostedZoneId, record, verbose } = params;
|
|
286
|
+
const resourceRecordSet = {
|
|
287
|
+
Name: withTrailingDot(record.name),
|
|
288
|
+
Type: record.type
|
|
289
|
+
};
|
|
290
|
+
if (record.isAlias && record.aliasTarget) {
|
|
291
|
+
resourceRecordSet.AliasTarget = record.aliasTarget;
|
|
292
|
+
} else {
|
|
293
|
+
resourceRecordSet.TTL = _nullishCoalesce(record.ttl, () => ( _BLMSMR5Ecjs.DEFAULT_TTL));
|
|
294
|
+
resourceRecordSet.ResourceRecords = record.values.map((value) => ({
|
|
295
|
+
Value: value
|
|
296
|
+
}));
|
|
297
|
+
}
|
|
298
|
+
const changeBatch = {
|
|
299
|
+
Comment: `mtn aws route53 remove-record: ${record.type} ${record.name}`,
|
|
300
|
+
Changes: [
|
|
301
|
+
{
|
|
302
|
+
Action: "DELETE",
|
|
303
|
+
ResourceRecordSet: resourceRecordSet
|
|
304
|
+
}
|
|
305
|
+
]
|
|
306
|
+
};
|
|
307
|
+
const data = _R3GUC7O7cjs.runAws.call(void 0, {
|
|
308
|
+
profile,
|
|
309
|
+
args: [
|
|
310
|
+
"route53",
|
|
311
|
+
"change-resource-record-sets",
|
|
312
|
+
"--hosted-zone-id",
|
|
313
|
+
hostedZoneId,
|
|
314
|
+
"--change-batch",
|
|
315
|
+
JSON.stringify(changeBatch)
|
|
316
|
+
],
|
|
317
|
+
verbose
|
|
318
|
+
});
|
|
319
|
+
return _nullishCoalesce(data.ChangeInfo, () => ( data));
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
exports.bareHostedZoneId = bareHostedZoneId; exports.withTrailingDot = withTrailingDot; exports.withoutTrailingDot = withoutTrailingDot; exports.listHostedZones = listHostedZones; exports.findHostedZone = findHostedZone; exports.hostedZoneLabel = hostedZoneLabel; exports.resolveRecordName = resolveRecordName; exports.getRecordSetsAtName = getRecordSetsAtName; exports.getResourceRecordSet = getResourceRecordSet; exports.findCnameConflicts = findCnameConflicts; exports.formatValues = formatValues; exports.normalizeRecordValue = normalizeRecordValue; exports.planRecordChange = planRecordChange; exports.upsertResourceRecordSet = upsertResourceRecordSet; exports.deleteResourceRecordSet = deleteResourceRecordSet;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _WOYF2L6Tcjs = require('./WOYF2L6T.cjs');
|
|
5
|
+
|
|
6
|
+
// src/commands/aws/route53/add-record/schema.js
|
|
7
|
+
var _zod = require('zod');
|
|
8
|
+
var RECORD_TYPES = [
|
|
9
|
+
"A",
|
|
10
|
+
"AAAA",
|
|
11
|
+
"CNAME",
|
|
12
|
+
"TXT",
|
|
13
|
+
"MX",
|
|
14
|
+
"NS",
|
|
15
|
+
"SRV",
|
|
16
|
+
"CAA"
|
|
17
|
+
];
|
|
18
|
+
var DEFAULT_TTL = 300;
|
|
19
|
+
var addRecordOptionsSchema = _zod.z.object({
|
|
20
|
+
profile: _WOYF2L6Tcjs.profileField,
|
|
21
|
+
zone: _zod.z.string().optional().describe(
|
|
22
|
+
"Hosted zone name or ID (e.g. mountaindev.com or Z123\u2026). Skips the zone picker when set."
|
|
23
|
+
),
|
|
24
|
+
type: _zod.z.string().optional().transform(
|
|
25
|
+
(value) => value === void 0 ? void 0 : value.toUpperCase()
|
|
26
|
+
).refine(
|
|
27
|
+
(value) => value === void 0 || typeof value === "string" && RECORD_TYPES.includes(value),
|
|
28
|
+
{
|
|
29
|
+
message: `Record type must be one of: ${RECORD_TYPES.join(", ")}`
|
|
30
|
+
}
|
|
31
|
+
).describe(`DNS record type (${RECORD_TYPES.join(", ")})`),
|
|
32
|
+
name: _zod.z.string().optional().describe(
|
|
33
|
+
'Record name relative to the zone (e.g. "redline") or a fully-qualified name'
|
|
34
|
+
),
|
|
35
|
+
value: _zod.z.string().optional().describe("Record value (e.g. a CNAME target or A address)"),
|
|
36
|
+
ttl: _zod.z.number().int().positive().optional().describe(`TTL in seconds (default: ${DEFAULT_TTL})`),
|
|
37
|
+
yes: _zod.z.boolean().optional().default(false).describe("Skip the confirmation prompt"),
|
|
38
|
+
dryRun: _zod.z.boolean().optional().default(false).describe("Preview the change without calling Route53"),
|
|
39
|
+
verbose: _WOYF2L6Tcjs.verboseField
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
exports.RECORD_TYPES = RECORD_TYPES; exports.DEFAULT_TTL = DEFAULT_TTL; exports.addRecordOptionsSchema = addRecordOptionsSchema;
|