@geekmidas/cli 10.0.0-alpha.14 → 10.0.0-alpha.140

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (424) hide show
  1. package/README.md +313 -380
  2. package/bin/adjacent-tsconfig.mjs +46 -8
  3. package/bin/gkm.mjs +11 -3
  4. package/bin/owning-tsconfig-jsx-register.mjs +18 -0
  5. package/bin/owning-tsconfig-jsx.mjs +108 -0
  6. package/dist/EndpointGenerator-BMRL04ic.mjs +1037 -0
  7. package/dist/EndpointGenerator-BMRL04ic.mjs.map +1 -0
  8. package/dist/EndpointGenerator-ePscnbwB.cjs +1096 -0
  9. package/dist/EndpointGenerator-ePscnbwB.cjs.map +1 -0
  10. package/dist/GoDaddyProvider-BgY6mqoH.mjs +413 -0
  11. package/dist/GoDaddyProvider-BgY6mqoH.mjs.map +1 -0
  12. package/dist/GoDaddyProvider-C-rs22Zv.cjs +413 -0
  13. package/dist/GoDaddyProvider-C-rs22Zv.cjs.map +1 -0
  14. package/dist/{HostingerProvider-BY26bWwB.mjs → HostingerProvider-CgMuKgO_.mjs} +23 -9
  15. package/dist/HostingerProvider-CgMuKgO_.mjs.map +1 -0
  16. package/dist/{HostingerProvider-BZFGYYVA.cjs → HostingerProvider-DEqpvoiD.cjs} +23 -9
  17. package/dist/HostingerProvider-DEqpvoiD.cjs.map +1 -0
  18. package/dist/LegacyStateStore-6xskEtld.cjs +124 -0
  19. package/dist/LegacyStateStore-6xskEtld.cjs.map +1 -0
  20. package/dist/LegacyStateStore-Dx65SWE9.mjs +124 -0
  21. package/dist/LegacyStateStore-Dx65SWE9.mjs.map +1 -0
  22. package/dist/LocalStateStore-DFtTtHty.cjs +178 -0
  23. package/dist/LocalStateStore-DFtTtHty.cjs.map +1 -0
  24. package/dist/LocalStateStore-Dto39TCx.mjs +167 -0
  25. package/dist/LocalStateStore-Dto39TCx.mjs.map +1 -0
  26. package/dist/OpenApiTsGenerator-B-PQLx8X.mjs +534 -0
  27. package/dist/OpenApiTsGenerator-B-PQLx8X.mjs.map +1 -0
  28. package/dist/OpenApiTsGenerator-BvacdbiG.cjs +539 -0
  29. package/dist/OpenApiTsGenerator-BvacdbiG.cjs.map +1 -0
  30. package/dist/{Route53Provider-Cvj40A8I.mjs → Route53Provider-Di_SD9CF.mjs} +3 -3
  31. package/dist/Route53Provider-Di_SD9CF.mjs.map +1 -0
  32. package/dist/{Route53Provider-DVILBsvV.cjs → Route53Provider-emLuQHVw.cjs} +3 -3
  33. package/dist/Route53Provider-emLuQHVw.cjs.map +1 -0
  34. package/dist/S3StateStore-B-9ea-sX.cjs +222 -0
  35. package/dist/S3StateStore-B-9ea-sX.cjs.map +1 -0
  36. package/dist/S3StateStore-C01zMOYm.mjs +223 -0
  37. package/dist/S3StateStore-C01zMOYm.mjs.map +1 -0
  38. package/dist/SSMStateStore-CKArcPUh.cjs +204 -0
  39. package/dist/SSMStateStore-CKArcPUh.cjs.map +1 -0
  40. package/dist/SSMStateStore-k-4XM7mb.mjs +205 -0
  41. package/dist/SSMStateStore-k-4XM7mb.mjs.map +1 -0
  42. package/dist/SubscriberGenerator-DLPH-ynS.mjs +783 -0
  43. package/dist/SubscriberGenerator-DLPH-ynS.mjs.map +1 -0
  44. package/dist/SubscriberGenerator-DR4Y7ihK.cjs +848 -0
  45. package/dist/SubscriberGenerator-DR4Y7ihK.cjs.map +1 -0
  46. package/dist/add-BgzsYxUq.cjs +713 -0
  47. package/dist/add-BgzsYxUq.cjs.map +1 -0
  48. package/dist/add-CiIrpOb9.mjs +711 -0
  49. package/dist/add-CiIrpOb9.mjs.map +1 -0
  50. package/dist/appPorts-BoXMwolc.mjs +249 -0
  51. package/dist/appPorts-BoXMwolc.mjs.map +1 -0
  52. package/dist/appPorts-IW-OZmRi.cjs +296 -0
  53. package/dist/appPorts-IW-OZmRi.cjs.map +1 -0
  54. package/dist/aws-8QQ8n-t6.mjs +89 -0
  55. package/dist/aws-8QQ8n-t6.mjs.map +1 -0
  56. package/dist/aws-DY9NqQIT.cjs +100 -0
  57. package/dist/aws-DY9NqQIT.cjs.map +1 -0
  58. package/dist/awsStore-Bx5nCFnS.mjs +121 -0
  59. package/dist/awsStore-Bx5nCFnS.mjs.map +1 -0
  60. package/dist/awsStore-u3ehhMoY.cjs +138 -0
  61. package/dist/awsStore-u3ehhMoY.cjs.map +1 -0
  62. package/dist/{backup-provisioner-DIVCbfee.mjs → backup-provisioner-C8DnCmxK.mjs} +2 -2
  63. package/dist/backup-provisioner-C8DnCmxK.mjs.map +1 -0
  64. package/dist/{backup-provisioner-BmhIO_Yr.cjs → backup-provisioner-oDEsPj02.cjs} +2 -2
  65. package/dist/backup-provisioner-oDEsPj02.cjs.map +1 -0
  66. package/dist/backups/runner.cjs +519 -0
  67. package/dist/backups/runner.cjs.map +1 -0
  68. package/dist/backups/runner.d.cts +102 -0
  69. package/dist/backups/runner.d.cts.map +1 -0
  70. package/dist/backups/runner.d.mts +102 -0
  71. package/dist/backups/runner.d.mts.map +1 -0
  72. package/dist/backups/runner.mjs +506 -0
  73. package/dist/backups/runner.mjs.map +1 -0
  74. package/dist/{bundler-BodTL4kf.mjs → bundler-C4uMSy8e.mjs} +32 -11
  75. package/dist/bundler-C4uMSy8e.mjs.map +1 -0
  76. package/dist/{bundler-BeNDZdHQ.cjs → bundler-DKxuDoVL.cjs} +32 -11
  77. package/dist/bundler-DKxuDoVL.cjs.map +1 -0
  78. package/dist/cli-Bm2is6R_.mjs +71 -0
  79. package/dist/cli-Bm2is6R_.mjs.map +1 -0
  80. package/dist/cli-na0npMhC.cjs +71 -0
  81. package/dist/cli-na0npMhC.cjs.map +1 -0
  82. package/dist/compose-CVatM7Cl.mjs +4275 -0
  83. package/dist/compose-CVatM7Cl.mjs.map +1 -0
  84. package/dist/compose-D8U9ygdm.cjs +4418 -0
  85. package/dist/compose-D8U9ygdm.cjs.map +1 -0
  86. package/dist/config-BbivVpq0.d.mts +268 -0
  87. package/dist/config-BbivVpq0.d.mts.map +1 -0
  88. package/dist/config-BcL1Fojs.d.cts +268 -0
  89. package/dist/config-BcL1Fojs.d.cts.map +1 -0
  90. package/dist/config.cjs +420 -9
  91. package/dist/config.cjs.map +1 -0
  92. package/dist/config.d.cts +4 -117
  93. package/dist/config.d.mts +4 -117
  94. package/dist/config.mjs +406 -3
  95. package/dist/config.mjs.map +1 -0
  96. package/dist/credentialSchemas-DUCSYl9a.mjs +237 -0
  97. package/dist/credentialSchemas-DUCSYl9a.mjs.map +1 -0
  98. package/dist/credentialSchemas-DZ2Nh5li.cjs +272 -0
  99. package/dist/credentialSchemas-DZ2Nh5li.cjs.map +1 -0
  100. package/dist/credentials-D7XJypNd.cjs +520 -0
  101. package/dist/credentials-D7XJypNd.cjs.map +1 -0
  102. package/dist/credentials-DpfnUvIR.mjs +395 -0
  103. package/dist/credentials-DpfnUvIR.mjs.map +1 -0
  104. package/dist/databases-Db48ZIXL.mjs +588 -0
  105. package/dist/databases-Db48ZIXL.mjs.map +1 -0
  106. package/dist/databases-P824RTnx.cjs +703 -0
  107. package/dist/databases-P824RTnx.cjs.map +1 -0
  108. package/dist/define-6poNqm5O.mjs +106 -0
  109. package/dist/define-6poNqm5O.mjs.map +1 -0
  110. package/dist/define-crmMcXFS.cjs +153 -0
  111. package/dist/define-crmMcXFS.cjs.map +1 -0
  112. package/dist/deploy/public.cjs +211 -0
  113. package/dist/deploy/public.cjs.map +1 -0
  114. package/dist/deploy/public.d.cts +647 -0
  115. package/dist/deploy/public.d.cts.map +1 -0
  116. package/dist/deploy/public.d.mts +647 -0
  117. package/dist/deploy/public.d.mts.map +1 -0
  118. package/dist/deploy/public.mjs +144 -0
  119. package/dist/deploy/public.mjs.map +1 -0
  120. package/dist/deploy/sniffer-envparser-worker.cjs +54 -0
  121. package/dist/deploy/sniffer-envparser-worker.cjs.map +1 -0
  122. package/dist/deploy/sniffer-envparser-worker.d.cts +1 -0
  123. package/dist/deploy/sniffer-envparser-worker.d.mts +1 -0
  124. package/dist/deploy/sniffer-envparser-worker.mjs +55 -0
  125. package/dist/deploy/sniffer-envparser-worker.mjs.map +1 -0
  126. package/dist/deploy/sniffer-hooks.cjs +1 -1
  127. package/dist/deploy/sniffer-hooks.mjs +1 -1
  128. package/dist/deploy/sniffer-loader.cjs +2 -2
  129. package/dist/deploy/sniffer-loader.mjs +1 -1
  130. package/dist/deploy/sniffer-routes-worker.cjs +2 -2
  131. package/dist/deploy/sniffer-routes-worker.mjs +1 -1
  132. package/dist/deploy-CDcO08Xz.mjs +3835 -0
  133. package/dist/deploy-CDcO08Xz.mjs.map +1 -0
  134. package/dist/deploy-DrQB7ytj.cjs +3891 -0
  135. package/dist/deploy-DrQB7ytj.cjs.map +1 -0
  136. package/dist/derive-Cd7Hl3r2.mjs +259 -0
  137. package/dist/derive-Cd7Hl3r2.mjs.map +1 -0
  138. package/dist/derive-CgZfoBU2.cjs +282 -0
  139. package/dist/derive-CgZfoBU2.cjs.map +1 -0
  140. package/dist/discover-B2m8ytyq.mjs +831 -0
  141. package/dist/discover-B2m8ytyq.mjs.map +1 -0
  142. package/dist/discover-yqeJ2Bx7.cjs +934 -0
  143. package/dist/discover-yqeJ2Bx7.cjs.map +1 -0
  144. package/dist/dokploy-BKjPDvSN.cjs +38 -0
  145. package/dist/dokploy-BKjPDvSN.cjs.map +1 -0
  146. package/dist/dokploy-k4_ZN8zN.mjs +38 -0
  147. package/dist/dokploy-k4_ZN8zN.mjs.map +1 -0
  148. package/dist/drivers-C47nm-wB.cjs +311 -0
  149. package/dist/drivers-C47nm-wB.cjs.map +1 -0
  150. package/dist/drivers-CDjpjakg.mjs +252 -0
  151. package/dist/drivers-CDjpjakg.mjs.map +1 -0
  152. package/dist/eas-B1wBvwPH.mjs +334 -0
  153. package/dist/eas-B1wBvwPH.mjs.map +1 -0
  154. package/dist/eas-Bg4dI6n2.cjs +337 -0
  155. package/dist/eas-Bg4dI6n2.cjs.map +1 -0
  156. package/dist/emit-Bj6XSivk.mjs +136 -0
  157. package/dist/emit-Bj6XSivk.mjs.map +1 -0
  158. package/dist/emit-CDC__ubE.cjs +147 -0
  159. package/dist/emit-CDC__ubE.cjs.map +1 -0
  160. package/dist/encryption-Bve0PVOo.mjs +89 -0
  161. package/dist/encryption-Bve0PVOo.mjs.map +1 -0
  162. package/dist/encryption-DL_y8t6V.cjs +90 -0
  163. package/dist/encryption-DL_y8t6V.cjs.map +1 -0
  164. package/dist/engine-BhR5lt_V.cjs +3323 -0
  165. package/dist/engine-BhR5lt_V.cjs.map +1 -0
  166. package/dist/engine-HMLf20iZ.mjs +3210 -0
  167. package/dist/engine-HMLf20iZ.mjs.map +1 -0
  168. package/dist/errors-D8Gwp5kU.mjs +23 -0
  169. package/dist/errors-D8Gwp5kU.mjs.map +1 -0
  170. package/dist/errors-DMC4Umsb.cjs +34 -0
  171. package/dist/errors-DMC4Umsb.cjs.map +1 -0
  172. package/dist/github-B2hJVl-n.cjs +901 -0
  173. package/dist/github-B2hJVl-n.cjs.map +1 -0
  174. package/dist/github-DKn9ACi2.mjs +900 -0
  175. package/dist/github-DKn9ACi2.mjs.map +1 -0
  176. package/dist/googlePlay-CWq7ND_X.mjs +931 -0
  177. package/dist/googlePlay-CWq7ND_X.mjs.map +1 -0
  178. package/dist/googlePlay-DtuN0-7D.cjs +931 -0
  179. package/dist/googlePlay-DtuN0-7D.cjs.map +1 -0
  180. package/dist/identity-CBXr4wNi.mjs +129 -0
  181. package/dist/identity-CBXr4wNi.mjs.map +1 -0
  182. package/dist/identity-CbLfgQNT.cjs +182 -0
  183. package/dist/identity-CbLfgQNT.cjs.map +1 -0
  184. package/dist/{index-D-iAVHx-.d.cts → index-BZZeEWug.d.mts} +39 -15
  185. package/dist/index-BZZeEWug.d.mts.map +1 -0
  186. package/dist/{index-Cd-qeOam.d.mts → index-C1jffZ5_.d.cts} +39 -15
  187. package/dist/index-C1jffZ5_.d.cts.map +1 -0
  188. package/dist/index.cjs +13502 -12269
  189. package/dist/index.cjs.map +1 -1
  190. package/dist/index.mjs +13522 -12287
  191. package/dist/index.mjs.map +1 -1
  192. package/dist/local-B7Zv1NoA.mjs +224 -0
  193. package/dist/local-B7Zv1NoA.mjs.map +1 -0
  194. package/dist/local-OPC9BCZt.cjs +241 -0
  195. package/dist/local-OPC9BCZt.cjs.map +1 -0
  196. package/dist/migrate-BLVZqHtN.cjs +181 -0
  197. package/dist/migrate-BLVZqHtN.cjs.map +1 -0
  198. package/dist/migrate-DCvD4RJW.mjs +265 -0
  199. package/dist/migrate-DCvD4RJW.mjs.map +1 -0
  200. package/dist/migrate-W0ruUNb9.mjs +181 -0
  201. package/dist/migrate-W0ruUNb9.mjs.map +1 -0
  202. package/dist/migrate-iUui7B4q.cjs +270 -0
  203. package/dist/migrate-iUui7B4q.cjs.map +1 -0
  204. package/dist/openapi.cjs +214 -7
  205. package/dist/openapi.cjs.map +1 -0
  206. package/dist/openapi.d.cts +32 -8
  207. package/dist/openapi.d.cts.map +1 -1
  208. package/dist/openapi.d.mts +32 -8
  209. package/dist/openapi.d.mts.map +1 -1
  210. package/dist/openapi.mjs +209 -2
  211. package/dist/openapi.mjs.map +1 -0
  212. package/dist/projectBucket-BBbQ1lHF.cjs +263 -0
  213. package/dist/projectBucket-BBbQ1lHF.cjs.map +1 -0
  214. package/dist/projectBucket-C_DN4WzF.mjs +222 -0
  215. package/dist/projectBucket-C_DN4WzF.mjs.map +1 -0
  216. package/dist/provider-BqpjG9QM.cjs +57 -0
  217. package/dist/provider-BqpjG9QM.cjs.map +1 -0
  218. package/dist/provider-CEOKk8NS.mjs +46 -0
  219. package/dist/provider-CEOKk8NS.mjs.map +1 -0
  220. package/dist/publish-CqvDA5ry.cjs +124 -0
  221. package/dist/publish-CqvDA5ry.cjs.map +1 -0
  222. package/dist/publish-CxIBBD3b.mjs +123 -0
  223. package/dist/publish-CxIBBD3b.mjs.map +1 -0
  224. package/dist/ready-CGqJ74Kt.mjs +375 -0
  225. package/dist/ready-CGqJ74Kt.mjs.map +1 -0
  226. package/dist/ready-DuU0FXSj.cjs +404 -0
  227. package/dist/ready-DuU0FXSj.cjs.map +1 -0
  228. package/dist/reconcile/public.cjs +3 -5
  229. package/dist/reconcile/public.d.cts +31 -89
  230. package/dist/reconcile/public.d.cts.map +1 -1
  231. package/dist/reconcile/public.d.mts +31 -89
  232. package/dist/reconcile/public.d.mts.map +1 -1
  233. package/dist/reconcile/public.mjs +3 -3
  234. package/dist/{reconcile-DhQ00DpU.mjs → reconcile--I7V4Klj.mjs} +2 -2
  235. package/dist/{reconcile-DhQ00DpU.mjs.map → reconcile--I7V4Klj.mjs.map} +1 -1
  236. package/dist/{reconcile-Dd2iyILf.cjs → reconcile-CuCQBa5-.cjs} +3 -3
  237. package/dist/{reconcile-Dd2iyILf.cjs.map → reconcile-CuCQBa5-.cjs.map} +1 -1
  238. package/dist/resolve-BEVVvi13.cjs +316 -0
  239. package/dist/resolve-BEVVvi13.cjs.map +1 -0
  240. package/dist/resolve-CMC0MI0Z.mjs +263 -0
  241. package/dist/resolve-CMC0MI0Z.mjs.map +1 -0
  242. package/dist/rollback-CZiQkukY.mjs +136 -0
  243. package/dist/rollback-CZiQkukY.mjs.map +1 -0
  244. package/dist/rollback-e0zGkaBx.cjs +165 -0
  245. package/dist/rollback-e0zGkaBx.cjs.map +1 -0
  246. package/dist/runtime-Bvgyxm88.d.cts +82 -0
  247. package/dist/runtime-Bvgyxm88.d.cts.map +1 -0
  248. package/dist/runtime-CeAt1IJd.d.mts +82 -0
  249. package/dist/runtime-CeAt1IJd.d.mts.map +1 -0
  250. package/dist/s3-BKnL6YGQ.cjs +215 -0
  251. package/dist/s3-BKnL6YGQ.cjs.map +1 -0
  252. package/dist/s3-DW7SLsb8.mjs +215 -0
  253. package/dist/s3-DW7SLsb8.mjs.map +1 -0
  254. package/dist/sandbox/config-worker.cjs +43 -0
  255. package/dist/sandbox/config-worker.cjs.map +1 -0
  256. package/dist/sandbox/config-worker.d.cts +1 -0
  257. package/dist/sandbox/config-worker.d.mts +1 -0
  258. package/dist/sandbox/config-worker.mjs +44 -0
  259. package/dist/sandbox/config-worker.mjs.map +1 -0
  260. package/dist/sandbox/credentials-worker.cjs +54 -0
  261. package/dist/sandbox/credentials-worker.cjs.map +1 -0
  262. package/dist/sandbox/credentials-worker.d.cts +1 -0
  263. package/dist/sandbox/credentials-worker.d.mts +1 -0
  264. package/dist/sandbox/credentials-worker.mjs +55 -0
  265. package/dist/sandbox/credentials-worker.mjs.map +1 -0
  266. package/dist/sandbox/discover-worker.cjs +47 -0
  267. package/dist/sandbox/discover-worker.cjs.map +1 -0
  268. package/dist/sandbox/discover-worker.d.cts +1 -0
  269. package/dist/sandbox/discover-worker.d.mts +1 -0
  270. package/dist/sandbox/discover-worker.mjs +48 -0
  271. package/dist/sandbox/discover-worker.mjs.map +1 -0
  272. package/dist/sandbox/migrate-worker.cjs +76 -0
  273. package/dist/sandbox/migrate-worker.cjs.map +1 -0
  274. package/dist/sandbox/migrate-worker.d.cts +1 -0
  275. package/dist/sandbox/migrate-worker.d.mts +1 -0
  276. package/dist/sandbox/migrate-worker.mjs +77 -0
  277. package/dist/sandbox/migrate-worker.mjs.map +1 -0
  278. package/dist/sandbox-CHv3OYXg.cjs +165 -0
  279. package/dist/sandbox-CHv3OYXg.cjs.map +1 -0
  280. package/dist/sandbox-CbVB7uOD.mjs +118 -0
  281. package/dist/sandbox-CbVB7uOD.mjs.map +1 -0
  282. package/dist/{workspace-mFpI_ky_.cjs → schemas-BCwKKA42.mjs} +399 -1162
  283. package/dist/schemas-BCwKKA42.mjs.map +1 -0
  284. package/dist/{workspace-CgwmXEtc.mjs → schemas-BQ_v0lEX.cjs} +487 -971
  285. package/dist/schemas-BQ_v0lEX.cjs.map +1 -0
  286. package/dist/secretsManager-CQORubp9.mjs +97 -0
  287. package/dist/secretsManager-CQORubp9.mjs.map +1 -0
  288. package/dist/secretsManager-RAGcEDX1.cjs +108 -0
  289. package/dist/secretsManager-RAGcEDX1.cjs.map +1 -0
  290. package/dist/seeds-BR_7hJTw.cjs +10541 -0
  291. package/dist/seeds-BR_7hJTw.cjs.map +1 -0
  292. package/dist/seeds-nCxxlP5h.mjs +9418 -0
  293. package/dist/seeds-nCxxlP5h.mjs.map +1 -0
  294. package/dist/serverSetup-C3Tt9X1R.mjs +651 -0
  295. package/dist/serverSetup-C3Tt9X1R.mjs.map +1 -0
  296. package/dist/serverSetup-D2Xzsp2t.cjs +651 -0
  297. package/dist/serverSetup-D2Xzsp2t.cjs.map +1 -0
  298. package/dist/sniffer-BWgXPFAt.cjs +1998 -0
  299. package/dist/sniffer-BWgXPFAt.cjs.map +1 -0
  300. package/dist/sniffer-eEF_fIId.mjs +1825 -0
  301. package/dist/sniffer-eEF_fIId.mjs.map +1 -0
  302. package/dist/snsSubscriptions-BSoqUgsq.mjs +1497 -0
  303. package/dist/snsSubscriptions-BSoqUgsq.mjs.map +1 -0
  304. package/dist/snsSubscriptions-Y9declDd.cjs +1720 -0
  305. package/dist/snsSubscriptions-Y9declDd.cjs.map +1 -0
  306. package/dist/sst-Bz2HJlqc.mjs +440 -0
  307. package/dist/sst-Bz2HJlqc.mjs.map +1 -0
  308. package/dist/sst-lvCHdYsY.cjs +463 -0
  309. package/dist/sst-lvCHdYsY.cjs.map +1 -0
  310. package/dist/stage-BEcxppsu.cjs +310 -0
  311. package/dist/stage-BEcxppsu.cjs.map +1 -0
  312. package/dist/stage-DhcbcAar.mjs +299 -0
  313. package/dist/stage-DhcbcAar.mjs.map +1 -0
  314. package/dist/stages--icWbhPy.cjs +190 -0
  315. package/dist/stages--icWbhPy.cjs.map +1 -0
  316. package/dist/stages-CUwSy39f.mjs +190 -0
  317. package/dist/stages-CUwSy39f.mjs.map +1 -0
  318. package/dist/target/public.cjs +15 -0
  319. package/dist/target/public.d.cts +28 -0
  320. package/dist/target/public.d.cts.map +1 -0
  321. package/dist/target/public.d.mts +28 -0
  322. package/dist/target/public.d.mts.map +1 -0
  323. package/dist/target/public.mjs +4 -0
  324. package/dist/terminal-DURcYlVX.cjs +85 -0
  325. package/dist/terminal-DURcYlVX.cjs.map +1 -0
  326. package/dist/terminal-yOZ7kKF9.mjs +85 -0
  327. package/dist/terminal-yOZ7kKF9.mjs.map +1 -0
  328. package/dist/{types-C5ZNpUad.d.cts → types-C6hDCkV2.d.mts} +2229 -456
  329. package/dist/types-C6hDCkV2.d.mts.map +1 -0
  330. package/dist/{types-BGo5TaNE.d.mts → types-Dy1eV7yc.d.cts} +2231 -456
  331. package/dist/types-Dy1eV7yc.d.cts.map +1 -0
  332. package/dist/utils-D2Nk1Nv2.cjs +205 -0
  333. package/dist/utils-D2Nk1Nv2.cjs.map +1 -0
  334. package/dist/utils-D_fxUqvU.mjs +156 -0
  335. package/dist/utils-D_fxUqvU.mjs.map +1 -0
  336. package/dist/vitest.cjs +65 -0
  337. package/dist/vitest.cjs.map +1 -0
  338. package/dist/vitest.d.cts +29 -0
  339. package/dist/vitest.d.cts.map +1 -0
  340. package/dist/vitest.d.mts +29 -0
  341. package/dist/vitest.d.mts.map +1 -0
  342. package/dist/vitest.mjs +65 -0
  343. package/dist/vitest.mjs.map +1 -0
  344. package/dist/workerRuntime-BXfhbe13.cjs +108 -0
  345. package/dist/workerRuntime-BXfhbe13.cjs.map +1 -0
  346. package/dist/workerRuntime-CsOyBRx2.mjs +79 -0
  347. package/dist/workerRuntime-CsOyBRx2.mjs.map +1 -0
  348. package/dist/workspace/index.cjs +6 -2
  349. package/dist/workspace/index.d.cts +3 -3
  350. package/dist/workspace/index.d.mts +3 -3
  351. package/dist/workspace/index.mjs +2 -2
  352. package/dist/workspace-BbfBFtjn.mjs +2488 -0
  353. package/dist/workspace-BbfBFtjn.mjs.map +1 -0
  354. package/dist/workspace-Dkm3HL9e.cjs +2924 -0
  355. package/dist/workspace-Dkm3HL9e.cjs.map +1 -0
  356. package/package.json +61 -14
  357. package/dist/HostingerProvider-BY26bWwB.mjs.map +0 -1
  358. package/dist/HostingerProvider-BZFGYYVA.cjs.map +0 -1
  359. package/dist/LocalStateProvider-7HR6SS2t.cjs +0 -48
  360. package/dist/LocalStateProvider-7HR6SS2t.cjs.map +0 -1
  361. package/dist/LocalStateProvider-D7QyJoLM.mjs +0 -48
  362. package/dist/LocalStateProvider-D7QyJoLM.mjs.map +0 -1
  363. package/dist/Route53Provider-Cvj40A8I.mjs.map +0 -1
  364. package/dist/Route53Provider-DVILBsvV.cjs.map +0 -1
  365. package/dist/SSMStateProvider-B0Hu1MKZ.mjs +0 -75
  366. package/dist/SSMStateProvider-B0Hu1MKZ.mjs.map +0 -1
  367. package/dist/SSMStateProvider-VrQ-yeqd.cjs +0 -74
  368. package/dist/SSMStateProvider-VrQ-yeqd.cjs.map +0 -1
  369. package/dist/backup-provisioner-BmhIO_Yr.cjs.map +0 -1
  370. package/dist/backup-provisioner-DIVCbfee.mjs.map +0 -1
  371. package/dist/bundler-BeNDZdHQ.cjs.map +0 -1
  372. package/dist/bundler-BodTL4kf.mjs.map +0 -1
  373. package/dist/config-Q1rvKHvw.cjs +0 -467
  374. package/dist/config-Q1rvKHvw.cjs.map +0 -1
  375. package/dist/config-pqGD3hF9.mjs +0 -414
  376. package/dist/config-pqGD3hF9.mjs.map +0 -1
  377. package/dist/config.d.cts.map +0 -1
  378. package/dist/config.d.mts.map +0 -1
  379. package/dist/credentials-BekkKtY_.mjs +0 -2780
  380. package/dist/credentials-BekkKtY_.mjs.map +0 -1
  381. package/dist/credentials-Q6F0uqJq.cjs +0 -2917
  382. package/dist/credentials-Q6F0uqJq.cjs.map +0 -1
  383. package/dist/discover-BERGFg8v.cjs +0 -288
  384. package/dist/discover-BERGFg8v.cjs.map +0 -1
  385. package/dist/discover-CK-n3w6b.mjs +0 -244
  386. package/dist/discover-CK-n3w6b.mjs.map +0 -1
  387. package/dist/emit-BdoPFjZf.cjs +0 -253
  388. package/dist/emit-BdoPFjZf.cjs.map +0 -1
  389. package/dist/emit-Bzq7JsMP.mjs +0 -224
  390. package/dist/emit-Bzq7JsMP.mjs.map +0 -1
  391. package/dist/fullstack-secrets-BET8gqwK.mjs +0 -81
  392. package/dist/fullstack-secrets-BET8gqwK.mjs.map +0 -1
  393. package/dist/fullstack-secrets-DXsWO-5m.cjs +0 -92
  394. package/dist/fullstack-secrets-DXsWO-5m.cjs.map +0 -1
  395. package/dist/generator-LfZU7NlU.mjs +0 -247
  396. package/dist/generator-LfZU7NlU.mjs.map +0 -1
  397. package/dist/generator-Wdfp0jCS.cjs +0 -282
  398. package/dist/generator-Wdfp0jCS.cjs.map +0 -1
  399. package/dist/github-BfflNPVe.cjs +0 -203
  400. package/dist/github-BfflNPVe.cjs.map +0 -1
  401. package/dist/github-CRwnxKmD.mjs +0 -203
  402. package/dist/github-CRwnxKmD.mjs.map +0 -1
  403. package/dist/index-Cd-qeOam.d.mts.map +0 -1
  404. package/dist/index-D-iAVHx-.d.cts.map +0 -1
  405. package/dist/keystore-B4PRlbgE.mjs +0 -81
  406. package/dist/keystore-B4PRlbgE.mjs.map +0 -1
  407. package/dist/keystore-DgGRj2Yy.cjs +0 -98
  408. package/dist/keystore-DgGRj2Yy.cjs.map +0 -1
  409. package/dist/openapi-Dcbme-Us.cjs +0 -2038
  410. package/dist/openapi-Dcbme-Us.cjs.map +0 -1
  411. package/dist/openapi-vy4JzhUv.mjs +0 -1991
  412. package/dist/openapi-vy4JzhUv.mjs.map +0 -1
  413. package/dist/storage-C-30BD1e.cjs +0 -272
  414. package/dist/storage-C-30BD1e.cjs.map +0 -1
  415. package/dist/storage-P_b3w7uj.mjs +0 -231
  416. package/dist/storage-P_b3w7uj.mjs.map +0 -1
  417. package/dist/sync-B3xxXtJT.mjs +0 -88
  418. package/dist/sync-B3xxXtJT.mjs.map +0 -1
  419. package/dist/sync-D7uTIIEi.cjs +0 -111
  420. package/dist/sync-D7uTIIEi.cjs.map +0 -1
  421. package/dist/types-BGo5TaNE.d.mts.map +0 -1
  422. package/dist/types-C5ZNpUad.d.cts.map +0 -1
  423. package/dist/workspace-CgwmXEtc.mjs.map +0 -1
  424. 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-BR_7hJTw.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-C-rs22Zv.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoDaddyProvider-C-rs22Zv.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,mBAAmB,OAAO,MAAM,OAAO,qBAAqB,SAAS,KAAK,WAAW,GAAG,yBAChE,MAAM,oNAI/B;EAXS,KAAA,SAAA;EACA,KAAA,SAAA;EACA,KAAA,QAAA;EACA,KAAA,SAAA;EAST,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,4BAAb,cAA+CA,eAAAA,SAAS;CAClC;CAArB,YAAY,MAAwB;EACnC,MACC,4CAA4C,OAAO,IAAI,SAAS,GAAG,kLAIpE;EANoB,KAAA,OAAA;EAOpB,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,wBAAb,cAA2CA,eAAAA,SAAS;CAEzC;CACA;CAFV,YACC,QACA,MACC;EACD,MACC,yBAAyB,OAAO,0BAA0B,OAAO,KAAK,KAAK,KAAK,GAAG,uGAEpF;EANS,KAAA,SAAA;EACA,KAAA,OAAA;EAMT,KAAK,OAAO;CACb;AACD;;AAGA,IAAa,qBAAb,cAAwCA,eAAAA,SAAS;CAEtC;CACA;CAFV,YACC,UACA,eACC;EACD,MACC,mDAAmD,SAAS,kFAEpD,gBAAgB,IAAI,cAAc,YAAY,YAAY,iEAEnE;EARS,KAAA,WAAA;EACA,KAAA,gBA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AM,UAA0B,CAAC;EACjC,KAAK,MAAM,UAAU,SAAS;GAC7B,MAAM,OAAO,OAAO;GACpB,IAAI,CAAC,KAAK,WAAW;IACpB,IAAI;IACJ,IAAI;KACH,WAAW,MAAM,IAAI,aAAa,QAAQ,MAAM,OAAO,IAAI;IAC5D,SAAS,OAAO;KACf,IAAI,CAAC,WAAW,KAAK,GAAG,MAAM;KAC9B,KAAK,YAAY;IAClB;IACA,IAAI,YAAY,SAAS,WAAW,GAAG;KACtC,QAAQ,KAAK;MAAE;MAAQ,SAAS;MAAO,UAAU;KAAK,CAAC;KACvD;IACD;GACD;GACA,IAAI;IACH,MAAM,IAAI,gBAAgB,QAAQ,MAAM,OAAO,IAAI;GACpD,SAAS,OAAO;IAEf,IAAI,KAAK,aAAa,iBAAiB,uBAAuB;KAC7D,QAAQ,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 { n as getHostingerToken } from "./index.mjs";
2
- //#region src/deploy/dns/hostinger-api.ts
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/deploy/dns/HostingerProvider.ts
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 Error("Hostinger API token not configured. Run `gkm login --service=hostinger` or get your token from https://hpanel.hostinger.com/profile/api");
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-BY26bWwB.mjs.map
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,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