@geekmidas/cli 10.0.0-alpha.14 → 10.0.0-alpha.141
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/README.md +313 -380
- package/bin/adjacent-tsconfig.mjs +46 -8
- package/bin/gkm.mjs +11 -3
- package/bin/owning-tsconfig-jsx-register.mjs +18 -0
- package/bin/owning-tsconfig-jsx.mjs +108 -0
- package/dist/EndpointGenerator-BMRL04ic.mjs +1037 -0
- package/dist/EndpointGenerator-BMRL04ic.mjs.map +1 -0
- package/dist/EndpointGenerator-ePscnbwB.cjs +1096 -0
- package/dist/EndpointGenerator-ePscnbwB.cjs.map +1 -0
- package/dist/GoDaddyProvider-DxFAueU4.mjs +413 -0
- package/dist/GoDaddyProvider-DxFAueU4.mjs.map +1 -0
- package/dist/GoDaddyProvider-hAc0q5s-.cjs +413 -0
- package/dist/GoDaddyProvider-hAc0q5s-.cjs.map +1 -0
- package/dist/{HostingerProvider-BY26bWwB.mjs → HostingerProvider-CgMuKgO_.mjs} +23 -9
- package/dist/HostingerProvider-CgMuKgO_.mjs.map +1 -0
- package/dist/{HostingerProvider-BZFGYYVA.cjs → HostingerProvider-DEqpvoiD.cjs} +23 -9
- package/dist/HostingerProvider-DEqpvoiD.cjs.map +1 -0
- package/dist/LegacyStateStore-BPY8Acgs.mjs +124 -0
- package/dist/LegacyStateStore-BPY8Acgs.mjs.map +1 -0
- package/dist/LegacyStateStore-BqSVgWi1.cjs +124 -0
- package/dist/LegacyStateStore-BqSVgWi1.cjs.map +1 -0
- package/dist/LocalStateStore-5pVR26KA.mjs +167 -0
- package/dist/LocalStateStore-5pVR26KA.mjs.map +1 -0
- package/dist/LocalStateStore-Df4RyGi2.cjs +178 -0
- package/dist/LocalStateStore-Df4RyGi2.cjs.map +1 -0
- package/dist/OpenApiTsGenerator-B-PQLx8X.mjs +534 -0
- package/dist/OpenApiTsGenerator-B-PQLx8X.mjs.map +1 -0
- package/dist/OpenApiTsGenerator-BvacdbiG.cjs +539 -0
- package/dist/OpenApiTsGenerator-BvacdbiG.cjs.map +1 -0
- package/dist/{Route53Provider-Cvj40A8I.mjs → Route53Provider-Di_SD9CF.mjs} +3 -3
- package/dist/Route53Provider-Di_SD9CF.mjs.map +1 -0
- package/dist/{Route53Provider-DVILBsvV.cjs → Route53Provider-emLuQHVw.cjs} +3 -3
- package/dist/Route53Provider-emLuQHVw.cjs.map +1 -0
- package/dist/S3StateStore-Do1DwEMX.mjs +223 -0
- package/dist/S3StateStore-Do1DwEMX.mjs.map +1 -0
- package/dist/S3StateStore-uykstvZI.cjs +222 -0
- package/dist/S3StateStore-uykstvZI.cjs.map +1 -0
- package/dist/SSMStateStore-DQXFWqkE.cjs +204 -0
- package/dist/SSMStateStore-DQXFWqkE.cjs.map +1 -0
- package/dist/SSMStateStore-xQ-Ce91W.mjs +205 -0
- package/dist/SSMStateStore-xQ-Ce91W.mjs.map +1 -0
- package/dist/SubscriberGenerator-DLPH-ynS.mjs +783 -0
- package/dist/SubscriberGenerator-DLPH-ynS.mjs.map +1 -0
- package/dist/SubscriberGenerator-DR4Y7ihK.cjs +848 -0
- package/dist/SubscriberGenerator-DR4Y7ihK.cjs.map +1 -0
- package/dist/add-DLkN488n.mjs +711 -0
- package/dist/add-DLkN488n.mjs.map +1 -0
- package/dist/add-Y_nPkjIf.cjs +713 -0
- package/dist/add-Y_nPkjIf.cjs.map +1 -0
- package/dist/appPorts-BoXMwolc.mjs +249 -0
- package/dist/appPorts-BoXMwolc.mjs.map +1 -0
- package/dist/appPorts-IW-OZmRi.cjs +296 -0
- package/dist/appPorts-IW-OZmRi.cjs.map +1 -0
- package/dist/aws-8QQ8n-t6.mjs +89 -0
- package/dist/aws-8QQ8n-t6.mjs.map +1 -0
- package/dist/aws-DY9NqQIT.cjs +100 -0
- package/dist/aws-DY9NqQIT.cjs.map +1 -0
- package/dist/awsStore-Bx5nCFnS.mjs +121 -0
- package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
- package/dist/awsStore-u3ehhMoY.cjs +138 -0
- package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
- package/dist/{backup-provisioner-DIVCbfee.mjs → backup-provisioner-C8DnCmxK.mjs} +2 -2
- package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
- package/dist/{backup-provisioner-BmhIO_Yr.cjs → backup-provisioner-oDEsPj02.cjs} +2 -2
- package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
- package/dist/backups/runner.cjs +519 -0
- package/dist/backups/runner.cjs.map +1 -0
- package/dist/backups/runner.d.cts +102 -0
- package/dist/backups/runner.d.cts.map +1 -0
- package/dist/backups/runner.d.mts +102 -0
- package/dist/backups/runner.d.mts.map +1 -0
- package/dist/backups/runner.mjs +506 -0
- package/dist/backups/runner.mjs.map +1 -0
- package/dist/{bundler-BeNDZdHQ.cjs → bundler-COOvv27I.cjs} +59 -14
- package/dist/bundler-COOvv27I.cjs.map +1 -0
- package/dist/{bundler-BodTL4kf.mjs → bundler-DFyrGST-.mjs} +59 -14
- package/dist/bundler-DFyrGST-.mjs.map +1 -0
- package/dist/cli-DKsV-Myw.cjs +71 -0
- package/dist/cli-DKsV-Myw.cjs.map +1 -0
- package/dist/cli-iAX4BQ3t.mjs +71 -0
- package/dist/cli-iAX4BQ3t.mjs.map +1 -0
- package/dist/compose-CGXx22Wy.cjs +4416 -0
- package/dist/compose-CGXx22Wy.cjs.map +1 -0
- package/dist/compose-ofZIpp2q.mjs +4273 -0
- package/dist/compose-ofZIpp2q.mjs.map +1 -0
- package/dist/config-BbivVpq0.d.mts +268 -0
- package/dist/config-BbivVpq0.d.mts.map +1 -0
- package/dist/config-BcL1Fojs.d.cts +268 -0
- package/dist/config-BcL1Fojs.d.cts.map +1 -0
- package/dist/config.cjs +420 -9
- package/dist/config.cjs.map +1 -0
- package/dist/config.d.cts +4 -117
- package/dist/config.d.mts +4 -117
- package/dist/config.mjs +406 -3
- package/dist/config.mjs.map +1 -0
- package/dist/credentialSchemas-DUCSYl9a.mjs +237 -0
- package/dist/credentialSchemas-DUCSYl9a.mjs.map +1 -0
- package/dist/credentialSchemas-DZ2Nh5li.cjs +272 -0
- package/dist/credentialSchemas-DZ2Nh5li.cjs.map +1 -0
- package/dist/credentials-D7XJypNd.cjs +520 -0
- package/dist/credentials-D7XJypNd.cjs.map +1 -0
- package/dist/credentials-DpfnUvIR.mjs +395 -0
- package/dist/credentials-DpfnUvIR.mjs.map +1 -0
- package/dist/databases-Db48ZIXL.mjs +588 -0
- package/dist/databases-Db48ZIXL.mjs.map +1 -0
- package/dist/databases-P824RTnx.cjs +703 -0
- package/dist/databases-P824RTnx.cjs.map +1 -0
- package/dist/define-6poNqm5O.mjs +106 -0
- package/dist/define-6poNqm5O.mjs.map +1 -0
- package/dist/define-crmMcXFS.cjs +153 -0
- package/dist/define-crmMcXFS.cjs.map +1 -0
- package/dist/deploy/public.cjs +211 -0
- package/dist/deploy/public.cjs.map +1 -0
- package/dist/deploy/public.d.cts +647 -0
- package/dist/deploy/public.d.cts.map +1 -0
- package/dist/deploy/public.d.mts +647 -0
- package/dist/deploy/public.d.mts.map +1 -0
- package/dist/deploy/public.mjs +144 -0
- package/dist/deploy/public.mjs.map +1 -0
- package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
- package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
- package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
- package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
- package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
- package/dist/deploy/sniffer-hooks.cjs +1 -1
- package/dist/deploy/sniffer-hooks.mjs +1 -1
- package/dist/deploy/sniffer-loader.cjs +2 -2
- package/dist/deploy/sniffer-loader.mjs +1 -1
- package/dist/deploy/sniffer-routes-worker.cjs +2 -2
- package/dist/deploy/sniffer-routes-worker.mjs +1 -1
- package/dist/deploy-BibGpDAz.cjs +3891 -0
- package/dist/deploy-BibGpDAz.cjs.map +1 -0
- package/dist/deploy-C4QQkHK7.mjs +3835 -0
- package/dist/deploy-C4QQkHK7.mjs.map +1 -0
- package/dist/derive-Cd7Hl3r2.mjs +259 -0
- package/dist/derive-Cd7Hl3r2.mjs.map +1 -0
- package/dist/derive-CgZfoBU2.cjs +282 -0
- package/dist/derive-CgZfoBU2.cjs.map +1 -0
- package/dist/discover-B2m8ytyq.mjs +831 -0
- package/dist/discover-B2m8ytyq.mjs.map +1 -0
- package/dist/discover-yqeJ2Bx7.cjs +934 -0
- package/dist/discover-yqeJ2Bx7.cjs.map +1 -0
- package/dist/dokploy-B_VX3nLM.cjs +38 -0
- package/dist/dokploy-B_VX3nLM.cjs.map +1 -0
- package/dist/dokploy-pSrsileA.mjs +38 -0
- package/dist/dokploy-pSrsileA.mjs.map +1 -0
- package/dist/drivers-C47nm-wB.cjs +311 -0
- package/dist/drivers-C47nm-wB.cjs.map +1 -0
- package/dist/drivers-CDjpjakg.mjs +252 -0
- package/dist/drivers-CDjpjakg.mjs.map +1 -0
- package/dist/eas-Bou-_M76.mjs +334 -0
- package/dist/eas-Bou-_M76.mjs.map +1 -0
- package/dist/eas-cSSc8Lex.cjs +337 -0
- package/dist/eas-cSSc8Lex.cjs.map +1 -0
- package/dist/emit-Bj6XSivk.mjs +136 -0
- package/dist/emit-Bj6XSivk.mjs.map +1 -0
- package/dist/emit-CDC__ubE.cjs +147 -0
- package/dist/emit-CDC__ubE.cjs.map +1 -0
- package/dist/encryption-Bps9As2D.mjs +89 -0
- package/dist/encryption-Bps9As2D.mjs.map +1 -0
- package/dist/encryption-CElaAwJs.cjs +90 -0
- package/dist/encryption-CElaAwJs.cjs.map +1 -0
- package/dist/engine-CXE4UOHj.mjs +3210 -0
- package/dist/engine-CXE4UOHj.mjs.map +1 -0
- package/dist/engine-CiG7Wfyc.cjs +3323 -0
- package/dist/engine-CiG7Wfyc.cjs.map +1 -0
- package/dist/errors-D8Gwp5kU.mjs +23 -0
- package/dist/errors-D8Gwp5kU.mjs.map +1 -0
- package/dist/errors-DMC4Umsb.cjs +34 -0
- package/dist/errors-DMC4Umsb.cjs.map +1 -0
- package/dist/github-BzppIvpw.cjs +901 -0
- package/dist/github-BzppIvpw.cjs.map +1 -0
- package/dist/github-CvFJlFWA.mjs +900 -0
- package/dist/github-CvFJlFWA.mjs.map +1 -0
- package/dist/googlePlay-BJnMCWoa.cjs +931 -0
- package/dist/googlePlay-BJnMCWoa.cjs.map +1 -0
- package/dist/googlePlay-RSe9wOfZ.mjs +931 -0
- package/dist/googlePlay-RSe9wOfZ.mjs.map +1 -0
- package/dist/identity-CBXr4wNi.mjs +129 -0
- package/dist/identity-CBXr4wNi.mjs.map +1 -0
- package/dist/identity-CbLfgQNT.cjs +182 -0
- package/dist/identity-CbLfgQNT.cjs.map +1 -0
- package/dist/{index-D-iAVHx-.d.cts → index-BZZeEWug.d.mts} +39 -15
- package/dist/index-BZZeEWug.d.mts.map +1 -0
- package/dist/{index-Cd-qeOam.d.mts → index-C1jffZ5_.d.cts} +39 -15
- package/dist/index-C1jffZ5_.d.cts.map +1 -0
- package/dist/index.cjs +13502 -12269
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +13522 -12287
- package/dist/index.mjs.map +1 -1
- package/dist/local-B7Zv1NoA.mjs +224 -0
- package/dist/local-B7Zv1NoA.mjs.map +1 -0
- package/dist/local-OPC9BCZt.cjs +241 -0
- package/dist/local-OPC9BCZt.cjs.map +1 -0
- package/dist/migrate-B0nQra2W.mjs +181 -0
- package/dist/migrate-B0nQra2W.mjs.map +1 -0
- package/dist/migrate-BCBs0BMn.cjs +181 -0
- package/dist/migrate-BCBs0BMn.cjs.map +1 -0
- package/dist/migrate-BPCJBL7_.mjs +265 -0
- package/dist/migrate-BPCJBL7_.mjs.map +1 -0
- package/dist/migrate-Dmh5Dbcr.cjs +270 -0
- package/dist/migrate-Dmh5Dbcr.cjs.map +1 -0
- package/dist/openapi.cjs +214 -7
- package/dist/openapi.cjs.map +1 -0
- package/dist/openapi.d.cts +32 -8
- package/dist/openapi.d.cts.map +1 -1
- package/dist/openapi.d.mts +32 -8
- package/dist/openapi.d.mts.map +1 -1
- package/dist/openapi.mjs +209 -2
- package/dist/openapi.mjs.map +1 -0
- package/dist/projectBucket-BBbQ1lHF.cjs +263 -0
- package/dist/projectBucket-BBbQ1lHF.cjs.map +1 -0
- package/dist/projectBucket-C_DN4WzF.mjs +222 -0
- package/dist/projectBucket-C_DN4WzF.mjs.map +1 -0
- package/dist/provider-BqpjG9QM.cjs +57 -0
- package/dist/provider-BqpjG9QM.cjs.map +1 -0
- package/dist/provider-CEOKk8NS.mjs +46 -0
- package/dist/provider-CEOKk8NS.mjs.map +1 -0
- package/dist/publish-DKy3hn8a.cjs +124 -0
- package/dist/publish-DKy3hn8a.cjs.map +1 -0
- package/dist/publish-cthyGGQt.mjs +123 -0
- package/dist/publish-cthyGGQt.mjs.map +1 -0
- package/dist/ready-CGqJ74Kt.mjs +375 -0
- package/dist/ready-CGqJ74Kt.mjs.map +1 -0
- package/dist/ready-DuU0FXSj.cjs +404 -0
- package/dist/ready-DuU0FXSj.cjs.map +1 -0
- package/dist/reconcile/public.cjs +3 -5
- package/dist/reconcile/public.d.cts +31 -89
- package/dist/reconcile/public.d.cts.map +1 -1
- package/dist/reconcile/public.d.mts +31 -89
- package/dist/reconcile/public.d.mts.map +1 -1
- package/dist/reconcile/public.mjs +3 -3
- package/dist/{reconcile-DhQ00DpU.mjs → reconcile--I7V4Klj.mjs} +2 -2
- package/dist/{reconcile-DhQ00DpU.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
- package/dist/{reconcile-Dd2iyILf.cjs → reconcile-CuCQBa5-.cjs} +3 -3
- package/dist/{reconcile-Dd2iyILf.cjs.map → reconcile-CuCQBa5-.cjs.map} +1 -1
- package/dist/resolve-AYtMIgoq.cjs +316 -0
- package/dist/resolve-AYtMIgoq.cjs.map +1 -0
- package/dist/resolve-BaRqJlqV.mjs +263 -0
- package/dist/resolve-BaRqJlqV.mjs.map +1 -0
- package/dist/rollback-CQ184yFu.cjs +165 -0
- package/dist/rollback-CQ184yFu.cjs.map +1 -0
- package/dist/rollback-DqV6t9oo.mjs +136 -0
- package/dist/rollback-DqV6t9oo.mjs.map +1 -0
- package/dist/runtime-Bvgyxm88.d.cts +82 -0
- package/dist/runtime-Bvgyxm88.d.cts.map +1 -0
- package/dist/runtime-CeAt1IJd.d.mts +82 -0
- package/dist/runtime-CeAt1IJd.d.mts.map +1 -0
- package/dist/s3-BKnL6YGQ.cjs +215 -0
- package/dist/s3-BKnL6YGQ.cjs.map +1 -0
- package/dist/s3-DW7SLsb8.mjs +215 -0
- package/dist/s3-DW7SLsb8.mjs.map +1 -0
- package/dist/sandbox/config-worker.cjs +43 -0
- package/dist/sandbox/config-worker.cjs.map +1 -0
- package/dist/sandbox/config-worker.d.cts +1 -0
- package/dist/sandbox/config-worker.d.mts +1 -0
- package/dist/sandbox/config-worker.mjs +44 -0
- package/dist/sandbox/config-worker.mjs.map +1 -0
- package/dist/sandbox/credentials-worker.cjs +54 -0
- package/dist/sandbox/credentials-worker.cjs.map +1 -0
- package/dist/sandbox/credentials-worker.d.cts +1 -0
- package/dist/sandbox/credentials-worker.d.mts +1 -0
- package/dist/sandbox/credentials-worker.mjs +55 -0
- package/dist/sandbox/credentials-worker.mjs.map +1 -0
- package/dist/sandbox/discover-worker.cjs +47 -0
- package/dist/sandbox/discover-worker.cjs.map +1 -0
- package/dist/sandbox/discover-worker.d.cts +1 -0
- package/dist/sandbox/discover-worker.d.mts +1 -0
- package/dist/sandbox/discover-worker.mjs +48 -0
- package/dist/sandbox/discover-worker.mjs.map +1 -0
- package/dist/sandbox/migrate-worker.cjs +76 -0
- package/dist/sandbox/migrate-worker.cjs.map +1 -0
- package/dist/sandbox/migrate-worker.d.cts +1 -0
- package/dist/sandbox/migrate-worker.d.mts +1 -0
- package/dist/sandbox/migrate-worker.mjs +77 -0
- package/dist/sandbox/migrate-worker.mjs.map +1 -0
- package/dist/sandbox-CHv3OYXg.cjs +165 -0
- package/dist/sandbox-CHv3OYXg.cjs.map +1 -0
- package/dist/sandbox-CbVB7uOD.mjs +118 -0
- package/dist/sandbox-CbVB7uOD.mjs.map +1 -0
- package/dist/{workspace-mFpI_ky_.cjs → schemas-BCwKKA42.mjs} +399 -1162
- package/dist/schemas-BCwKKA42.mjs.map +1 -0
- package/dist/{workspace-CgwmXEtc.mjs → schemas-BQ_v0lEX.cjs} +487 -971
- package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
- package/dist/secretsManager-CQORubp9.mjs +97 -0
- package/dist/secretsManager-CQORubp9.mjs.map +1 -0
- package/dist/secretsManager-RAGcEDX1.cjs +108 -0
- package/dist/secretsManager-RAGcEDX1.cjs.map +1 -0
- package/dist/seeds-DndMeyzm.cjs +10669 -0
- package/dist/seeds-DndMeyzm.cjs.map +1 -0
- package/dist/seeds-o6x6BTRo.mjs +9534 -0
- package/dist/seeds-o6x6BTRo.mjs.map +1 -0
- package/dist/serverSetup-AfG0-at8.mjs +651 -0
- package/dist/serverSetup-AfG0-at8.mjs.map +1 -0
- package/dist/serverSetup-Dnw9Kdel.cjs +651 -0
- package/dist/serverSetup-Dnw9Kdel.cjs.map +1 -0
- package/dist/sniffer-BHhJ8DiC.mjs +1825 -0
- package/dist/sniffer-BHhJ8DiC.mjs.map +1 -0
- package/dist/sniffer-taO-AXSk.cjs +1998 -0
- package/dist/sniffer-taO-AXSk.cjs.map +1 -0
- package/dist/snsSubscriptions-CC-WM1zC.cjs +1720 -0
- package/dist/snsSubscriptions-CC-WM1zC.cjs.map +1 -0
- package/dist/snsSubscriptions-D_IBKhni.mjs +1497 -0
- package/dist/snsSubscriptions-D_IBKhni.mjs.map +1 -0
- package/dist/sst-Bz2HJlqc.mjs +440 -0
- package/dist/sst-Bz2HJlqc.mjs.map +1 -0
- package/dist/sst-lvCHdYsY.cjs +463 -0
- package/dist/sst-lvCHdYsY.cjs.map +1 -0
- package/dist/stage-CTibxcpA.cjs +310 -0
- package/dist/stage-CTibxcpA.cjs.map +1 -0
- package/dist/stage-dd9dtLfh.mjs +299 -0
- package/dist/stage-dd9dtLfh.mjs.map +1 -0
- package/dist/stages--icWbhPy.cjs +190 -0
- package/dist/stages--icWbhPy.cjs.map +1 -0
- package/dist/stages-CUwSy39f.mjs +190 -0
- package/dist/stages-CUwSy39f.mjs.map +1 -0
- package/dist/target/public.cjs +15 -0
- package/dist/target/public.d.cts +28 -0
- package/dist/target/public.d.cts.map +1 -0
- package/dist/target/public.d.mts +28 -0
- package/dist/target/public.d.mts.map +1 -0
- package/dist/target/public.mjs +4 -0
- package/dist/terminal-DURcYlVX.cjs +85 -0
- package/dist/terminal-DURcYlVX.cjs.map +1 -0
- package/dist/terminal-yOZ7kKF9.mjs +85 -0
- package/dist/terminal-yOZ7kKF9.mjs.map +1 -0
- package/dist/{types-C5ZNpUad.d.cts → types-C6hDCkV2.d.mts} +2229 -456
- package/dist/types-C6hDCkV2.d.mts.map +1 -0
- package/dist/{types-BGo5TaNE.d.mts → types-Dy1eV7yc.d.cts} +2231 -456
- package/dist/types-Dy1eV7yc.d.cts.map +1 -0
- package/dist/utils-D2Nk1Nv2.cjs +205 -0
- package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
- package/dist/utils-D_fxUqvU.mjs +156 -0
- package/dist/utils-D_fxUqvU.mjs.map +1 -0
- package/dist/vitest.cjs +65 -0
- package/dist/vitest.cjs.map +1 -0
- package/dist/vitest.d.cts +29 -0
- package/dist/vitest.d.cts.map +1 -0
- package/dist/vitest.d.mts +29 -0
- package/dist/vitest.d.mts.map +1 -0
- package/dist/vitest.mjs +65 -0
- package/dist/vitest.mjs.map +1 -0
- package/dist/workerRuntime-BXfhbe13.cjs +108 -0
- package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
- package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
- package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
- package/dist/workspace/index.cjs +6 -2
- package/dist/workspace/index.d.cts +3 -3
- package/dist/workspace/index.d.mts +3 -3
- package/dist/workspace/index.mjs +2 -2
- package/dist/workspace-BbfBFtjn.mjs +2488 -0
- package/dist/workspace-BbfBFtjn.mjs.map +1 -0
- package/dist/workspace-Dkm3HL9e.cjs +2924 -0
- package/dist/workspace-Dkm3HL9e.cjs.map +1 -0
- package/package.json +61 -14
- package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
- package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
- package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
- package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
- package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
- package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
- package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
- package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
- package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
- package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
- package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
- package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
- package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
- package/dist/bundler-BeNDZdHQ.cjs.map +0 -1
- package/dist/bundler-BodTL4kf.mjs.map +0 -1
- package/dist/config-Q1rvKHvw.cjs +0 -467
- package/dist/config-Q1rvKHvw.cjs.map +0 -1
- package/dist/config-pqGD3hF9.mjs +0 -414
- package/dist/config-pqGD3hF9.mjs.map +0 -1
- package/dist/config.d.cts.map +0 -1
- package/dist/config.d.mts.map +0 -1
- package/dist/credentials-BekkKtY_.mjs +0 -2780
- package/dist/credentials-BekkKtY_.mjs.map +0 -1
- package/dist/credentials-Q6F0uqJq.cjs +0 -2917
- package/dist/credentials-Q6F0uqJq.cjs.map +0 -1
- package/dist/discover-BERGFg8v.cjs +0 -288
- package/dist/discover-BERGFg8v.cjs.map +0 -1
- package/dist/discover-CK-n3w6b.mjs +0 -244
- package/dist/discover-CK-n3w6b.mjs.map +0 -1
- package/dist/emit-BdoPFjZf.cjs +0 -253
- package/dist/emit-BdoPFjZf.cjs.map +0 -1
- package/dist/emit-Bzq7JsMP.mjs +0 -224
- package/dist/emit-Bzq7JsMP.mjs.map +0 -1
- package/dist/fullstack-secrets-BET8gqwK.mjs +0 -81
- package/dist/fullstack-secrets-BET8gqwK.mjs.map +0 -1
- package/dist/fullstack-secrets-DXsWO-5m.cjs +0 -92
- package/dist/fullstack-secrets-DXsWO-5m.cjs.map +0 -1
- package/dist/generator-LfZU7NlU.mjs +0 -247
- package/dist/generator-LfZU7NlU.mjs.map +0 -1
- package/dist/generator-Wdfp0jCS.cjs +0 -282
- package/dist/generator-Wdfp0jCS.cjs.map +0 -1
- package/dist/github-BfflNPVe.cjs +0 -203
- package/dist/github-BfflNPVe.cjs.map +0 -1
- package/dist/github-CRwnxKmD.mjs +0 -203
- package/dist/github-CRwnxKmD.mjs.map +0 -1
- package/dist/index-Cd-qeOam.d.mts.map +0 -1
- package/dist/index-D-iAVHx-.d.cts.map +0 -1
- package/dist/keystore-B4PRlbgE.mjs +0 -81
- package/dist/keystore-B4PRlbgE.mjs.map +0 -1
- package/dist/keystore-DgGRj2Yy.cjs +0 -98
- package/dist/keystore-DgGRj2Yy.cjs.map +0 -1
- package/dist/openapi-Dcbme-Us.cjs +0 -2038
- package/dist/openapi-Dcbme-Us.cjs.map +0 -1
- package/dist/openapi-vy4JzhUv.mjs +0 -1991
- package/dist/openapi-vy4JzhUv.mjs.map +0 -1
- package/dist/storage-C-30BD1e.cjs +0 -272
- package/dist/storage-C-30BD1e.cjs.map +0 -1
- package/dist/storage-P_b3w7uj.mjs +0 -231
- package/dist/storage-P_b3w7uj.mjs.map +0 -1
- package/dist/sync-B3xxXtJT.mjs +0 -88
- package/dist/sync-B3xxXtJT.mjs.map +0 -1
- package/dist/sync-D7uTIIEi.cjs +0 -111
- package/dist/sync-D7uTIIEi.cjs.map +0 -1
- package/dist/types-BGo5TaNE.d.mts.map +0 -1
- package/dist/types-C5ZNpUad.d.cts.map +0 -1
- package/dist/workspace-CgwmXEtc.mjs.map +0 -1
- package/dist/workspace-mFpI_ky_.cjs.map +0 -1
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
const require_errors = require("./errors-DMC4Umsb.cjs");
|
|
2
|
+
const require_credentials = require("./credentials-D7XJypNd.cjs");
|
|
3
|
+
const require_seeds = require("./seeds-DndMeyzm.cjs");
|
|
4
|
+
/** The record types gkm writes. Never TXT, NS, SOA, SRV or CAA. */
|
|
5
|
+
const GODADDY_MANAGED_TYPES = [
|
|
6
|
+
"A",
|
|
7
|
+
"AAAA",
|
|
8
|
+
"CNAME",
|
|
9
|
+
"MX"
|
|
10
|
+
];
|
|
11
|
+
/**
|
|
12
|
+
* The token is good, and GoDaddy will not let it use the API: since 2024 the
|
|
13
|
+
* Domains and DNS APIs answer only accounts with 10 or more domains, or a
|
|
14
|
+
* Discount Domain Club Premier membership.
|
|
15
|
+
*/
|
|
16
|
+
var GoDaddyApiAccessDenied = class extends require_errors.GkmError {
|
|
17
|
+
domain;
|
|
18
|
+
detail;
|
|
19
|
+
constructor(domain, detail) {
|
|
20
|
+
super(`GoDaddy refused API access for ${domain} (403 ACCESS_DENIED${detail ? `: ${detail}` : ""}). GoDaddy only opens its DNS API to accounts with 10 or more domains, or with a Discount Domain Club Premier membership, so a valid token on a smaller account is refused. Either qualify the account, move the domain's DNS hosting to Route53 (provider: 'route53') or Cloudflare by changing its nameservers at GoDaddy, or set provider: 'manual' and create the records gkm prints yourself. (A scoped token without domains.dns:update is refused the same way — check its scopes too.)`);
|
|
21
|
+
this.domain = domain;
|
|
22
|
+
this.detail = detail;
|
|
23
|
+
this.name = "GoDaddyApiAccessDenied";
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
/** The token lacks the scope a records call needs. */
|
|
27
|
+
var GoDaddyScopeMissing = class extends require_errors.GkmError {
|
|
28
|
+
method;
|
|
29
|
+
domain;
|
|
30
|
+
scope;
|
|
31
|
+
detail;
|
|
32
|
+
constructor(method, domain, scope, detail) {
|
|
33
|
+
super(`GoDaddy refused ${method} on ${domain}'s DNS records (403${detail ? `: ${detail}` : ""}): the token lacks the ${scope} scope. Create a Personal Access Token in the GoDaddy developer dashboard with domains.dns:update — no domain or account scope is needed — and set GODADDY_API_TOKEN or run \`gkm login --provider godaddy\` again.`);
|
|
34
|
+
this.method = method;
|
|
35
|
+
this.domain = domain;
|
|
36
|
+
this.scope = scope;
|
|
37
|
+
this.detail = detail;
|
|
38
|
+
this.name = "GoDaddyScopeMissing";
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
/** GoDaddy did not accept the token at all. */
|
|
42
|
+
var GoDaddyCredentialsInvalid = class extends require_errors.GkmError {
|
|
43
|
+
code;
|
|
44
|
+
constructor(code) {
|
|
45
|
+
super(`GoDaddy did not accept the API token (401${code ? ` ${code}` : ""}). Check GODADDY_API_TOKEN, or run \`gkm login --provider godaddy\` again with a Personal Access Token from the GoDaddy developer dashboard that has not expired or been revoked.`);
|
|
46
|
+
this.code = code;
|
|
47
|
+
this.name = "GoDaddyCredentialsInvalid";
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
/** The domain is not in the account the token belongs to. */
|
|
51
|
+
var GoDaddyDomainNotFound = class extends require_errors.GkmError {
|
|
52
|
+
domain;
|
|
53
|
+
code;
|
|
54
|
+
constructor(domain, code) {
|
|
55
|
+
super(`GoDaddy has no domain ${domain} in this token's account${code ? ` (${code})` : ""}. Check the root domain in dns, and that the token belongs to the account the domain is registered in.`);
|
|
56
|
+
this.domain = domain;
|
|
57
|
+
this.code = code;
|
|
58
|
+
this.name = "GoDaddyDomainNotFound";
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
/** Still rate limited after waiting it out. */
|
|
62
|
+
var GoDaddyRateLimited = class extends require_errors.GkmError {
|
|
63
|
+
attempts;
|
|
64
|
+
retryAfterSec;
|
|
65
|
+
constructor(attempts, retryAfterSec) {
|
|
66
|
+
super(`GoDaddy is still rate limiting this token after ${attempts} attempts (429 TOO_MANY_REQUESTS — about 60 requests a minute are allowed). Wait${retryAfterSec ? ` ${retryAfterSec} seconds` : " a minute"} and run it again; records already written are left as they are.`);
|
|
67
|
+
this.attempts = attempts;
|
|
68
|
+
this.retryAfterSec = retryAfterSec;
|
|
69
|
+
this.name = "GoDaddyRateLimited";
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
/** Any other failure from GoDaddy. */
|
|
73
|
+
var GoDaddyRequestFailed = class extends Error {
|
|
74
|
+
method;
|
|
75
|
+
path;
|
|
76
|
+
status;
|
|
77
|
+
code;
|
|
78
|
+
detail;
|
|
79
|
+
constructor(method, path, status, code, detail) {
|
|
80
|
+
super(`GoDaddy answered ${method} ${path} with ${status}${code ? ` ${code}` : ""}${detail ? `: ${detail}` : ""}.` + (status === 422 ? " A name with a CNAME cannot also have an A or AAAA record, and the reverse — remove the other one first." : ""));
|
|
81
|
+
this.method = method;
|
|
82
|
+
this.path = path;
|
|
83
|
+
this.status = status;
|
|
84
|
+
this.code = code;
|
|
85
|
+
this.detail = detail;
|
|
86
|
+
this.name = "GoDaddyRequestFailed";
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* A write gkm was about to make to a record type it never manages, or to a
|
|
91
|
+
* name it was not asked for.
|
|
92
|
+
*/
|
|
93
|
+
var GoDaddyRecordNotAllowed = class extends require_errors.GkmError {
|
|
94
|
+
domain;
|
|
95
|
+
type;
|
|
96
|
+
recordName;
|
|
97
|
+
reason;
|
|
98
|
+
constructor(domain, type, recordName, reason) {
|
|
99
|
+
super(`Refused to change the ${type} record '${recordName}' on ${domain}: ${reason}. gkm only ever writes the A, AAAA and CNAME records of the hosts it serves, and the CNAME and MX records its providers ask for.`);
|
|
100
|
+
this.domain = domain;
|
|
101
|
+
this.type = type;
|
|
102
|
+
this.recordName = recordName;
|
|
103
|
+
this.reason = reason;
|
|
104
|
+
this.name = "GoDaddyRecordNotAllowed";
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* A record name GoDaddy's path takes: `@` for the apex, `*` for the apex's
|
|
109
|
+
* wildcard, else relative.
|
|
110
|
+
*/
|
|
111
|
+
function isRecordName(name) {
|
|
112
|
+
return name === "@" || name === "*" || /^(\*\.)?[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9])?(\.[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9])?)*$/i.test(name);
|
|
113
|
+
}
|
|
114
|
+
/** The client. Every method touches one record set, by type and name. */
|
|
115
|
+
var GoDaddyApi = class {
|
|
116
|
+
baseUrl;
|
|
117
|
+
sleep;
|
|
118
|
+
maxAttempts;
|
|
119
|
+
authorization;
|
|
120
|
+
/** Whether a read has succeeded: a later 403 is then the token's scope. */
|
|
121
|
+
readSucceeded = false;
|
|
122
|
+
constructor(options) {
|
|
123
|
+
this.baseUrl = (options.baseUrl ?? "https://api.godaddy.com").replace(/\/$/, "");
|
|
124
|
+
this.sleep = options.sleep ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
|
|
125
|
+
this.maxAttempts = options.maxAttempts ?? 4;
|
|
126
|
+
this.authorization = `Bearer ${options.credential.token}`;
|
|
127
|
+
}
|
|
128
|
+
/** The records of one name and type — empty when there are none. */
|
|
129
|
+
async getRecordSet(domain, type, name) {
|
|
130
|
+
this.guard(domain, type, name);
|
|
131
|
+
const records = await this.request("GET", domain, this.recordPath(domain, type, name));
|
|
132
|
+
return Array.isArray(records) ? records : [];
|
|
133
|
+
}
|
|
134
|
+
/** Replace one name's records of one type with `values`. */
|
|
135
|
+
async replaceRecordSet(domain, type, name, values, ttl) {
|
|
136
|
+
this.guard(domain, type, name);
|
|
137
|
+
await this.request("PUT", domain, this.recordPath(domain, type, name), values.map(({ data, priority }) => ({
|
|
138
|
+
data,
|
|
139
|
+
...priority !== void 0 ? { priority } : {},
|
|
140
|
+
ttl: Math.max(ttl, 600)
|
|
141
|
+
})));
|
|
142
|
+
}
|
|
143
|
+
/** Delete one name's records of one type. */
|
|
144
|
+
async deleteRecordSet(domain, type, name) {
|
|
145
|
+
this.guard(domain, type, name);
|
|
146
|
+
await this.request("DELETE", domain, this.recordPath(domain, type, name));
|
|
147
|
+
}
|
|
148
|
+
recordPath(domain, type, name) {
|
|
149
|
+
return `/v1/domains/${encodeURIComponent(domain)}/records/${type}/${encodeURIComponent(name)}`;
|
|
150
|
+
}
|
|
151
|
+
/** Only A, AAAA, CNAME and MX, at a real record name. */
|
|
152
|
+
guard(domain, type, name) {
|
|
153
|
+
if (!GODADDY_MANAGED_TYPES.includes(type)) throw new GoDaddyRecordNotAllowed(domain, type, name, "it is not a type gkm manages");
|
|
154
|
+
if (!isRecordName(name)) throw new GoDaddyRecordNotAllowed(domain, type, name, "it is not a record name relative to the domain");
|
|
155
|
+
}
|
|
156
|
+
async request(method, domain, path, body) {
|
|
157
|
+
let retryAfterSec;
|
|
158
|
+
for (let attempt = 1; attempt <= this.maxAttempts; attempt++) {
|
|
159
|
+
const response = await fetch(`${this.baseUrl}${path}`, {
|
|
160
|
+
method,
|
|
161
|
+
headers: {
|
|
162
|
+
Authorization: this.authorization,
|
|
163
|
+
Accept: "application/json",
|
|
164
|
+
...body !== void 0 ? { "Content-Type": "application/json" } : {}
|
|
165
|
+
},
|
|
166
|
+
...body !== void 0 ? { body: JSON.stringify(body) } : {}
|
|
167
|
+
});
|
|
168
|
+
if (response.ok) {
|
|
169
|
+
if (method === "GET") this.readSucceeded = true;
|
|
170
|
+
if (response.status === 204) return void 0;
|
|
171
|
+
const text = await response.text();
|
|
172
|
+
return text ? JSON.parse(text) : void 0;
|
|
173
|
+
}
|
|
174
|
+
const error = await errorBody(response);
|
|
175
|
+
if (response.status === 504 && attempt < this.maxAttempts) {
|
|
176
|
+
await this.sleep(Math.min(2 ** attempt * 1e3, 3e4));
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
if (response.status === 429) {
|
|
180
|
+
retryAfterSec = error.retryAfterSec;
|
|
181
|
+
if (attempt === this.maxAttempts) break;
|
|
182
|
+
const waitMs = retryAfterSec !== void 0 ? Math.min(retryAfterSec, 60) * 1e3 : Math.min(2 ** attempt * 1e3, 6e4);
|
|
183
|
+
await this.sleep(waitMs);
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
if (response.status === 401) throw new GoDaddyCredentialsInvalid(error.code);
|
|
187
|
+
if (response.status === 403) {
|
|
188
|
+
if (/scope/i.test(`${error.code ?? ""} ${error.message ?? ""}`) || method !== "GET" && this.readSucceeded) throw new GoDaddyScopeMissing(method, domain, method === "GET" ? "DNS records read" : "domains.dns:update", error.message ?? error.code);
|
|
189
|
+
throw new GoDaddyApiAccessDenied(domain, error.message ?? error.code);
|
|
190
|
+
}
|
|
191
|
+
if (response.status === 404) throw new GoDaddyDomainNotFound(domain, error.code);
|
|
192
|
+
if (response.status === 422 && /domain/i.test(error.code ?? "") && !/record/i.test(`${error.code ?? ""} ${error.message ?? ""}`)) throw new GoDaddyDomainNotFound(domain, error.code);
|
|
193
|
+
throw new GoDaddyRequestFailed(method, path, response.status, error.code, error.message);
|
|
194
|
+
}
|
|
195
|
+
throw new GoDaddyRateLimited(this.maxAttempts, retryAfterSec);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
async function errorBody(response) {
|
|
199
|
+
try {
|
|
200
|
+
const parsed = await response.json();
|
|
201
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
202
|
+
} catch {
|
|
203
|
+
return {};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
//#region src/target/dokploy/dns/GoDaddyProvider.ts
|
|
208
|
+
/**
|
|
209
|
+
* GoDaddy DNS Provider
|
|
210
|
+
*
|
|
211
|
+
* Implements DnsProvider against GoDaddy's v1 API, one record set — a name
|
|
212
|
+
* and a type — at a time: it reads and writes only the A, AAAA, CNAME and MX
|
|
213
|
+
* records of the names it is handed, and never the zone as a whole, a domain
|
|
214
|
+
* or the account. A Personal Access Token scoped to `domains.dns:update` is all it needs.
|
|
215
|
+
*
|
|
216
|
+
* A token that may write records and not read them puts the provider in
|
|
217
|
+
* write-only mode: every record is PUT — idempotent, so one that already has
|
|
218
|
+
* its value is left as it was — and nothing is compared or deleted.
|
|
219
|
+
*
|
|
220
|
+
* An MX value is `<priority> <host>` on the DnsProvider side, as everywhere
|
|
221
|
+
* in gkm; GoDaddy keeps the priority apart, so it is split on a write and
|
|
222
|
+
* joined on a read.
|
|
223
|
+
*
|
|
224
|
+
* Credentials: `GODADDY_API_TOKEN`, else what `gkm login --provider godaddy`
|
|
225
|
+
* stored. Never logged.
|
|
226
|
+
*/
|
|
227
|
+
/** GoDaddy cannot list a zone through the records-by-name endpoints. */
|
|
228
|
+
var GoDaddyZoneListingUnsupported = class extends require_errors.GkmError {
|
|
229
|
+
domain;
|
|
230
|
+
constructor(domain) {
|
|
231
|
+
super(`gkm reads GoDaddy records by name and type only — it never lists ${domain}'s whole zone, so a token scoped to DNS updates is enough. Use readRecords(domain, [{ name, type }]) instead of getRecords.`);
|
|
232
|
+
this.domain = domain;
|
|
233
|
+
this.name = "GoDaddyZoneListingUnsupported";
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
/** A value compared the way DNS does: case-insensitive, no trailing dot. */
|
|
237
|
+
function normalize(value) {
|
|
238
|
+
return value.trim().replace(/\.$/, "").replace(/\s+/g, " ").toLowerCase();
|
|
239
|
+
}
|
|
240
|
+
/** A GoDaddy record's value in gkm's form: an MX's is `<priority> <host>`. */
|
|
241
|
+
function valueOf(type, record) {
|
|
242
|
+
return type === "MX" ? require_seeds.mxValue(record.priority ?? 0, record.data) : record.data;
|
|
243
|
+
}
|
|
244
|
+
/** gkm's value as GoDaddy takes it: an MX's priority beside its `data`. */
|
|
245
|
+
function goDaddyValue(type, value) {
|
|
246
|
+
if (type !== "MX") return { data: value };
|
|
247
|
+
const { priority, host } = require_seeds.parseMxValue(value);
|
|
248
|
+
return {
|
|
249
|
+
data: host,
|
|
250
|
+
priority
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function managed(type) {
|
|
254
|
+
return GODADDY_MANAGED_TYPES.includes(type);
|
|
255
|
+
}
|
|
256
|
+
/** A read GoDaddy refused: write-only, rather than a failure. */
|
|
257
|
+
function readDenied(error) {
|
|
258
|
+
return error instanceof GoDaddyScopeMissing || error instanceof GoDaddyApiAccessDenied;
|
|
259
|
+
}
|
|
260
|
+
var GoDaddyProvider = class {
|
|
261
|
+
options;
|
|
262
|
+
name = "godaddy";
|
|
263
|
+
api = null;
|
|
264
|
+
/** Set once a read is refused: every write is then a blind PUT. */
|
|
265
|
+
writeOnly = false;
|
|
266
|
+
constructor(options = {}) {
|
|
267
|
+
this.options = options;
|
|
268
|
+
}
|
|
269
|
+
/** Whether the token turned out unable to read records. */
|
|
270
|
+
get readsDenied() {
|
|
271
|
+
return this.writeOnly;
|
|
272
|
+
}
|
|
273
|
+
async getApi() {
|
|
274
|
+
if (this.api) return this.api;
|
|
275
|
+
const credential = this.options.credential ?? await require_credentials.storedCredentials({
|
|
276
|
+
env: this.options.env ?? process.env,
|
|
277
|
+
...this.options.home ? { home: this.options.home } : {}
|
|
278
|
+
}).get({ kind: "godaddy" });
|
|
279
|
+
if (!credential) throw new require_credentials.MissingCredential("godaddy", void 0);
|
|
280
|
+
this.api = new GoDaddyApi({
|
|
281
|
+
credential,
|
|
282
|
+
...this.options.baseUrl ? { baseUrl: this.options.baseUrl } : {},
|
|
283
|
+
...this.options.sleep ? { sleep: this.options.sleep } : {},
|
|
284
|
+
...this.options.maxAttempts ? { maxAttempts: this.options.maxAttempts } : {}
|
|
285
|
+
});
|
|
286
|
+
return this.api;
|
|
287
|
+
}
|
|
288
|
+
assertManaged(domain, type, name) {
|
|
289
|
+
if (!managed(type)) throw new GoDaddyRecordNotAllowed(domain, type, name, "it is not a type gkm manages");
|
|
290
|
+
}
|
|
291
|
+
/** Never: the whole zone is not read. See {@link GoDaddyZoneListingUnsupported}. */
|
|
292
|
+
async getRecords(domain) {
|
|
293
|
+
throw new GoDaddyZoneListingUnsupported(domain);
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The records of exactly these names and types, one request each.
|
|
297
|
+
*
|
|
298
|
+
* @throws {DnsRecordsUnreadable} when the token may not read records
|
|
299
|
+
*/
|
|
300
|
+
async readRecords(domain, wanted) {
|
|
301
|
+
for (const { name, type } of wanted) this.assertManaged(domain, type, name);
|
|
302
|
+
const api = await this.getApi();
|
|
303
|
+
const found = [];
|
|
304
|
+
for (const { name, type } of wanted) {
|
|
305
|
+
let records;
|
|
306
|
+
try {
|
|
307
|
+
records = await api.getRecordSet(domain, type, name);
|
|
308
|
+
} catch (error) {
|
|
309
|
+
if (!readDenied(error)) throw error;
|
|
310
|
+
this.writeOnly = true;
|
|
311
|
+
throw new require_seeds.DnsRecordsUnreadable(this.name, domain, error.name);
|
|
312
|
+
}
|
|
313
|
+
if (records.length === 0) continue;
|
|
314
|
+
found.push({
|
|
315
|
+
name,
|
|
316
|
+
type,
|
|
317
|
+
ttl: records[0].ttl ?? 600,
|
|
318
|
+
values: records.map((r) => valueOf(type, r))
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
return found;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Each record set to exactly its one value: read it, and write it only
|
|
325
|
+
* when it differs — or, with a token that cannot read, write it. Only the
|
|
326
|
+
* name and type of each record handed in is touched.
|
|
327
|
+
*/
|
|
328
|
+
async upsertRecords(domain, records) {
|
|
329
|
+
const values = records.map((record) => {
|
|
330
|
+
this.assertManaged(domain, record.type, record.name);
|
|
331
|
+
return goDaddyValue(record.type, record.value);
|
|
332
|
+
});
|
|
333
|
+
const api = await this.getApi();
|
|
334
|
+
const results = [];
|
|
335
|
+
for (const [i, record] of records.entries()) {
|
|
336
|
+
const type = record.type;
|
|
337
|
+
let existing;
|
|
338
|
+
if (!this.writeOnly) try {
|
|
339
|
+
existing = await api.getRecordSet(domain, type, record.name);
|
|
340
|
+
} catch (error) {
|
|
341
|
+
if (!readDenied(error)) throw error;
|
|
342
|
+
this.writeOnly = true;
|
|
343
|
+
(this.options.log ?? console.log)(` ℹ The GoDaddy token cannot read ${domain}'s DNS records, so changes cannot be diffed: writing each record (idempotent).`);
|
|
344
|
+
}
|
|
345
|
+
if (existing) {
|
|
346
|
+
const found = existing.map((r) => normalize(valueOf(type, r)));
|
|
347
|
+
if (found.length === 1 && found[0] === normalize(record.value)) {
|
|
348
|
+
results.push({
|
|
349
|
+
record,
|
|
350
|
+
created: false,
|
|
351
|
+
unchanged: true
|
|
352
|
+
});
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
await api.replaceRecordSet(domain, type, record.name, [values[i]], Math.max(record.ttl, 600));
|
|
357
|
+
results.push({
|
|
358
|
+
record,
|
|
359
|
+
created: existing !== void 0 && existing.length === 0,
|
|
360
|
+
unchanged: false
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
return results;
|
|
364
|
+
}
|
|
365
|
+
async deleteRecords(domain, records) {
|
|
366
|
+
for (const record of records) this.assertManaged(domain, record.type, record.name);
|
|
367
|
+
const api = await this.getApi();
|
|
368
|
+
const results = [];
|
|
369
|
+
for (const record of records) {
|
|
370
|
+
const type = record.type;
|
|
371
|
+
if (!this.writeOnly) {
|
|
372
|
+
let existing;
|
|
373
|
+
try {
|
|
374
|
+
existing = await api.getRecordSet(domain, type, record.name);
|
|
375
|
+
} catch (error) {
|
|
376
|
+
if (!readDenied(error)) throw error;
|
|
377
|
+
this.writeOnly = true;
|
|
378
|
+
}
|
|
379
|
+
if (existing && existing.length === 0) {
|
|
380
|
+
results.push({
|
|
381
|
+
record,
|
|
382
|
+
deleted: false,
|
|
383
|
+
notFound: true
|
|
384
|
+
});
|
|
385
|
+
continue;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
try {
|
|
389
|
+
await api.deleteRecordSet(domain, type, record.name);
|
|
390
|
+
} catch (error) {
|
|
391
|
+
if (this.writeOnly && error instanceof GoDaddyDomainNotFound) {
|
|
392
|
+
results.push({
|
|
393
|
+
record,
|
|
394
|
+
deleted: false,
|
|
395
|
+
notFound: true
|
|
396
|
+
});
|
|
397
|
+
continue;
|
|
398
|
+
}
|
|
399
|
+
throw error;
|
|
400
|
+
}
|
|
401
|
+
results.push({
|
|
402
|
+
record,
|
|
403
|
+
deleted: true,
|
|
404
|
+
notFound: false
|
|
405
|
+
});
|
|
406
|
+
}
|
|
407
|
+
return results;
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
//#endregion
|
|
411
|
+
exports.GoDaddyProvider = GoDaddyProvider;
|
|
412
|
+
|
|
413
|
+
//# sourceMappingURL=GoDaddyProvider-hAc0q5s-.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoDaddyProvider-hAc0q5s-.cjs","names":["GkmError","GkmError","mxValue","parseMxValue","storedCredentials","MissingCredential","DnsRecordsUnreadable"],"sources":["../src/target/dokploy/dns/godaddy-api.ts","../src/target/dokploy/dns/GoDaddyProvider.ts"],"sourcesContent":["/**\n * GoDaddy's v1 DNS API, as gkm uses it: one record set — a name and a type —\n * at a time.\n *\n * - read: `GET /v1/domains/{domain}/records/{type}/{name}`\n * - write: `PUT /v1/domains/{domain}/records/{type}/{name}` with `[{ data, ttl }]`\n * — and an MX record's `priority` beside its `data` — which replaces that\n * one name's records of that one type\n * - delete: `DELETE /v1/domains/{domain}/records/{type}/{name}`\n *\n * Never the zone-wide `PUT /v1/domains/{domain}/records`, which replaces every\n * record the domain has — mail, verification TXT records and all — and never\n * a domain or account endpoint (`GET /v1/domains`, `GET /v1/domains/{domain}`):\n * a token scoped to `domains.dns:update` alone is enough. A domain that is not\n * in the token's account is told apart by the records endpoint's own 404 or 422.\n *\n * Authenticated with a Personal Access Token — `Authorization: Bearer <token>`,\n * the API's one security scheme. GoDaddy allows about 60 requests a minute per\n * token; a 429 carries `retryAfterSec`, which is waited out a few times before\n * the run gives up with {@link GoDaddyRateLimited}. A 504 is retried the same\n * way. GoDaddy refuses a TTL under 600 seconds (a 422), so every write is\n * sent with at least that.\n */\n\nimport type { GoDaddyCredential } from '../../../deploy/credentials';\nimport { GkmError } from '../../../errors';\n\nexport const GODADDY_API_BASE = 'https://api.godaddy.com';\n\n/** GoDaddy refuses a TTL below this. */\nexport const GODADDY_MIN_TTL = 600;\n\n/** The record types gkm writes. Never TXT, NS, SOA, SRV or CAA. */\nexport const GODADDY_MANAGED_TYPES = ['A', 'AAAA', 'CNAME', 'MX'] as const;\n\nexport type GoDaddyRecordType = (typeof GODADDY_MANAGED_TYPES)[number];\n\n/** One record as GoDaddy returns it. */\nexport interface GoDaddyRecord {\n\ttype: string;\n\tname: string;\n\tdata: string;\n\tttl?: number;\n\t/** An MX record's: GoDaddy keeps it apart from `data`. */\n\tpriority?: number;\n}\n\n/** One value of a record set, as a write sends it. */\nexport interface GoDaddyRecordValue {\n\tdata: string;\n\t/** An MX record's. */\n\tpriority?: number;\n}\n\n/** GoDaddy's error body. */\ninterface GoDaddyErrorBody {\n\tcode?: string;\n\tmessage?: string;\n\tretryAfterSec?: number;\n}\n\n/**\n * The token is good, and GoDaddy will not let it use the API: since 2024 the\n * Domains and DNS APIs answer only accounts with 10 or more domains, or a\n * Discount Domain Club Premier membership.\n */\nexport class GoDaddyApiAccessDenied extends GkmError {\n\tconstructor(\n\t\treadonly domain: string,\n\t\treadonly detail?: string,\n\t) {\n\t\tsuper(\n\t\t\t`GoDaddy refused API access for ${domain} (403 ACCESS_DENIED${detail ? `: ${detail}` : ''}). ` +\n\t\t\t\t'GoDaddy only opens its DNS API to accounts with 10 or more domains, or ' +\n\t\t\t\t'with a Discount Domain Club Premier membership, so a valid token on a ' +\n\t\t\t\t'smaller account is refused. Either qualify the account, move the ' +\n\t\t\t\t\"domain's DNS hosting to Route53 (provider: 'route53') or Cloudflare \" +\n\t\t\t\t\"by changing its nameservers at GoDaddy, or set provider: 'manual' \" +\n\t\t\t\t'and create the records gkm prints yourself. (A scoped token without ' +\n\t\t\t\t'domains.dns:update is refused the same way — check its scopes too.)',\n\t\t);\n\t\tthis.name = 'GoDaddyApiAccessDenied';\n\t}\n}\n\n/** The token lacks the scope a records call needs. */\nexport class GoDaddyScopeMissing extends GkmError {\n\tconstructor(\n\t\treadonly method: string,\n\t\treadonly domain: string,\n\t\treadonly scope: string,\n\t\treadonly detail?: string,\n\t) {\n\t\tsuper(\n\t\t\t`GoDaddy refused ${method} on ${domain}'s DNS records (403${detail ? `: ${detail}` : ''}): ` +\n\t\t\t\t`the token lacks the ${scope} scope. Create a Personal Access Token ` +\n\t\t\t\t'in the GoDaddy developer dashboard with domains.dns:update — no ' +\n\t\t\t\t'domain or account scope is needed — and set GODADDY_API_TOKEN or ' +\n\t\t\t\t'run `gkm login --provider godaddy` again.',\n\t\t);\n\t\tthis.name = 'GoDaddyScopeMissing';\n\t}\n}\n\n/** GoDaddy did not accept the token at all. */\nexport class GoDaddyCredentialsInvalid extends GkmError {\n\tconstructor(readonly code?: string) {\n\t\tsuper(\n\t\t\t`GoDaddy did not accept the API token (401${code ? ` ${code}` : ''}). ` +\n\t\t\t\t'Check GODADDY_API_TOKEN, or run `gkm login --provider godaddy` ' +\n\t\t\t\t'again with a Personal Access Token from the GoDaddy developer ' +\n\t\t\t\t'dashboard that has not expired or been revoked.',\n\t\t);\n\t\tthis.name = 'GoDaddyCredentialsInvalid';\n\t}\n}\n\n/** The domain is not in the account the token belongs to. */\nexport class GoDaddyDomainNotFound extends GkmError {\n\tconstructor(\n\t\treadonly domain: string,\n\t\treadonly code?: string,\n\t) {\n\t\tsuper(\n\t\t\t`GoDaddy has no domain ${domain} in this token's account${code ? ` (${code})` : ''}. ` +\n\t\t\t\t'Check the root domain in dns, and that the token belongs to the account the domain is registered in.',\n\t\t);\n\t\tthis.name = 'GoDaddyDomainNotFound';\n\t}\n}\n\n/** Still rate limited after waiting it out. */\nexport class GoDaddyRateLimited extends GkmError {\n\tconstructor(\n\t\treadonly attempts: number,\n\t\treadonly retryAfterSec?: number,\n\t) {\n\t\tsuper(\n\t\t\t`GoDaddy is still rate limiting this token after ${attempts} attempts ` +\n\t\t\t\t'(429 TOO_MANY_REQUESTS — about 60 requests a minute are allowed). ' +\n\t\t\t\t`Wait${retryAfterSec ? ` ${retryAfterSec} seconds` : ' a minute'} and run it again; ` +\n\t\t\t\t'records already written are left as they are.',\n\t\t);\n\t\tthis.name = 'GoDaddyRateLimited';\n\t}\n}\n\n/** Any other failure from GoDaddy. */\nexport class GoDaddyRequestFailed extends Error {\n\tconstructor(\n\t\treadonly method: string,\n\t\treadonly path: string,\n\t\treadonly status: number,\n\t\treadonly code?: string,\n\t\treadonly detail?: string,\n\t) {\n\t\tsuper(\n\t\t\t`GoDaddy answered ${method} ${path} with ${status}${code ? ` ${code}` : ''}` +\n\t\t\t\t`${detail ? `: ${detail}` : ''}.` +\n\t\t\t\t(status === 422\n\t\t\t\t\t? ' A name with a CNAME cannot also have an A or AAAA record, and the reverse — remove the other one first.'\n\t\t\t\t\t: ''),\n\t\t);\n\t\tthis.name = 'GoDaddyRequestFailed';\n\t}\n}\n\n/**\n * A write gkm was about to make to a record type it never manages, or to a\n * name it was not asked for.\n */\nexport class GoDaddyRecordNotAllowed extends GkmError {\n\tconstructor(\n\t\treadonly domain: string,\n\t\treadonly type: string,\n\t\treadonly recordName: string,\n\t\treadonly reason: string,\n\t) {\n\t\tsuper(\n\t\t\t`Refused to change the ${type} record '${recordName}' on ${domain}: ${reason}. ` +\n\t\t\t\t'gkm only ever writes the A, AAAA and CNAME records of the hosts it ' +\n\t\t\t\t'serves, and the CNAME and MX records its providers ask for.',\n\t\t);\n\t\tthis.name = 'GoDaddyRecordNotAllowed';\n\t}\n}\n\nexport interface GoDaddyApiOptions {\n\tcredential: GoDaddyCredential;\n\t/** The API's base URL. GoDaddy's production API by default. */\n\tbaseUrl?: string;\n\t/** How a 429 or 504 is waited out — `setTimeout` by default; tests pass their own. */\n\tsleep?: (ms: number) => Promise<void>;\n\t/** How many times one request is sent before a 429 or 504 is final. Default 4. */\n\tmaxAttempts?: number;\n}\n\n/**\n * A record name GoDaddy's path takes: `@` for the apex, `*` for the apex's\n * wildcard, else relative.\n */\nfunction isRecordName(name: string): boolean {\n\treturn (\n\t\tname === '@' ||\n\t\tname === '*' ||\n\t\t/^(\\*\\.)?[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9])?(\\.[a-z0-9_](?:[a-z0-9_-]{0,61}[a-z0-9])?)*$/i.test(\n\t\t\tname,\n\t\t)\n\t);\n}\n\n/** The client. Every method touches one record set, by type and name. */\nexport class GoDaddyApi {\n\tprivate readonly baseUrl: string;\n\tprivate readonly sleep: (ms: number) => Promise<void>;\n\tprivate readonly maxAttempts: number;\n\tprivate readonly authorization: string;\n\t/** Whether a read has succeeded: a later 403 is then the token's scope. */\n\tprivate readSucceeded = false;\n\n\tconstructor(options: GoDaddyApiOptions) {\n\t\tthis.baseUrl = (options.baseUrl ?? GODADDY_API_BASE).replace(/\\/$/, '');\n\t\tthis.sleep =\n\t\t\toptions.sleep ??\n\t\t\t((ms) => new Promise((resolve) => setTimeout(resolve, ms)));\n\t\tthis.maxAttempts = options.maxAttempts ?? 4;\n\t\tthis.authorization = `Bearer ${options.credential.token}`;\n\t}\n\n\t/** The records of one name and type — empty when there are none. */\n\tasync getRecordSet(\n\t\tdomain: string,\n\t\ttype: GoDaddyRecordType,\n\t\tname: string,\n\t): Promise<GoDaddyRecord[]> {\n\t\tthis.guard(domain, type, name);\n\t\tconst records = await this.request<GoDaddyRecord[]>(\n\t\t\t'GET',\n\t\t\tdomain,\n\t\t\tthis.recordPath(domain, type, name),\n\t\t);\n\t\treturn Array.isArray(records) ? records : [];\n\t}\n\n\t/** Replace one name's records of one type with `values`. */\n\tasync replaceRecordSet(\n\t\tdomain: string,\n\t\ttype: GoDaddyRecordType,\n\t\tname: string,\n\t\tvalues: readonly GoDaddyRecordValue[],\n\t\tttl: number,\n\t): Promise<void> {\n\t\tthis.guard(domain, type, name);\n\t\tawait this.request(\n\t\t\t'PUT',\n\t\t\tdomain,\n\t\t\tthis.recordPath(domain, type, name),\n\t\t\tvalues.map(({ data, priority }) => ({\n\t\t\t\tdata,\n\t\t\t\t...(priority !== undefined ? { priority } : {}),\n\t\t\t\tttl: Math.max(ttl, GODADDY_MIN_TTL),\n\t\t\t})),\n\t\t);\n\t}\n\n\t/** Delete one name's records of one type. */\n\tasync deleteRecordSet(\n\t\tdomain: string,\n\t\ttype: GoDaddyRecordType,\n\t\tname: string,\n\t): Promise<void> {\n\t\tthis.guard(domain, type, name);\n\t\tawait this.request('DELETE', domain, this.recordPath(domain, type, name));\n\t}\n\n\tprivate recordPath(domain: string, type: string, name: string): string {\n\t\treturn `/v1/domains/${encodeURIComponent(domain)}/records/${type}/${encodeURIComponent(name)}`;\n\t}\n\n\t/** Only A, AAAA, CNAME and MX, at a real record name. */\n\tprivate guard(domain: string, type: string, name: string): void {\n\t\tif (!(GODADDY_MANAGED_TYPES as readonly string[]).includes(type)) {\n\t\t\tthrow new GoDaddyRecordNotAllowed(\n\t\t\t\tdomain,\n\t\t\t\ttype,\n\t\t\t\tname,\n\t\t\t\t'it is not a type gkm manages',\n\t\t\t);\n\t\t}\n\t\tif (!isRecordName(name)) {\n\t\t\tthrow new GoDaddyRecordNotAllowed(\n\t\t\t\tdomain,\n\t\t\t\ttype,\n\t\t\t\tname,\n\t\t\t\t'it is not a record name relative to the domain',\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate async request<T = unknown>(\n\t\tmethod: 'GET' | 'PUT' | 'DELETE',\n\t\tdomain: string,\n\t\tpath: string,\n\t\tbody?: unknown,\n\t): Promise<T> {\n\t\tlet retryAfterSec: number | undefined;\n\t\tfor (let attempt = 1; attempt <= this.maxAttempts; attempt++) {\n\t\t\tconst response = await fetch(`${this.baseUrl}${path}`, {\n\t\t\t\tmethod,\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: this.authorization,\n\t\t\t\t\tAccept: 'application/json',\n\t\t\t\t\t...(body !== undefined ? { 'Content-Type': 'application/json' } : {}),\n\t\t\t\t},\n\t\t\t\t...(body !== undefined ? { body: JSON.stringify(body) } : {}),\n\t\t\t});\n\n\t\t\tif (response.ok) {\n\t\t\t\tif (method === 'GET') this.readSucceeded = true;\n\t\t\t\tif (response.status === 204) return undefined as T;\n\t\t\t\tconst text = await response.text();\n\t\t\t\treturn (text ? JSON.parse(text) : undefined) as T;\n\t\t\t}\n\n\t\t\tconst error = await errorBody(response);\n\t\t\tif (response.status === 504 && attempt < this.maxAttempts) {\n\t\t\t\tawait this.sleep(Math.min(2 ** attempt * 1000, 30_000));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (response.status === 429) {\n\t\t\t\tretryAfterSec = error.retryAfterSec;\n\t\t\t\tif (attempt === this.maxAttempts) break;\n\t\t\t\t// GoDaddy says how long; without it, back off exponentially.\n\t\t\t\tconst waitMs =\n\t\t\t\t\tretryAfterSec !== undefined\n\t\t\t\t\t\t? Math.min(retryAfterSec, 60) * 1000\n\t\t\t\t\t\t: Math.min(2 ** attempt * 1000, 60_000);\n\t\t\t\tawait this.sleep(waitMs);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (response.status === 401) {\n\t\t\t\tthrow new GoDaddyCredentialsInvalid(error.code);\n\t\t\t}\n\t\t\tif (response.status === 403) {\n\t\t\t\t// The account restriction says ACCESS_DENIED; a scoped token that\n\t\t\t\t// may not make this call says so, or — after a read went\n\t\t\t\t// through — can only be that.\n\t\t\t\tconst scoped =\n\t\t\t\t\t/scope/i.test(`${error.code ?? ''} ${error.message ?? ''}`) ||\n\t\t\t\t\t(method !== 'GET' && this.readSucceeded);\n\t\t\t\tif (scoped) {\n\t\t\t\t\tthrow new GoDaddyScopeMissing(\n\t\t\t\t\t\tmethod,\n\t\t\t\t\t\tdomain,\n\t\t\t\t\t\tmethod === 'GET' ? 'DNS records read' : 'domains.dns:update',\n\t\t\t\t\t\terror.message ?? error.code,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tthrow new GoDaddyApiAccessDenied(domain, error.message ?? error.code);\n\t\t\t}\n\t\t\tif (response.status === 404) {\n\t\t\t\tthrow new GoDaddyDomainNotFound(domain, error.code);\n\t\t\t}\n\t\t\tif (\n\t\t\t\tresponse.status === 422 &&\n\t\t\t\t/domain/i.test(error.code ?? '') &&\n\t\t\t\t!/record/i.test(`${error.code ?? ''} ${error.message ?? ''}`)\n\t\t\t) {\n\t\t\t\tthrow new GoDaddyDomainNotFound(domain, error.code);\n\t\t\t}\n\t\t\tthrow new GoDaddyRequestFailed(\n\t\t\t\tmethod,\n\t\t\t\tpath,\n\t\t\t\tresponse.status,\n\t\t\t\terror.code,\n\t\t\t\terror.message,\n\t\t\t);\n\t\t}\n\t\tthrow new GoDaddyRateLimited(this.maxAttempts, retryAfterSec);\n\t}\n}\n\nasync function errorBody(response: Response): Promise<GoDaddyErrorBody> {\n\ttry {\n\t\tconst parsed = (await response.json()) as GoDaddyErrorBody;\n\t\treturn parsed && typeof parsed === 'object' ? parsed : {};\n\t} catch {\n\t\treturn {};\n\t}\n}\n","/**\n * GoDaddy DNS Provider\n *\n * Implements DnsProvider against GoDaddy's v1 API, one record set — a name\n * and a type — at a time: it reads and writes only the A, AAAA, CNAME and MX\n * records of the names it is handed, and never the zone as a whole, a domain\n * or the account. A Personal Access Token scoped to `domains.dns:update` is all it needs.\n *\n * A token that may write records and not read them puts the provider in\n * write-only mode: every record is PUT — idempotent, so one that already has\n * its value is left as it was — and nothing is compared or deleted.\n *\n * An MX value is `<priority> <host>` on the DnsProvider side, as everywhere\n * in gkm; GoDaddy keeps the priority apart, so it is split on a write and\n * joined on a read.\n *\n * Credentials: `GODADDY_API_TOKEN`, else what `gkm login --provider godaddy`\n * stored. Never logged.\n */\n\nimport {\n\ttype GoDaddyCredential,\n\tMissingCredential,\n\tstoredCredentials,\n} from '../../../deploy/credentials';\nimport { GkmError } from '../../../errors';\nimport {\n\ttype DeleteDnsRecord,\n\ttype DeleteResult,\n\ttype DnsProvider,\n\ttype DnsRecord,\n\tDnsRecordsUnreadable,\n\tmxValue,\n\tparseMxValue,\n\ttype UpsertDnsRecord,\n\ttype UpsertResult,\n} from './DnsProvider';\nimport {\n\tGODADDY_MANAGED_TYPES,\n\tGODADDY_MIN_TTL,\n\tGoDaddyApi,\n\tGoDaddyApiAccessDenied,\n\ttype GoDaddyApiOptions,\n\tGoDaddyDomainNotFound,\n\ttype GoDaddyRecord,\n\tGoDaddyRecordNotAllowed,\n\ttype GoDaddyRecordType,\n\ttype GoDaddyRecordValue,\n\tGoDaddyScopeMissing,\n} from './godaddy-api';\n\nexport interface GoDaddyProviderOptions {\n\t/** The token, when the caller already has it. */\n\tcredential?: GoDaddyCredential;\n\t/** Where the variables are read — `process.env` by default. */\n\tenv?: NodeJS.ProcessEnv;\n\t/** The CLI's home, whose `credentials.json` holds a stored login. */\n\thome?: string;\n\t/** The API's base URL, for tests. */\n\tbaseUrl?: string;\n\t/** How a 429 is waited out, for tests. */\n\tsleep?: GoDaddyApiOptions['sleep'];\n\tmaxAttempts?: number;\n\t/** Where the write-only notice goes — `console.log` by default. */\n\tlog?: (line: string) => void;\n}\n\n/** GoDaddy cannot list a zone through the records-by-name endpoints. */\nexport class GoDaddyZoneListingUnsupported extends GkmError {\n\tconstructor(readonly domain: string) {\n\t\tsuper(\n\t\t\t`gkm reads GoDaddy records by name and type only — it never lists ` +\n\t\t\t\t`${domain}'s whole zone, so a token scoped to DNS updates is enough. ` +\n\t\t\t\t'Use readRecords(domain, [{ name, type }]) instead of getRecords.',\n\t\t);\n\t\tthis.name = 'GoDaddyZoneListingUnsupported';\n\t}\n}\n\n/** A value compared the way DNS does: case-insensitive, no trailing dot. */\nfunction normalize(value: string): string {\n\treturn value.trim().replace(/\\.$/, '').replace(/\\s+/g, ' ').toLowerCase();\n}\n\n/** A GoDaddy record's value in gkm's form: an MX's is `<priority> <host>`. */\nfunction valueOf(type: string, record: GoDaddyRecord): string {\n\treturn type === 'MX'\n\t\t? mxValue(record.priority ?? 0, record.data)\n\t\t: record.data;\n}\n\n/** gkm's value as GoDaddy takes it: an MX's priority beside its `data`. */\nfunction goDaddyValue(type: string, value: string): GoDaddyRecordValue {\n\tif (type !== 'MX') return { data: value };\n\tconst { priority, host } = parseMxValue(value);\n\treturn { data: host, priority };\n}\n\nfunction managed(type: string): type is GoDaddyRecordType {\n\treturn (GODADDY_MANAGED_TYPES as readonly string[]).includes(type);\n}\n\n/** A read GoDaddy refused: write-only, rather than a failure. */\nfunction readDenied(error: unknown): boolean {\n\treturn (\n\t\terror instanceof GoDaddyScopeMissing ||\n\t\terror instanceof GoDaddyApiAccessDenied\n\t);\n}\n\nexport class GoDaddyProvider implements DnsProvider {\n\treadonly name = 'godaddy';\n\tprivate api: GoDaddyApi | null = null;\n\t/** Set once a read is refused: every write is then a blind PUT. */\n\tprivate writeOnly = false;\n\n\tconstructor(private readonly options: GoDaddyProviderOptions = {}) {}\n\n\t/** Whether the token turned out unable to read records. */\n\tget readsDenied(): boolean {\n\t\treturn this.writeOnly;\n\t}\n\n\tprivate async getApi(): Promise<GoDaddyApi> {\n\t\tif (this.api) return this.api;\n\t\tconst credential =\n\t\t\tthis.options.credential ??\n\t\t\t(await storedCredentials({\n\t\t\t\tenv: this.options.env ?? process.env,\n\t\t\t\t...(this.options.home ? { home: this.options.home } : {}),\n\t\t\t}).get({ kind: 'godaddy' }));\n\t\tif (!credential) throw new MissingCredential('godaddy', undefined);\n\t\tthis.api = new GoDaddyApi({\n\t\t\tcredential,\n\t\t\t...(this.options.baseUrl ? { baseUrl: this.options.baseUrl } : {}),\n\t\t\t...(this.options.sleep ? { sleep: this.options.sleep } : {}),\n\t\t\t...(this.options.maxAttempts\n\t\t\t\t? { maxAttempts: this.options.maxAttempts }\n\t\t\t\t: {}),\n\t\t});\n\t\treturn this.api;\n\t}\n\n\tprivate assertManaged(domain: string, type: string, name: string): void {\n\t\tif (!managed(type)) {\n\t\t\tthrow new GoDaddyRecordNotAllowed(\n\t\t\t\tdomain,\n\t\t\t\ttype,\n\t\t\t\tname,\n\t\t\t\t'it is not a type gkm manages',\n\t\t\t);\n\t\t}\n\t}\n\n\t/** Never: the whole zone is not read. See {@link GoDaddyZoneListingUnsupported}. */\n\tasync getRecords(domain: string): Promise<DnsRecord[]> {\n\t\tthrow new GoDaddyZoneListingUnsupported(domain);\n\t}\n\n\t/**\n\t * The records of exactly these names and types, one request each.\n\t *\n\t * @throws {DnsRecordsUnreadable} when the token may not read records\n\t */\n\tasync readRecords(\n\t\tdomain: string,\n\t\twanted: readonly DeleteDnsRecord[],\n\t): Promise<DnsRecord[]> {\n\t\tfor (const { name, type } of wanted) this.assertManaged(domain, type, name);\n\t\tconst api = await this.getApi();\n\t\tconst found: DnsRecord[] = [];\n\t\tfor (const { name, type } of wanted) {\n\t\t\tlet records: GoDaddyRecord[];\n\t\t\ttry {\n\t\t\t\trecords = await api.getRecordSet(\n\t\t\t\t\tdomain,\n\t\t\t\t\ttype as GoDaddyRecordType,\n\t\t\t\t\tname,\n\t\t\t\t);\n\t\t\t} catch (error) {\n\t\t\t\tif (!readDenied(error)) throw error;\n\t\t\t\tthis.writeOnly = true;\n\t\t\t\tthrow new DnsRecordsUnreadable(\n\t\t\t\t\tthis.name,\n\t\t\t\t\tdomain,\n\t\t\t\t\t(error as Error).name,\n\t\t\t\t);\n\t\t\t}\n\t\t\tif (records.length === 0) continue;\n\t\t\tfound.push({\n\t\t\t\tname,\n\t\t\t\ttype,\n\t\t\t\tttl: records[0]!.ttl ?? GODADDY_MIN_TTL,\n\t\t\t\tvalues: records.map((r) => valueOf(type, r)),\n\t\t\t});\n\t\t}\n\t\treturn found;\n\t}\n\n\t/**\n\t * Each record set to exactly its one value: read it, and write it only\n\t * when it differs — or, with a token that cannot read, write it. Only the\n\t * name and type of each record handed in is touched.\n\t */\n\tasync upsertRecords(\n\t\tdomain: string,\n\t\trecords: UpsertDnsRecord[],\n\t): Promise<UpsertResult[]> {\n\t\t// Every record is checked before any is written, so a refused one\n\t\t// leaves the zone as it was.\n\t\tconst values = records.map((record) => {\n\t\t\tthis.assertManaged(domain, record.type, record.name);\n\t\t\treturn goDaddyValue(record.type, record.value);\n\t\t});\n\t\tconst api = await this.getApi();\n\n\t\tconst results: UpsertResult[] = [];\n\t\tfor (const [i, record] of records.entries()) {\n\t\t\tconst type = record.type as GoDaddyRecordType;\n\t\t\tlet existing: GoDaddyRecord[] | undefined;\n\t\t\tif (!this.writeOnly) {\n\t\t\t\ttry {\n\t\t\t\t\texisting = await api.getRecordSet(domain, type, record.name);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!readDenied(error)) throw error;\n\t\t\t\t\tthis.writeOnly = true;\n\t\t\t\t\t(this.options.log ?? console.log)(\n\t\t\t\t\t\t` ℹ The GoDaddy token cannot read ${domain}'s DNS records, so changes cannot be diffed: writing each record (idempotent).`,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (existing) {\n\t\t\t\tconst found = existing.map((r) => normalize(valueOf(type, r)));\n\t\t\t\tif (found.length === 1 && found[0] === normalize(record.value)) {\n\t\t\t\t\tresults.push({ record, created: false, unchanged: true });\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\tawait api.replaceRecordSet(\n\t\t\t\tdomain,\n\t\t\t\ttype,\n\t\t\t\trecord.name,\n\t\t\t\t[values[i]!],\n\t\t\t\tMath.max(record.ttl, GODADDY_MIN_TTL),\n\t\t\t);\n\t\t\tresults.push({\n\t\t\t\trecord,\n\t\t\t\tcreated: existing !== undefined && existing.length === 0,\n\t\t\t\tunchanged: false,\n\t\t\t});\n\t\t}\n\t\treturn results;\n\t}\n\n\tasync deleteRecords(\n\t\tdomain: string,\n\t\trecords: DeleteDnsRecord[],\n\t): Promise<DeleteResult[]> {\n\t\tfor (const record of records) {\n\t\t\tthis.assertManaged(domain, record.type, record.name);\n\t\t}\n\t\tconst api = await this.getApi();\n\t\tconst results: DeleteResult[] = [];\n\t\tfor (const record of records) {\n\t\t\tconst type = record.type as GoDaddyRecordType;\n\t\t\tif (!this.writeOnly) {\n\t\t\t\tlet existing: GoDaddyRecord[] | undefined;\n\t\t\t\ttry {\n\t\t\t\t\texisting = await api.getRecordSet(domain, type, record.name);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (!readDenied(error)) throw error;\n\t\t\t\t\tthis.writeOnly = true;\n\t\t\t\t}\n\t\t\t\tif (existing && existing.length === 0) {\n\t\t\t\t\tresults.push({ record, deleted: false, notFound: true });\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tawait api.deleteRecordSet(domain, type, record.name);\n\t\t\t} catch (error) {\n\t\t\t\t// Write-only, nothing was read: a record that is not there is a 404.\n\t\t\t\tif (this.writeOnly && error instanceof GoDaddyDomainNotFound) {\n\t\t\t\t\tresults.push({ record, deleted: false, notFound: true });\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tresults.push({ record, deleted: true, notFound: false });\n\t\t}\n\t\treturn results;\n\t}\n}\n"],"mappings":";;;;AAiCA,MAAa,wBAAwB;CAAC;CAAK;CAAQ;CAAS;AAAI;;;;;;AAiChE,IAAa,yBAAb,cAA4CA,eAAAA,SAAS;CAE1C;CACA;CAFV,YACC,QACA,QACC;EACD,MACC,kCAAkC,OAAO,qBAAqB,SAAS,KAAK,WAAW,GAAG,+dAQ3F;EAZS,KAAA,SAAA;EACA,KAAA,SAAA;EAYT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,sBAAb,cAAyCA,eAAAA,SAAS;CAEvC;CACA;CACA;CACA;CAJV,YACC,QACA,QACA,OACA,QACC;EACD,MACC,mBAAm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Q,KAAK;MAAE;MAAQ,SAAS;MAAO,UAAU;KAAK,CAAC;KACvD;IACD;IACA,MAAM;GACP;GACA,QAAQ,KAAK;IAAE;IAAQ,SAAS;IAAM,UAAU;GAAM,CAAC;EACxD;EACA,OAAO;CACR;AACD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
//#region src/
|
|
1
|
+
import { p as getHostingerToken, t as MissingCredential } from "./credentials-DpfnUvIR.mjs";
|
|
2
|
+
//#region src/target/dokploy/dns/hostinger-api.ts
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger DNS API client
|
|
5
5
|
*
|
|
@@ -147,25 +147,39 @@ var HostingerApi = class {
|
|
|
147
147
|
}
|
|
148
148
|
};
|
|
149
149
|
//#endregion
|
|
150
|
-
//#region src/
|
|
150
|
+
//#region src/target/dokploy/dns/HostingerProvider.ts
|
|
151
151
|
/**
|
|
152
152
|
* Hostinger DNS Provider
|
|
153
153
|
*
|
|
154
|
-
* Implements DnsProvider interface using the Hostinger DNS API.
|
|
154
|
+
* Implements DnsProvider interface using the Hostinger DNS API. A record's
|
|
155
|
+
* `content` is its zone-file value — an MX record's is `<priority> <host>`,
|
|
156
|
+
* Hostinger having no field of its own for the priority — so values pass
|
|
157
|
+
* through as they are. Each write replaces its one name and type
|
|
158
|
+
* (`overwrite: true`): without it Hostinger appends, and a record with
|
|
159
|
+
* another value would end up holding both.
|
|
155
160
|
*/
|
|
161
|
+
/** A value compared the way DNS does: case, a trailing dot and spacing aside. */
|
|
162
|
+
function normalize(value) {
|
|
163
|
+
return value.trim().replace(/\.$/, "").replace(/\s+/g, " ").toLowerCase();
|
|
164
|
+
}
|
|
156
165
|
/**
|
|
157
166
|
* Hostinger DNS provider implementation.
|
|
158
167
|
*/
|
|
159
168
|
var HostingerProvider = class {
|
|
169
|
+
credential;
|
|
160
170
|
name = "hostinger";
|
|
161
171
|
api = null;
|
|
172
|
+
/** `credential`: the token, when the caller already has it. */
|
|
173
|
+
constructor(credential) {
|
|
174
|
+
this.credential = credential;
|
|
175
|
+
}
|
|
162
176
|
/**
|
|
163
177
|
* Get or create the Hostinger API client.
|
|
164
178
|
*/
|
|
165
179
|
async getApi() {
|
|
166
180
|
if (this.api) return this.api;
|
|
167
|
-
const token = await getHostingerToken();
|
|
168
|
-
if (!token) throw new
|
|
181
|
+
const token = this.credential?.token ?? await getHostingerToken();
|
|
182
|
+
if (!token) throw new MissingCredential("hostinger", void 0);
|
|
169
183
|
this.api = new HostingerApi(token);
|
|
170
184
|
return this.api;
|
|
171
185
|
}
|
|
@@ -184,7 +198,7 @@ var HostingerProvider = class {
|
|
|
184
198
|
for (const record of records) {
|
|
185
199
|
const existing = existingRecords.find((r) => r.name === record.name && r.type === record.type);
|
|
186
200
|
const existingValue = existing?.records?.[0]?.content;
|
|
187
|
-
if (existing && existingValue === record.value) {
|
|
201
|
+
if (existing && existingValue !== void 0 && normalize(existingValue) === normalize(record.value)) {
|
|
188
202
|
results.push({
|
|
189
203
|
record,
|
|
190
204
|
created: false,
|
|
@@ -197,7 +211,7 @@ var HostingerProvider = class {
|
|
|
197
211
|
type: record.type,
|
|
198
212
|
ttl: record.ttl,
|
|
199
213
|
records: [{ content: record.value }]
|
|
200
|
-
}]);
|
|
214
|
+
}], true);
|
|
201
215
|
results.push({
|
|
202
216
|
record,
|
|
203
217
|
created: !existing,
|
|
@@ -240,4 +254,4 @@ var HostingerProvider = class {
|
|
|
240
254
|
//#endregion
|
|
241
255
|
export { HostingerProvider };
|
|
242
256
|
|
|
243
|
-
//# sourceMappingURL=HostingerProvider-
|
|
257
|
+
//# sourceMappingURL=HostingerProvider-CgMuKgO_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HostingerProvider-CgMuKgO_.mjs","names":[],"sources":["../src/target/dokploy/dns/hostinger-api.ts","../src/target/dokploy/dns/HostingerProvider.ts"],"sourcesContent":["/**\n * Hostinger DNS API client\n *\n * API Documentation: https://developers.hostinger.com/\n * Authentication: Bearer token from hpanel.hostinger.com/profile/api\n */\n\nconst HOSTINGER_API_BASE = 'https://developers.hostinger.com';\n\n/**\n * DNS record types supported by Hostinger\n */\nexport type DnsRecordType =\n\t| 'A'\n\t| 'AAAA'\n\t| 'CNAME'\n\t| 'MX'\n\t| 'TXT'\n\t| 'NS'\n\t| 'SRV'\n\t| 'CAA';\n\n/**\n * A single DNS record\n */\nexport interface DnsRecord {\n\t/** Subdomain name (e.g., 'api.joemoer' for api.joemoer.traflabs.io) */\n\tname: string;\n\t/** Record type */\n\ttype: DnsRecordType;\n\t/** TTL in seconds */\n\tttl: number;\n\t/** Record values */\n\trecords: Array<{ content: string }>;\n}\n\n/**\n * Filter for deleting specific records\n */\nexport interface DnsRecordFilter {\n\tname: string;\n\ttype: DnsRecordType;\n}\n\n/**\n * API error response\n */\nexport interface HostingerErrorResponse {\n\tmessage?: string;\n\terrors?: Record<string, string[]>;\n}\n\n/**\n * Hostinger API error\n */\nexport class HostingerApiError extends Error {\n\tconstructor(\n\t\tmessage: string,\n\t\tpublic status: number,\n\t\tpublic statusText: string,\n\t\tpublic errors?: Record<string, string[]>,\n\t) {\n\t\tsuper(message);\n\t\tthis.name = 'HostingerApiError';\n\t}\n}\n\n/**\n * Hostinger DNS API client\n *\n * @example\n * ```ts\n * const api = new HostingerApi(token);\n *\n * // Get all records for a domain\n * const records = await api.getRecords('traflabs.io');\n *\n * // Create/update records\n * await api.upsertRecords('traflabs.io', [\n * { name: 'api.joemoer', type: 'A', ttl: 300, records: ['1.2.3.4'] }\n * ]);\n * ```\n */\nexport class HostingerApi {\n\tprivate token: string;\n\n\tconstructor(token: string) {\n\t\tthis.token = token;\n\t}\n\n\t/**\n\t * Make a request to the Hostinger API\n\t */\n\tprivate async request<T>(\n\t\tmethod: 'GET' | 'POST' | 'PUT' | 'DELETE',\n\t\tendpoint: string,\n\t\tbody?: unknown,\n\t): Promise<T> {\n\t\tconst url = `${HOSTINGER_API_BASE}${endpoint}`;\n\n\t\tconst response = await fetch(url, {\n\t\t\tmethod,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\tAuthorization: `Bearer ${this.token}`,\n\t\t\t},\n\t\t\tbody: body ? JSON.stringify(body) : undefined,\n\t\t});\n\n\t\tif (!response.ok) {\n\t\t\tlet errorMessage = `Hostinger API error: ${response.status} ${response.statusText}`;\n\t\t\tlet errors: Record<string, string[]> | undefined;\n\n\t\t\ttry {\n\t\t\t\tconst errorBody = (await response.json()) as HostingerErrorResponse;\n\t\t\t\tif (errorBody.message) {\n\t\t\t\t\terrorMessage = `Hostinger API error: ${errorBody.message}`;\n\t\t\t\t}\n\t\t\t\terrors = errorBody.errors;\n\t\t\t} catch {\n\t\t\t\t// Ignore JSON parse errors\n\t\t\t}\n\n\t\t\tthrow new HostingerApiError(\n\t\t\t\terrorMessage,\n\t\t\t\tresponse.status,\n\t\t\t\tresponse.statusText,\n\t\t\t\terrors,\n\t\t\t);\n\t\t}\n\n\t\t// Handle empty responses\n\t\tconst text = await response.text();\n\t\tif (!text || text.trim() === '') {\n\t\t\treturn undefined as T;\n\t\t}\n\t\treturn JSON.parse(text) as T;\n\t}\n\n\t/**\n\t * Get all DNS records for a domain\n\t *\n\t * @param domain - Root domain (e.g., 'traflabs.io')\n\t */\n\tasync getRecords(domain: string): Promise<DnsRecord[]> {\n\t\t// The zone comes back as a **bare array**, not `{ data: [...] }`.\n\t\t//\n\t\t// This read `response.data || []`, so every call returned zero records\n\t\t// against the real API while every mocked test passed. Silently: no error,\n\t\t// no warning, just an empty zone. `upsertRecords` uses this to decide what\n\t\t// already exists, so everything looked new and every write was reported as\n\t\t// a creation — harmless only because the PUT merges rather than replaces.\n\t\t//\n\t\t// Both shapes are accepted because one of them is a guess: the wrapper was\n\t\t// written against documentation and the array is what the API actually\n\t\t// sends, so tolerating an envelope costs a line and survives it appearing.\n\t\tconst response = await this.request<DnsRecord[] | { data?: DnsRecord[] }>(\n\t\t\t'GET',\n\t\t\t`/api/dns/v1/zones/${domain}`,\n\t\t);\n\n\t\tif (Array.isArray(response)) return response;\n\n\t\treturn response?.data ?? [];\n\t}\n\n\t/**\n\t * Create or update DNS records\n\t *\n\t * @param domain - Root domain (e.g., 'traflabs.io')\n\t * @param records - Records to create/update\n\t * @param overwrite - If true, replaces all existing records. If false, merges with existing.\n\t */\n\tasync upsertRecords(\n\t\tdomain: string,\n\t\trecords: DnsRecord[],\n\t\toverwrite = false,\n\t): Promise<void> {\n\t\tawait this.request('PUT', `/api/dns/v1/zones/${domain}`, {\n\t\t\toverwrite,\n\t\t\tzone: records,\n\t\t});\n\t}\n\n\t/**\n\t * Validate DNS records before applying\n\t *\n\t * @param domain - Root domain (e.g., 'traflabs.io')\n\t * @param records - Records to validate\n\t * @returns true if valid, throws if invalid\n\t */\n\tasync validateRecords(\n\t\tdomain: string,\n\t\trecords: DnsRecord[],\n\t): Promise<boolean> {\n\t\tawait this.request('POST', `/api/dns/v1/zones/${domain}/validate`, {\n\t\t\toverwrite: false,\n\t\t\tzone: records,\n\t\t});\n\t\treturn true;\n\t}\n\n\t/**\n\t * Delete specific DNS records\n\t *\n\t * @param domain - Root domain (e.g., 'traflabs.io')\n\t * @param filters - Filters to match records for deletion\n\t */\n\tasync deleteRecords(\n\t\tdomain: string,\n\t\tfilters: DnsRecordFilter[],\n\t): Promise<void> {\n\t\tawait this.request('DELETE', `/api/dns/v1/zones/${domain}`, {\n\t\t\tfilters,\n\t\t});\n\t}\n\n\t/**\n\t * Check if a specific record exists\n\t *\n\t * @param domain - Root domain (e.g., 'traflabs.io')\n\t * @param name - Subdomain name (e.g., 'api.joemoer')\n\t * @param type - Record type (e.g., 'A')\n\t */\n\tasync recordExists(\n\t\tdomain: string,\n\t\tname: string,\n\t\ttype: DnsRecordType = 'A',\n\t): Promise<boolean> {\n\t\tconst records = await this.getRecords(domain);\n\t\treturn records.some((r) => r.name === name && r.type === type);\n\t}\n\n\t/**\n\t * Create a single A record if it doesn't exist\n\t *\n\t * @param domain - Root domain (e.g., 'traflabs.io')\n\t * @param subdomain - Subdomain name (e.g., 'api.joemoer')\n\t * @param ip - IP address to point to\n\t * @param ttl - TTL in seconds (default: 300)\n\t * @returns true if created, false if already exists\n\t */\n\tasync createARecordIfNotExists(\n\t\tdomain: string,\n\t\tsubdomain: string,\n\t\tip: string,\n\t\tttl = 300,\n\t): Promise<boolean> {\n\t\tconst exists = await this.recordExists(domain, subdomain, 'A');\n\t\tif (exists) {\n\t\t\treturn false;\n\t\t}\n\n\t\tawait this.upsertRecords(domain, [\n\t\t\t{\n\t\t\t\tname: subdomain,\n\t\t\t\ttype: 'A',\n\t\t\t\tttl,\n\t\t\t\trecords: [{ content: ip }],\n\t\t\t},\n\t\t]);\n\n\t\treturn true;\n\t}\n}\n","/**\n * Hostinger DNS Provider\n *\n * Implements DnsProvider interface using the Hostinger DNS API. A record's\n * `content` is its zone-file value — an MX record's is `<priority> <host>`,\n * Hostinger having no field of its own for the priority — so values pass\n * through as they are. Each write replaces its one name and type\n * (`overwrite: true`): without it Hostinger appends, and a record with\n * another value would end up holding both.\n */\n\nimport { getHostingerToken } from '../../../auth/credentials';\nimport {\n\ttype HostingerCredential,\n\tMissingCredential,\n} from '../../../deploy/credentials';\nimport type {\n\tDeleteDnsRecord,\n\tDeleteResult,\n\tDnsProvider,\n\tDnsRecord,\n\tUpsertDnsRecord,\n\tUpsertResult,\n} from './DnsProvider';\nimport { HostingerApi } from './hostinger-api';\n\n/** A value compared the way DNS does: case, a trailing dot and spacing aside. */\nfunction normalize(value: string): string {\n\treturn value.trim().replace(/\\.$/, '').replace(/\\s+/g, ' ').toLowerCase();\n}\n\n/**\n * Hostinger DNS provider implementation.\n */\nexport class HostingerProvider implements DnsProvider {\n\treadonly name = 'hostinger';\n\tprivate api: HostingerApi | null = null;\n\n\t/** `credential`: the token, when the caller already has it. */\n\tconstructor(private readonly credential?: HostingerCredential) {}\n\n\t/**\n\t * Get or create the Hostinger API client.\n\t */\n\tprivate async getApi(): Promise<HostingerApi> {\n\t\tif (this.api) {\n\t\t\treturn this.api;\n\t\t}\n\n\t\tconst token = this.credential?.token ?? (await getHostingerToken());\n\t\tif (!token) throw new MissingCredential('hostinger', undefined);\n\n\t\tthis.api = new HostingerApi(token);\n\t\treturn this.api;\n\t}\n\n\tasync getRecords(domain: string): Promise<DnsRecord[]> {\n\t\tconst api = await this.getApi();\n\t\tconst records = await api.getRecords(domain);\n\n\t\treturn records.map((r) => ({\n\t\t\tname: r.name,\n\t\t\ttype: r.type,\n\t\t\tttl: r.ttl,\n\t\t\tvalues: r.records.map((rec) => rec.content),\n\t\t}));\n\t}\n\n\tasync upsertRecords(\n\t\tdomain: string,\n\t\trecords: UpsertDnsRecord[],\n\t): Promise<UpsertResult[]> {\n\t\tconst api = await this.getApi();\n\t\tconst results: UpsertResult[] = [];\n\n\t\t// Get existing records to check what already exists\n\t\tconst existingRecords = await api.getRecords(domain);\n\n\t\tfor (const record of records) {\n\t\t\tconst existing = existingRecords.find(\n\t\t\t\t(r) => r.name === record.name && r.type === record.type,\n\t\t\t);\n\n\t\t\tconst existingValue = existing?.records?.[0]?.content;\n\n\t\t\tif (\n\t\t\t\texisting &&\n\t\t\t\texistingValue !== undefined &&\n\t\t\t\tnormalize(existingValue) === normalize(record.value)\n\t\t\t) {\n\t\t\t\t// Record exists with same value - unchanged\n\t\t\t\tresults.push({\n\t\t\t\t\trecord,\n\t\t\t\t\tcreated: false,\n\t\t\t\t\tunchanged: true,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Create the record, or replace this name's records of this type.\n\t\t\tawait api.upsertRecords(\n\t\t\t\tdomain,\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\tname: record.name,\n\t\t\t\t\t\ttype: record.type,\n\t\t\t\t\t\tttl: record.ttl,\n\t\t\t\t\t\trecords: [{ content: record.value }],\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t\ttrue,\n\t\t\t);\n\n\t\t\tresults.push({\n\t\t\t\trecord,\n\t\t\t\tcreated: !existing,\n\t\t\t\tunchanged: false,\n\t\t\t});\n\t\t}\n\n\t\treturn results;\n\t}\n\n\tasync deleteRecords(\n\t\tdomain: string,\n\t\trecords: DeleteDnsRecord[],\n\t): Promise<DeleteResult[]> {\n\t\tconst api = await this.getApi();\n\t\tconst results: DeleteResult[] = [];\n\n\t\t// Get existing records to check what exists\n\t\tconst existingRecords = await api.getRecords(domain);\n\n\t\t// Filter to only records that exist\n\t\tconst recordsToDelete = records.filter((record) =>\n\t\t\texistingRecords.some(\n\t\t\t\t(r) => r.name === record.name && r.type === record.type,\n\t\t\t),\n\t\t);\n\n\t\t// Delete existing records\n\t\tif (recordsToDelete.length > 0) {\n\t\t\ttry {\n\t\t\t\tawait api.deleteRecords(\n\t\t\t\t\tdomain,\n\t\t\t\t\trecordsToDelete.map((r) => ({\n\t\t\t\t\t\tname: r.name,\n\t\t\t\t\t\ttype: r.type as\n\t\t\t\t\t\t\t| 'A'\n\t\t\t\t\t\t\t| 'AAAA'\n\t\t\t\t\t\t\t| 'CNAME'\n\t\t\t\t\t\t\t| 'MX'\n\t\t\t\t\t\t\t| 'TXT'\n\t\t\t\t\t\t\t| 'SRV'\n\t\t\t\t\t\t\t| 'CAA',\n\t\t\t\t\t})),\n\t\t\t\t);\n\n\t\t\t\tfor (const record of recordsToDelete) {\n\t\t\t\t\tresults.push({\n\t\t\t\t\t\trecord,\n\t\t\t\t\t\tdeleted: true,\n\t\t\t\t\t\tnotFound: false,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} catch (error) {\n\t\t\t\t// If batch delete fails, report error for all records\n\t\t\t\tfor (const record of recordsToDelete) {\n\t\t\t\t\tresults.push({\n\t\t\t\t\t\trecord,\n\t\t\t\t\t\tdeleted: false,\n\t\t\t\t\t\tnotFound: false,\n\t\t\t\t\t\terror: String(error),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Mark non-existent records as not found\n\t\tfor (const record of records) {\n\t\t\tconst existing = existingRecords.find(\n\t\t\t\t(r) => r.name === record.name && r.type === record.type,\n\t\t\t);\n\t\t\tif (!existing) {\n\t\t\t\tresults.push({\n\t\t\t\t\trecord,\n\t\t\t\t\tdeleted: false,\n\t\t\t\t\tnotFound: true,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\treturn results;\n\t}\n}\n"],"mappings":";;;;;;;;AAOA,MAAM,qBAAqB;;;;AAgD3B,IAAa,oBAAb,cAAuC,MAAM;CAGpC;CACA;CACA;CAJR,YACC,SACA,QACA,YACA,QACC;EACD,MAAM,OAAO;EAJN,KAAA,SAAA;EACA,KAAA,aAAA;EACA,KAAA,SAAA;EAGP,KAAK,OAAO;CACb;AACD;;;;;;;;;;;;;;;;;AAkBA,IAAa,eAAb,MAA0B;CACzB;CAEA,YAAY,OAAe;EAC1B,KAAK,QAAQ;CACd;;;;CAKA,MAAc,QACb,QACA,UACA,MACa;EACb,MAAM,MAAM,GAAG,qBAAqB;EAEpC,MAAM,WAAW,MAAM,MAAM,KAAK;GACjC;GACA,SAAS;IACR,gBAAgB;IAChB,eAAe,UAAU,KAAK;GAC/B;GACA,MAAM,OAAO,KAAK,UAAU,IAAI,IAAI,KAAA;EACrC,CAAC;EAED,IAAI,CAAC,SAAS,IAAI;GACjB,IAAI,eAAe,wBAAwB,SAAS,OAAO,GAAG,SAAS;GACvE,IAAI;GAEJ,IAAI;IACH,MAAM,YAAa,MAAM,SAAS,KAAK;IACvC,IAAI,UAAU,SACb,eAAe,wBAAwB,UAAU;IAElD,SAAS,UAAU;GACpB,QAAQ,CAER;GAEA,MAAM,IAAI,kBACT,cACA,SAAS,QACT,SAAS,YACT,MACD;EACD;EAGA,MAAM,OAAO,MAAM,SAAS,KAAK;EACjC,IAAI,CAAC,QAAQ,KAAK,KAAK,MAAM,IAC5B;EAED,OAAO,KAAK,MAAM,IAAI;CACvB;;;;;;CAOA,MAAM,WAAW,QAAsC;EAYtD,MAAM,WAAW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