@mtndev/cli 0.0.0-dev-20260626045346 → 0.0.0-dev-20260914234436
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 +12 -2
- 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,167 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _S3LVCWPNcjs = require('./S3LVCWPN.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _T2A7TN4Fcjs = require('./T2A7TN4F.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _R3GUC7O7cjs = require('./R3GUC7O7.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _CMUD7LLNcjs = require('./CMUD7LLN.cjs');
|
|
15
|
+
|
|
16
|
+
// src/commands/aws/iam/remove-admin/handler.js
|
|
17
|
+
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
18
|
+
var _zod = require('zod');
|
|
19
|
+
async function removeAdminCommand(options) {
|
|
20
|
+
try {
|
|
21
|
+
const { profile, all, user, yes, dryRun, verbose } = _S3LVCWPNcjs.removeAdminOptionsSchema.parse(options);
|
|
22
|
+
_R3GUC7O7cjs.requireCommands.call(void 0, ["aws"]);
|
|
23
|
+
const userFilter = new Set(user);
|
|
24
|
+
const needsVault = all || !(_nullishCoalesce(profile, () => ( process.env.AWS_PROFILE)));
|
|
25
|
+
if (needsVault) {
|
|
26
|
+
_R3GUC7O7cjs.requireCommands.call(void 0, ["aws-vault"]);
|
|
27
|
+
}
|
|
28
|
+
let profiles;
|
|
29
|
+
try {
|
|
30
|
+
profiles = _T2A7TN4Fcjs.resolveAdminScanProfiles.call(void 0, { profile, all });
|
|
31
|
+
} catch (resolveError) {
|
|
32
|
+
if (resolveError instanceof Error && resolveError.message === "No aws-vault profiles with credentials found.") {
|
|
33
|
+
console.error(_chalk2.default.red(resolveError.message));
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
throw resolveError;
|
|
37
|
+
}
|
|
38
|
+
console.log(
|
|
39
|
+
_chalk2.default.blue(
|
|
40
|
+
`
|
|
41
|
+
==> Removing break-glass access (${_T2A7TN4Fcjs.ADMIN_GROUP_NAME}) across ${profiles.length} profile(s)
|
|
42
|
+
`
|
|
43
|
+
)
|
|
44
|
+
);
|
|
45
|
+
if (dryRun) {
|
|
46
|
+
console.log(_chalk2.default.yellow("[dry-run] No changes will be made.\n"));
|
|
47
|
+
}
|
|
48
|
+
let removed = 0;
|
|
49
|
+
let cleaned = 0;
|
|
50
|
+
let skipped = 0;
|
|
51
|
+
for (const candidate of profiles) {
|
|
52
|
+
const scan = _T2A7TN4Fcjs.resolveProfileScan.call(void 0, { profile: candidate, verbose });
|
|
53
|
+
if (!scan) {
|
|
54
|
+
skipped += 1;
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (scan.users.length === 0) {
|
|
58
|
+
if (verbose) {
|
|
59
|
+
console.log(
|
|
60
|
+
_chalk2.default.green(`OK ${candidate} (${scan.accountId}) \u2014 0 users`)
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
cleaned += 1;
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
const targets = userFilter.size > 0 ? scan.users.filter((name) => userFilter.has(name)) : scan.users;
|
|
67
|
+
if (targets.length === 0) {
|
|
68
|
+
console.log(
|
|
69
|
+
_chalk2.default.dim(
|
|
70
|
+
`-- ${candidate} (${scan.accountId}) \u2014 has users but none match --user`
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
skipped += 1;
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
console.log(
|
|
77
|
+
_chalk2.default.red(
|
|
78
|
+
`FOUND ${candidate} (${scan.accountId}) \u2014 ${targets.length} user(s): ${targets.join(", ")}`
|
|
79
|
+
)
|
|
80
|
+
);
|
|
81
|
+
if (dryRun) {
|
|
82
|
+
for (const name of targets) {
|
|
83
|
+
console.log(
|
|
84
|
+
_chalk2.default.yellow(
|
|
85
|
+
` [dry-run] would remove ${name} from ${_T2A7TN4Fcjs.ADMIN_GROUP_NAME}`
|
|
86
|
+
)
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
let confirmed = yes;
|
|
92
|
+
if (!confirmed) {
|
|
93
|
+
confirmed = await _CMUD7LLNcjs.promptYesNo.call(void 0, {
|
|
94
|
+
message: ` Remove ${targets.length} user(s) from ${_T2A7TN4Fcjs.ADMIN_GROUP_NAME} in ${candidate}?`,
|
|
95
|
+
defaultYes: false
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (!confirmed) {
|
|
99
|
+
console.log(_chalk2.default.dim(" skipped (not confirmed)"));
|
|
100
|
+
skipped += 1;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
for (const name of targets) {
|
|
104
|
+
try {
|
|
105
|
+
scan.run(
|
|
106
|
+
[
|
|
107
|
+
"iam",
|
|
108
|
+
"remove-user-from-group",
|
|
109
|
+
"--group-name",
|
|
110
|
+
_T2A7TN4Fcjs.ADMIN_GROUP_NAME,
|
|
111
|
+
"--user-name",
|
|
112
|
+
name
|
|
113
|
+
],
|
|
114
|
+
{ expectJson: false }
|
|
115
|
+
);
|
|
116
|
+
console.log(_chalk2.default.green(` removed ${name}`));
|
|
117
|
+
removed += 1;
|
|
118
|
+
} catch (removeError) {
|
|
119
|
+
const reason = removeError instanceof Error ? _nullishCoalesce(removeError.message.split("\n")[0], () => ( "")) : String(removeError);
|
|
120
|
+
console.log(_chalk2.default.red(` failed to remove ${name}: ${reason}`));
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
console.log(_chalk2.default.blue("\n==> Summary"));
|
|
125
|
+
console.log(` Profiles scanned: ${profiles.length}`);
|
|
126
|
+
console.log(` Users removed: ${removed}`);
|
|
127
|
+
console.log(` Already clean: ${cleaned}`);
|
|
128
|
+
console.log(` Skipped: ${skipped}`);
|
|
129
|
+
if (dryRun) {
|
|
130
|
+
console.log(
|
|
131
|
+
_chalk2.default.yellow("\n[dry-run] Re-run without --dry-run to apply changes.")
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
} catch (error) {
|
|
135
|
+
if (error instanceof _zod.ZodError) {
|
|
136
|
+
console.error(_chalk2.default.red("\n\u274C Invalid command options:"));
|
|
137
|
+
error.errors.forEach((err) => {
|
|
138
|
+
console.error(_chalk2.default.red(` ${err.path.join(".")}: ${err.message}`));
|
|
139
|
+
});
|
|
140
|
+
process.exit(1);
|
|
141
|
+
}
|
|
142
|
+
const verbose = (
|
|
143
|
+
/** @type {any} */
|
|
144
|
+
_optionalChain([options, 'optionalAccess', _ => _.verbose]) || false
|
|
145
|
+
);
|
|
146
|
+
console.error(_chalk2.default.red("\n\u274C remove-admin failed:"));
|
|
147
|
+
if (error instanceof Error) {
|
|
148
|
+
console.error(_chalk2.default.red(` ${error.message}`));
|
|
149
|
+
if (verbose && error.stack) {
|
|
150
|
+
console.error(_chalk2.default.gray("\nStack trace:"));
|
|
151
|
+
console.error(_chalk2.default.gray(error.stack));
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
console.error(_chalk2.default.red(` ${String(error)}`));
|
|
155
|
+
}
|
|
156
|
+
console.error(
|
|
157
|
+
_chalk2.default.yellow(
|
|
158
|
+
"\n\u{1F4A1} Requires the AWS CLI (and aws-vault when scanning multiple profiles) and iam:RemoveUserFromGroup.\n"
|
|
159
|
+
)
|
|
160
|
+
);
|
|
161
|
+
process.exit(1);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
exports.removeAdminCommand = removeAdminCommand;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _WOYF2L6Tcjs = require('./WOYF2L6T.cjs');
|
|
5
|
+
|
|
6
|
+
// src/commands/aws/ses/send-email/schema.js
|
|
7
|
+
var _zod = require('zod');
|
|
8
|
+
var sendEmailOptionsSchema = _zod.z.object({
|
|
9
|
+
to: _zod.z.string({ required_error: "--to <address> is required" }).describe("Recipient email address"),
|
|
10
|
+
from: _zod.z.string({ required_error: "--from <address> is required" }).describe("Verified SES sender email address"),
|
|
11
|
+
subject: _zod.z.string().optional().default("MTN CLI test email").describe("Email subject line"),
|
|
12
|
+
body: _zod.z.string().optional().describe("Email body (defaults to a timestamp and random token)"),
|
|
13
|
+
transport: _zod.z.enum(["api", "smtp"]).optional().default("api").describe("Send via the SES API (default) or SES SMTP"),
|
|
14
|
+
region: _zod.z.string().optional().default("us-east-1").describe("AWS region for the SES endpoint"),
|
|
15
|
+
profile: _WOYF2L6Tcjs.profileField,
|
|
16
|
+
accessKeyId: _zod.z.string().optional().describe(
|
|
17
|
+
"IAM access key ID used as the SMTP username (smtp transport only)"
|
|
18
|
+
),
|
|
19
|
+
dryRun: _zod.z.boolean().optional().default(false).describe("Print the email payload without sending"),
|
|
20
|
+
verbose: _WOYF2L6Tcjs.verboseField
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
exports.sendEmailOptionsSchema = sendEmailOptionsSchema;
|
|
@@ -0,0 +1,393 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _JB7T7PKQcjs = require('./JB7T7PKQ.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _CMUD7LLNcjs = require('./CMUD7LLN.cjs');
|
|
9
|
+
|
|
10
|
+
// src/commands/doppler/set-secret.js
|
|
11
|
+
var _child_process = require('child_process');
|
|
12
|
+
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
13
|
+
function listProjects(params = {}) {
|
|
14
|
+
const { verbose = false, limit = 500 } = params;
|
|
15
|
+
const projects = [];
|
|
16
|
+
let page = 1;
|
|
17
|
+
while (projects.length < limit) {
|
|
18
|
+
const batch = _JB7T7PKQcjs.execDoppler.call(void 0,
|
|
19
|
+
["projects", "--json", "--page", String(page), "--number", "100"],
|
|
20
|
+
"json",
|
|
21
|
+
true,
|
|
22
|
+
verbose
|
|
23
|
+
);
|
|
24
|
+
if (!Array.isArray(batch) || batch.length === 0) {
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
for (const raw of batch) {
|
|
28
|
+
projects.push({
|
|
29
|
+
id: String(_nullishCoalesce(_nullishCoalesce(raw.id, () => ( raw.name)), () => ( ""))),
|
|
30
|
+
name: String(_nullishCoalesce(_nullishCoalesce(raw.name, () => ( raw.id)), () => ( ""))),
|
|
31
|
+
description: raw.description ? String(raw.description) : ""
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
if (batch.length < 100) {
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
page += 1;
|
|
38
|
+
}
|
|
39
|
+
return projects.filter((project) => project.name).sort((a, b) => a.name.localeCompare(b.name));
|
|
40
|
+
}
|
|
41
|
+
function listEnvironments(params) {
|
|
42
|
+
const { project, verbose = false } = params;
|
|
43
|
+
const data = _JB7T7PKQcjs.execDoppler.call(void 0,
|
|
44
|
+
["environments", "--json", "--project", project],
|
|
45
|
+
"json",
|
|
46
|
+
true,
|
|
47
|
+
verbose
|
|
48
|
+
);
|
|
49
|
+
if (!Array.isArray(data)) {
|
|
50
|
+
return [];
|
|
51
|
+
}
|
|
52
|
+
return data.map((raw) => ({
|
|
53
|
+
id: String(_nullishCoalesce(raw.id, () => ( ""))),
|
|
54
|
+
name: String(_nullishCoalesce(_nullishCoalesce(raw.name, () => ( raw.id)), () => ( "")))
|
|
55
|
+
})).filter((env) => env.id).sort((a, b) => a.id.localeCompare(b.id));
|
|
56
|
+
}
|
|
57
|
+
function listConfigs(params) {
|
|
58
|
+
const { project, environment, verbose = false } = params;
|
|
59
|
+
const args = ["configs", "--json", "--project", project];
|
|
60
|
+
if (environment) {
|
|
61
|
+
args.push("--environment", environment);
|
|
62
|
+
}
|
|
63
|
+
const data = _JB7T7PKQcjs.execDoppler.call(void 0, args, "json", true, verbose);
|
|
64
|
+
if (!Array.isArray(data)) {
|
|
65
|
+
return [];
|
|
66
|
+
}
|
|
67
|
+
return data.map((raw) => ({
|
|
68
|
+
name: String(_nullishCoalesce(raw.name, () => ( ""))),
|
|
69
|
+
environment: String(_nullishCoalesce(raw.environment, () => ( ""))),
|
|
70
|
+
root: Boolean(raw.root)
|
|
71
|
+
})).filter((config) => config.name).sort((a, b) => a.name.localeCompare(b.name));
|
|
72
|
+
}
|
|
73
|
+
function getSecret(params) {
|
|
74
|
+
const { project, config, name, verbose = false } = params;
|
|
75
|
+
try {
|
|
76
|
+
const data = _JB7T7PKQcjs.execDoppler.call(void 0,
|
|
77
|
+
[
|
|
78
|
+
"secrets",
|
|
79
|
+
"get",
|
|
80
|
+
name,
|
|
81
|
+
"--project",
|
|
82
|
+
project,
|
|
83
|
+
"--config",
|
|
84
|
+
config,
|
|
85
|
+
"--plain",
|
|
86
|
+
"--raw"
|
|
87
|
+
],
|
|
88
|
+
"string",
|
|
89
|
+
true,
|
|
90
|
+
verbose
|
|
91
|
+
);
|
|
92
|
+
if (typeof data !== "string") {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
const value = data.replace(/\n$/, "");
|
|
96
|
+
return value.length > 0 ? value : "";
|
|
97
|
+
} catch (e) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
function setSecret(params) {
|
|
102
|
+
const { project, config, name, value, verbose = false } = params;
|
|
103
|
+
const args = [
|
|
104
|
+
"secrets",
|
|
105
|
+
"set",
|
|
106
|
+
name,
|
|
107
|
+
"--project",
|
|
108
|
+
project,
|
|
109
|
+
"--config",
|
|
110
|
+
config,
|
|
111
|
+
"--no-interactive"
|
|
112
|
+
];
|
|
113
|
+
if (verbose) {
|
|
114
|
+
console.log(
|
|
115
|
+
_chalk2.default.gray(
|
|
116
|
+
` Executing: doppler ${args.join(" ")} <stdin value (${value.length} chars)>`
|
|
117
|
+
)
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
const result = _child_process.spawnSync.call(void 0, "doppler", args, {
|
|
121
|
+
encoding: "utf-8",
|
|
122
|
+
input: value
|
|
123
|
+
});
|
|
124
|
+
if (result.error) {
|
|
125
|
+
throw new Error(result.error.message);
|
|
126
|
+
}
|
|
127
|
+
if (result.status !== 0) {
|
|
128
|
+
const stderr = (result.stderr || result.stdout || "").trim();
|
|
129
|
+
throw new Error(stderr || `doppler secrets set failed for ${name}`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async function resolveProject(params) {
|
|
133
|
+
const { projects, projectOption } = params;
|
|
134
|
+
if (projectOption) {
|
|
135
|
+
const match = projects.find(
|
|
136
|
+
(project) => project.name === projectOption || project.id === projectOption
|
|
137
|
+
);
|
|
138
|
+
if (!match) {
|
|
139
|
+
throw new Error(
|
|
140
|
+
`Project "${projectOption}" not found. Available examples: ${projects.slice(0, 8).map((project) => project.name).join(", ")}`
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
return match.name;
|
|
144
|
+
}
|
|
145
|
+
if (projects.length === 0) {
|
|
146
|
+
throw new Error("No Doppler projects found for this account.");
|
|
147
|
+
}
|
|
148
|
+
let candidates = projects;
|
|
149
|
+
if (projects.length > 30) {
|
|
150
|
+
const filter = await _CMUD7LLNcjs.prompt.call(void 0,
|
|
151
|
+
` Filter projects (${projects.length} total, Enter for all): `
|
|
152
|
+
);
|
|
153
|
+
if (filter) {
|
|
154
|
+
const lower = filter.toLowerCase();
|
|
155
|
+
candidates = projects.filter(
|
|
156
|
+
(project) => project.name.toLowerCase().includes(lower) || project.id.toLowerCase().includes(lower)
|
|
157
|
+
);
|
|
158
|
+
if (candidates.length === 0) {
|
|
159
|
+
throw new Error(`No projects matched "${filter}".`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const maxShown = 50;
|
|
164
|
+
const shown = candidates.slice(0, maxShown);
|
|
165
|
+
if (candidates.length > maxShown) {
|
|
166
|
+
console.log(
|
|
167
|
+
_chalk2.default.yellow(
|
|
168
|
+
` Showing first ${maxShown} of ${candidates.length} matches \u2014 refine with a filter next time.`
|
|
169
|
+
)
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
const index = await _CMUD7LLNcjs.promptChoice.call(void 0, {
|
|
173
|
+
message: "Choose a Doppler project:",
|
|
174
|
+
options: shown.map(
|
|
175
|
+
(project) => project.description ? `${project.name} \u2014 ${project.description}` : project.name
|
|
176
|
+
)
|
|
177
|
+
});
|
|
178
|
+
const chosen = shown[index];
|
|
179
|
+
if (!chosen) {
|
|
180
|
+
throw new Error("No project selected");
|
|
181
|
+
}
|
|
182
|
+
return chosen.name;
|
|
183
|
+
}
|
|
184
|
+
async function resolveEnvironment(params) {
|
|
185
|
+
const { environments, environmentOption } = params;
|
|
186
|
+
if (environmentOption) {
|
|
187
|
+
const normalized = environmentOption.trim().toLowerCase();
|
|
188
|
+
if (normalized === "all" || normalized === "*") {
|
|
189
|
+
return "all";
|
|
190
|
+
}
|
|
191
|
+
const match = environments.find(
|
|
192
|
+
(env) => env.id.toLowerCase() === normalized || env.name.toLowerCase() === normalized
|
|
193
|
+
);
|
|
194
|
+
if (!match) {
|
|
195
|
+
throw new Error(
|
|
196
|
+
`Environment "${environmentOption}" not found. Available: ${environments.map((env) => env.id).join(", ")}`
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
return match.id;
|
|
200
|
+
}
|
|
201
|
+
if (environments.length === 0) {
|
|
202
|
+
return "all";
|
|
203
|
+
}
|
|
204
|
+
const options = [
|
|
205
|
+
...environments.map((env) => `${env.id} (${env.name})`),
|
|
206
|
+
"all environments"
|
|
207
|
+
];
|
|
208
|
+
const index = await _CMUD7LLNcjs.promptChoice.call(void 0, {
|
|
209
|
+
message: "Choose an environment:",
|
|
210
|
+
options
|
|
211
|
+
});
|
|
212
|
+
if (index === options.length - 1) {
|
|
213
|
+
return "all";
|
|
214
|
+
}
|
|
215
|
+
const chosen = environments[index];
|
|
216
|
+
if (!chosen) {
|
|
217
|
+
throw new Error("No environment selected");
|
|
218
|
+
}
|
|
219
|
+
return chosen.id;
|
|
220
|
+
}
|
|
221
|
+
async function resolveConfigs(params) {
|
|
222
|
+
const { configs, configOption, environment } = params;
|
|
223
|
+
const scoped = environment === "all" ? configs : configs.filter((config) => config.environment === environment);
|
|
224
|
+
if (scoped.length === 0) {
|
|
225
|
+
throw new Error(
|
|
226
|
+
environment === "all" ? "No configs found in this project." : `No configs found for environment "${environment}".`
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
if (configOption) {
|
|
230
|
+
const normalized = configOption.trim().toLowerCase();
|
|
231
|
+
if (normalized === "all" || normalized === "*") {
|
|
232
|
+
return scoped.map((config) => config.name);
|
|
233
|
+
}
|
|
234
|
+
const requested = configOption.split(",").map((value) => value.trim());
|
|
235
|
+
const names = new Set(scoped.map((config) => config.name));
|
|
236
|
+
const missing = requested.filter((name) => !names.has(name));
|
|
237
|
+
if (missing.length > 0) {
|
|
238
|
+
throw new Error(
|
|
239
|
+
`Config(s) not found: ${missing.join(", ")}. Available: ${[
|
|
240
|
+
...names
|
|
241
|
+
].join(", ")}`
|
|
242
|
+
);
|
|
243
|
+
}
|
|
244
|
+
return requested;
|
|
245
|
+
}
|
|
246
|
+
if (scoped.length === 1) {
|
|
247
|
+
const only = scoped[0];
|
|
248
|
+
if (!only) {
|
|
249
|
+
throw new Error("No config selected");
|
|
250
|
+
}
|
|
251
|
+
console.log(` Config: ${only.name}`);
|
|
252
|
+
return [only.name];
|
|
253
|
+
}
|
|
254
|
+
const options = [
|
|
255
|
+
...scoped.map(
|
|
256
|
+
(config) => config.root ? `${config.name} (root, env: ${config.environment})` : `${config.name} (env: ${config.environment})`
|
|
257
|
+
),
|
|
258
|
+
`all configs listed (${scoped.length})`
|
|
259
|
+
];
|
|
260
|
+
const index = await _CMUD7LLNcjs.promptChoice.call(void 0, {
|
|
261
|
+
message: "Choose a config:",
|
|
262
|
+
options
|
|
263
|
+
});
|
|
264
|
+
if (index === options.length - 1) {
|
|
265
|
+
return scoped.map((config) => config.name);
|
|
266
|
+
}
|
|
267
|
+
const chosen = scoped[index];
|
|
268
|
+
if (!chosen) {
|
|
269
|
+
throw new Error("No config selected");
|
|
270
|
+
}
|
|
271
|
+
return [chosen.name];
|
|
272
|
+
}
|
|
273
|
+
async function resolveSecretName(nameOption) {
|
|
274
|
+
if (nameOption) {
|
|
275
|
+
return nameOption;
|
|
276
|
+
}
|
|
277
|
+
const raw = await _CMUD7LLNcjs.prompt.call(void 0, " Secret name (e.g. DATABASE_URL): ");
|
|
278
|
+
if (!raw) {
|
|
279
|
+
throw new Error("Secret name is required");
|
|
280
|
+
}
|
|
281
|
+
if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(raw)) {
|
|
282
|
+
throw new Error(
|
|
283
|
+
"Secret name must be a valid env var identifier (letters, numbers, underscore)"
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
return raw;
|
|
287
|
+
}
|
|
288
|
+
async function resolveSecretValue(valueOption) {
|
|
289
|
+
if (valueOption !== void 0) {
|
|
290
|
+
return valueOption;
|
|
291
|
+
}
|
|
292
|
+
const raw = await _CMUD7LLNcjs.prompt.call(void 0, " Secret value: ");
|
|
293
|
+
if (raw === "") {
|
|
294
|
+
const confirmEmpty = await _CMUD7LLNcjs.promptYesNo.call(void 0, {
|
|
295
|
+
message: " Set an empty value?",
|
|
296
|
+
defaultYes: false
|
|
297
|
+
});
|
|
298
|
+
if (!confirmEmpty) {
|
|
299
|
+
throw new Error("Secret value is required");
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
return raw;
|
|
303
|
+
}
|
|
304
|
+
async function setSecretInteractive(options) {
|
|
305
|
+
const {
|
|
306
|
+
project: projectOption,
|
|
307
|
+
environment: environmentOption,
|
|
308
|
+
config: configOption,
|
|
309
|
+
name: nameOption,
|
|
310
|
+
value: valueOption,
|
|
311
|
+
yes = false,
|
|
312
|
+
verbose = false
|
|
313
|
+
} = options;
|
|
314
|
+
console.log(_chalk2.default.blue("\nSet Doppler secret"));
|
|
315
|
+
console.log("");
|
|
316
|
+
const projects = listProjects({ verbose });
|
|
317
|
+
const project = await resolveProject({ projects, projectOption });
|
|
318
|
+
console.log(`Project: ${project}`);
|
|
319
|
+
console.log("");
|
|
320
|
+
const environments = listEnvironments({ project, verbose });
|
|
321
|
+
const environment = await resolveEnvironment({
|
|
322
|
+
environments,
|
|
323
|
+
environmentOption
|
|
324
|
+
});
|
|
325
|
+
console.log(
|
|
326
|
+
environment === "all" ? "Environment: all" : `Environment: ${environment}`
|
|
327
|
+
);
|
|
328
|
+
console.log("");
|
|
329
|
+
const configs = listConfigs({
|
|
330
|
+
project,
|
|
331
|
+
environment: environment === "all" ? void 0 : environment,
|
|
332
|
+
verbose
|
|
333
|
+
});
|
|
334
|
+
const targetConfigs = await resolveConfigs({
|
|
335
|
+
configs,
|
|
336
|
+
configOption,
|
|
337
|
+
environment
|
|
338
|
+
});
|
|
339
|
+
console.log(`Config(s): ${targetConfigs.join(", ")}`);
|
|
340
|
+
console.log("");
|
|
341
|
+
const name = await resolveSecretName(nameOption);
|
|
342
|
+
const value = await resolveSecretValue(valueOption);
|
|
343
|
+
const existingByConfig = [];
|
|
344
|
+
for (const config of targetConfigs) {
|
|
345
|
+
const existing = getSecret({ project, config, name, verbose });
|
|
346
|
+
existingByConfig.push({ config, existing });
|
|
347
|
+
}
|
|
348
|
+
const overwrites = existingByConfig.filter(
|
|
349
|
+
(entry) => entry.existing !== null
|
|
350
|
+
);
|
|
351
|
+
console.log("");
|
|
352
|
+
console.log("Plan:");
|
|
353
|
+
console.log(` Project: ${project}`);
|
|
354
|
+
console.log(` Configs: ${targetConfigs.join(", ")}`);
|
|
355
|
+
console.log(` Name: ${name}`);
|
|
356
|
+
console.log(
|
|
357
|
+
` Value: ${value.length === 0 ? "(empty)" : `(${value.length} chars)`}`
|
|
358
|
+
);
|
|
359
|
+
if (overwrites.length > 0) {
|
|
360
|
+
console.log(
|
|
361
|
+
_chalk2.default.yellow(
|
|
362
|
+
` Overwrite: ${overwrites.length} config(s) already have this secret (${overwrites.map((entry) => entry.config).join(", ")})`
|
|
363
|
+
)
|
|
364
|
+
);
|
|
365
|
+
} else {
|
|
366
|
+
console.log(_chalk2.default.green(" Overwrite: none (new secret on all targets)"));
|
|
367
|
+
}
|
|
368
|
+
console.log("");
|
|
369
|
+
if (!yes) {
|
|
370
|
+
const confirmed = await _CMUD7LLNcjs.promptYesNo.call(void 0, {
|
|
371
|
+
message: overwrites.length > 0 ? "Overwrite / set this secret?" : "Set this secret?",
|
|
372
|
+
defaultYes: false
|
|
373
|
+
});
|
|
374
|
+
if (!confirmed) {
|
|
375
|
+
console.log("Aborted.");
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
console.log("");
|
|
379
|
+
}
|
|
380
|
+
for (const config of targetConfigs) {
|
|
381
|
+
setSecret({ project, config, name, value, verbose });
|
|
382
|
+
console.log(_chalk2.default.green(` \u2713 set ${name} on ${project}/${config}`));
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
exports.listProjects = listProjects; exports.listEnvironments = listEnvironments; exports.listConfigs = listConfigs; exports.getSecret = getSecret; exports.setSecret = setSecret; exports.setSecretInteractive = setSecretInteractive;
|