@atlasauth/cli 0.25.0 → 0.26.0

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 (546) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +26 -5
  3. package/dist/args.d.ts +631 -0
  4. package/dist/args.js +304 -0
  5. package/dist/args.js.map +1 -0
  6. package/dist/cli.d.ts +2 -0
  7. package/dist/cli.js +19 -0
  8. package/dist/cli.js.map +1 -0
  9. package/dist/commands/actions-gallery.d.ts +8 -0
  10. package/dist/commands/actions-gallery.js +197 -0
  11. package/dist/commands/actions-gallery.js.map +1 -0
  12. package/dist/commands/actions.d.ts +13 -0
  13. package/dist/commands/actions.js +135 -0
  14. package/dist/commands/actions.js.map +1 -0
  15. package/dist/commands/admin.d.ts +49 -0
  16. package/dist/commands/admin.js +353 -0
  17. package/dist/commands/admin.js.map +1 -0
  18. package/dist/commands/api-keys.d.ts +4 -0
  19. package/dist/commands/api-keys.js +96 -0
  20. package/dist/commands/api-keys.js.map +1 -0
  21. package/dist/commands/auth.d.ts +25 -0
  22. package/dist/commands/auth.js +102 -0
  23. package/dist/commands/auth.js.map +1 -0
  24. package/dist/commands/config.d.ts +128 -0
  25. package/dist/commands/config.js +1822 -0
  26. package/dist/commands/config.js.map +1 -0
  27. package/dist/commands/csp.d.ts +32 -0
  28. package/dist/commands/csp.js +180 -0
  29. package/dist/commands/csp.js.map +1 -0
  30. package/dist/commands/dev.d.ts +8 -0
  31. package/dist/commands/dev.js +84 -0
  32. package/dist/commands/dev.js.map +1 -0
  33. package/dist/commands/doctor-scan.d.ts +27 -0
  34. package/dist/commands/doctor-scan.js +221 -0
  35. package/dist/commands/doctor-scan.js.map +1 -0
  36. package/dist/commands/fga.d.ts +10 -0
  37. package/dist/commands/fga.js +146 -0
  38. package/dist/commands/fga.js.map +1 -0
  39. package/dist/commands/golive.d.ts +40 -0
  40. package/dist/commands/golive.js +297 -0
  41. package/dist/commands/golive.js.map +1 -0
  42. package/dist/commands/id-accounts.d.ts +13 -0
  43. package/dist/commands/id-accounts.js +195 -0
  44. package/dist/commands/id-accounts.js.map +1 -0
  45. package/dist/commands/import-better-auth.d.ts +3 -0
  46. package/dist/commands/import-better-auth.js +164 -0
  47. package/dist/commands/import-better-auth.js.map +1 -0
  48. package/dist/commands/import-jsonl.d.ts +50 -0
  49. package/dist/commands/import-jsonl.js +252 -0
  50. package/dist/commands/import-jsonl.js.map +1 -0
  51. package/dist/commands/import.d.ts +3 -0
  52. package/dist/commands/import.js +133 -0
  53. package/dist/commands/import.js.map +1 -0
  54. package/dist/commands/info.d.ts +75 -0
  55. package/dist/commands/info.js +362 -0
  56. package/dist/commands/info.js.map +1 -0
  57. package/dist/commands/init-next.d.ts +4 -0
  58. package/dist/commands/init-next.js +86 -0
  59. package/dist/commands/init-next.js.map +1 -0
  60. package/dist/commands/init.d.ts +3 -0
  61. package/dist/commands/init.js +525 -0
  62. package/dist/commands/init.js.map +1 -0
  63. package/dist/commands/integrations.d.ts +8 -0
  64. package/dist/commands/integrations.js +112 -0
  65. package/dist/commands/integrations.js.map +1 -0
  66. package/dist/commands/listen.d.ts +17 -0
  67. package/dist/commands/listen.js +223 -0
  68. package/dist/commands/listen.js.map +1 -0
  69. package/dist/commands/mcp.d.ts +38 -0
  70. package/dist/commands/mcp.js +111 -0
  71. package/dist/commands/mcp.js.map +1 -0
  72. package/dist/commands/migrate.d.ts +16 -0
  73. package/dist/commands/migrate.js +114 -0
  74. package/dist/commands/migrate.js.map +1 -0
  75. package/dist/commands/move-origin.d.ts +11 -0
  76. package/dist/commands/move-origin.js +95 -0
  77. package/dist/commands/move-origin.js.map +1 -0
  78. package/dist/commands/operator.d.ts +18 -0
  79. package/dist/commands/operator.js +238 -0
  80. package/dist/commands/operator.js.map +1 -0
  81. package/dist/commands/orgs.d.ts +4 -0
  82. package/dist/commands/orgs.js +72 -0
  83. package/dist/commands/orgs.js.map +1 -0
  84. package/dist/commands/pages.d.ts +14 -0
  85. package/dist/commands/pages.js +113 -0
  86. package/dist/commands/pages.js.map +1 -0
  87. package/dist/commands/partner-platforms.d.ts +10 -0
  88. package/dist/commands/partner-platforms.js +157 -0
  89. package/dist/commands/partner-platforms.js.map +1 -0
  90. package/dist/commands/project-commands.d.ts +38 -0
  91. package/dist/commands/project-commands.js +431 -0
  92. package/dist/commands/project-commands.js.map +1 -0
  93. package/dist/commands/referrals.d.ts +69 -0
  94. package/dist/commands/referrals.js +1056 -0
  95. package/dist/commands/referrals.js.map +1 -0
  96. package/dist/commands/resources.d.ts +44 -0
  97. package/dist/commands/resources.js +234 -0
  98. package/dist/commands/resources.js.map +1 -0
  99. package/dist/commands/sessions.d.ts +4 -0
  100. package/dist/commands/sessions.js +28 -0
  101. package/dist/commands/sessions.js.map +1 -0
  102. package/dist/commands/setup-guide.d.ts +3 -0
  103. package/dist/commands/setup-guide.js +38 -0
  104. package/dist/commands/setup-guide.js.map +1 -0
  105. package/dist/commands/shared.d.ts +38 -0
  106. package/dist/commands/shared.js +69 -0
  107. package/dist/commands/shared.js.map +1 -0
  108. package/dist/commands/status.d.ts +3 -0
  109. package/dist/commands/status.js +77 -0
  110. package/dist/commands/status.js.map +1 -0
  111. package/dist/commands/users.d.ts +4 -0
  112. package/dist/commands/users.js +111 -0
  113. package/dist/commands/users.js.map +1 -0
  114. package/dist/commands/webhooks.d.ts +34 -0
  115. package/dist/commands/webhooks.js +301 -0
  116. package/dist/commands/webhooks.js.map +1 -0
  117. package/dist/config-http.d.ts +38 -0
  118. package/dist/config-http.js +70 -0
  119. package/dist/config-http.js.map +1 -0
  120. package/dist/config.d.ts +64 -0
  121. package/dist/config.js +69 -0
  122. package/dist/config.js.map +1 -0
  123. package/dist/context.d.ts +89 -0
  124. package/dist/context.js +32 -0
  125. package/dist/context.js.map +1 -0
  126. package/dist/define-config.d.ts +9 -0
  127. package/dist/define-config.js +8 -0
  128. package/dist/define-config.js.map +1 -0
  129. package/dist/errors.d.ts +15 -0
  130. package/dist/errors.js +25 -0
  131. package/dist/errors.js.map +1 -0
  132. package/dist/help.d.ts +8 -0
  133. package/dist/help.js +926 -0
  134. package/dist/help.js.map +1 -0
  135. package/dist/import/csv.d.ts +6 -0
  136. package/dist/import/csv.js +63 -0
  137. package/dist/import/csv.js.map +1 -0
  138. package/dist/import/vendors.d.ts +57 -0
  139. package/dist/import/vendors.js +568 -0
  140. package/dist/import/vendors.js.map +1 -0
  141. package/dist/index.d.ts +33 -0
  142. package/dist/index.js +81 -0
  143. package/dist/index.js.map +1 -0
  144. package/dist/io.d.ts +21 -0
  145. package/dist/io.js +28 -0
  146. package/dist/io.js.map +1 -0
  147. package/dist/migrate/appwrite/plugin.d.ts +2 -0
  148. package/dist/migrate/appwrite/plugin.js +103 -0
  149. package/dist/migrate/appwrite/plugin.js.map +1 -0
  150. package/dist/migrate/auth0/plugin.d.ts +2 -0
  151. package/dist/migrate/auth0/plugin.js +126 -0
  152. package/dist/migrate/auth0/plugin.js.map +1 -0
  153. package/dist/migrate/authentik/plugin.d.ts +2 -0
  154. package/dist/migrate/authentik/plugin.js +135 -0
  155. package/dist/migrate/authentik/plugin.js.map +1 -0
  156. package/dist/migrate/azure-ad-b2c/plugin.d.ts +8 -0
  157. package/dist/migrate/azure-ad-b2c/plugin.js +165 -0
  158. package/dist/migrate/azure-ad-b2c/plugin.js.map +1 -0
  159. package/dist/migrate/better-auth/integration.d.ts +59 -0
  160. package/dist/migrate/better-auth/integration.js +81 -0
  161. package/dist/migrate/better-auth/integration.js.map +1 -0
  162. package/dist/migrate/better-auth/orchestrator.d.ts +43 -0
  163. package/dist/migrate/better-auth/orchestrator.js +525 -0
  164. package/dist/migrate/better-auth/orchestrator.js.map +1 -0
  165. package/dist/migrate/better-auth/output.d.ts +20 -0
  166. package/dist/migrate/better-auth/output.js +146 -0
  167. package/dist/migrate/better-auth/output.js.map +1 -0
  168. package/dist/migrate/better-auth/translate.d.ts +77 -0
  169. package/dist/migrate/better-auth/translate.js +1989 -0
  170. package/dist/migrate/better-auth/translate.js.map +1 -0
  171. package/dist/migrate/clerk/plugin.d.ts +2 -0
  172. package/dist/migrate/clerk/plugin.js +76 -0
  173. package/dist/migrate/clerk/plugin.js.map +1 -0
  174. package/dist/migrate/cognito/plugin.d.ts +5 -0
  175. package/dist/migrate/cognito/plugin.js +170 -0
  176. package/dist/migrate/cognito/plugin.js.map +1 -0
  177. package/dist/migrate/corbado/plugin.d.ts +2 -0
  178. package/dist/migrate/corbado/plugin.js +63 -0
  179. package/dist/migrate/corbado/plugin.js.map +1 -0
  180. package/dist/migrate/descope/plugin.d.ts +2 -0
  181. package/dist/migrate/descope/plugin.js +83 -0
  182. package/dist/migrate/descope/plugin.js.map +1 -0
  183. package/dist/migrate/entra-external-id/plugin.d.ts +8 -0
  184. package/dist/migrate/entra-external-id/plugin.js +12 -0
  185. package/dist/migrate/entra-external-id/plugin.js.map +1 -0
  186. package/dist/migrate/export/appwrite-config.d.ts +28 -0
  187. package/dist/migrate/export/appwrite-config.js +170 -0
  188. package/dist/migrate/export/appwrite-config.js.map +1 -0
  189. package/dist/migrate/export/appwrite.d.ts +51 -0
  190. package/dist/migrate/export/appwrite.js +288 -0
  191. package/dist/migrate/export/appwrite.js.map +1 -0
  192. package/dist/migrate/export/auth0-config.d.ts +29 -0
  193. package/dist/migrate/export/auth0-config.js +249 -0
  194. package/dist/migrate/export/auth0-config.js.map +1 -0
  195. package/dist/migrate/export/auth0.d.ts +62 -0
  196. package/dist/migrate/export/auth0.js +575 -0
  197. package/dist/migrate/export/auth0.js.map +1 -0
  198. package/dist/migrate/export/authentik-config.d.ts +45 -0
  199. package/dist/migrate/export/authentik-config.js +357 -0
  200. package/dist/migrate/export/authentik-config.js.map +1 -0
  201. package/dist/migrate/export/authentik.d.ts +110 -0
  202. package/dist/migrate/export/authentik.js +838 -0
  203. package/dist/migrate/export/authentik.js.map +1 -0
  204. package/dist/migrate/export/azure-config.d.ts +58 -0
  205. package/dist/migrate/export/azure-config.js +344 -0
  206. package/dist/migrate/export/azure-config.js.map +1 -0
  207. package/dist/migrate/export/azure.d.ts +85 -0
  208. package/dist/migrate/export/azure.js +373 -0
  209. package/dist/migrate/export/azure.js.map +1 -0
  210. package/dist/migrate/export/clerk-config.d.ts +26 -0
  211. package/dist/migrate/export/clerk-config.js +227 -0
  212. package/dist/migrate/export/clerk-config.js.map +1 -0
  213. package/dist/migrate/export/clerk.d.ts +46 -0
  214. package/dist/migrate/export/clerk.js +486 -0
  215. package/dist/migrate/export/clerk.js.map +1 -0
  216. package/dist/migrate/export/cognito-config.d.ts +25 -0
  217. package/dist/migrate/export/cognito-config.js +273 -0
  218. package/dist/migrate/export/cognito-config.js.map +1 -0
  219. package/dist/migrate/export/cognito.d.ts +103 -0
  220. package/dist/migrate/export/cognito.js +441 -0
  221. package/dist/migrate/export/cognito.js.map +1 -0
  222. package/dist/migrate/export/corbado-config.d.ts +20 -0
  223. package/dist/migrate/export/corbado-config.js +63 -0
  224. package/dist/migrate/export/corbado-config.js.map +1 -0
  225. package/dist/migrate/export/corbado.d.ts +37 -0
  226. package/dist/migrate/export/corbado.js +132 -0
  227. package/dist/migrate/export/corbado.js.map +1 -0
  228. package/dist/migrate/export/descope.d.ts +35 -0
  229. package/dist/migrate/export/descope.js +208 -0
  230. package/dist/migrate/export/descope.js.map +1 -0
  231. package/dist/migrate/export/fake-vendor.test-helper.d.ts +27 -0
  232. package/dist/migrate/export/fake-vendor.test-helper.js +41 -0
  233. package/dist/migrate/export/fake-vendor.test-helper.js.map +1 -0
  234. package/dist/migrate/export/firebase-config.d.ts +24 -0
  235. package/dist/migrate/export/firebase-config.js +215 -0
  236. package/dist/migrate/export/firebase-config.js.map +1 -0
  237. package/dist/migrate/export/firebase.d.ts +102 -0
  238. package/dist/migrate/export/firebase.js +464 -0
  239. package/dist/migrate/export/firebase.js.map +1 -0
  240. package/dist/migrate/export/frameworks/app-users.d.ts +42 -0
  241. package/dist/migrate/export/frameworks/app-users.js +161 -0
  242. package/dist/migrate/export/frameworks/app-users.js.map +1 -0
  243. package/dist/migrate/export/frameworks/authjs.d.ts +41 -0
  244. package/dist/migrate/export/frameworks/authjs.js +146 -0
  245. package/dist/migrate/export/frameworks/authjs.js.map +1 -0
  246. package/dist/migrate/export/frameworks/devise.d.ts +39 -0
  247. package/dist/migrate/export/frameworks/devise.js +218 -0
  248. package/dist/migrate/export/frameworks/devise.js.map +1 -0
  249. package/dist/migrate/export/frameworks/django.d.ts +45 -0
  250. package/dist/migrate/export/frameworks/django.js +315 -0
  251. package/dist/migrate/export/frameworks/django.js.map +1 -0
  252. package/dist/migrate/export/frameworks/lucia.d.ts +42 -0
  253. package/dist/migrate/export/frameworks/lucia.js +263 -0
  254. package/dist/migrate/export/frameworks/lucia.js.map +1 -0
  255. package/dist/migrate/export/frameworks/tables.d.ts +90 -0
  256. package/dist/migrate/export/frameworks/tables.js +325 -0
  257. package/dist/migrate/export/frameworks/tables.js.map +1 -0
  258. package/dist/migrate/export/frameworks/webauthn.d.ts +25 -0
  259. package/dist/migrate/export/frameworks/webauthn.js +130 -0
  260. package/dist/migrate/export/frameworks/webauthn.js.map +1 -0
  261. package/dist/migrate/export/frontegg-config.d.ts +29 -0
  262. package/dist/migrate/export/frontegg-config.js +238 -0
  263. package/dist/migrate/export/frontegg-config.js.map +1 -0
  264. package/dist/migrate/export/frontegg.d.ts +67 -0
  265. package/dist/migrate/export/frontegg.js +410 -0
  266. package/dist/migrate/export/frontegg.js.map +1 -0
  267. package/dist/migrate/export/fusionauth-config.d.ts +26 -0
  268. package/dist/migrate/export/fusionauth-config.js +226 -0
  269. package/dist/migrate/export/fusionauth-config.js.map +1 -0
  270. package/dist/migrate/export/fusionauth.d.ts +99 -0
  271. package/dist/migrate/export/fusionauth.js +642 -0
  272. package/dist/migrate/export/fusionauth.js.map +1 -0
  273. package/dist/migrate/export/hanko-config.d.ts +27 -0
  274. package/dist/migrate/export/hanko-config.js +265 -0
  275. package/dist/migrate/export/hanko-config.js.map +1 -0
  276. package/dist/migrate/export/hanko.d.ts +52 -0
  277. package/dist/migrate/export/hanko.js +605 -0
  278. package/dist/migrate/export/hanko.js.map +1 -0
  279. package/dist/migrate/export/keycloak-config.d.ts +19 -0
  280. package/dist/migrate/export/keycloak-config.js +219 -0
  281. package/dist/migrate/export/keycloak-config.js.map +1 -0
  282. package/dist/migrate/export/keycloak.d.ts +155 -0
  283. package/dist/migrate/export/keycloak.js +878 -0
  284. package/dist/migrate/export/keycloak.js.map +1 -0
  285. package/dist/migrate/export/kinde-descope-config.d.ts +38 -0
  286. package/dist/migrate/export/kinde-descope-config.js +172 -0
  287. package/dist/migrate/export/kinde-descope-config.js.map +1 -0
  288. package/dist/migrate/export/kinde.d.ts +57 -0
  289. package/dist/migrate/export/kinde.js +333 -0
  290. package/dist/migrate/export/kinde.js.map +1 -0
  291. package/dist/migrate/export/ldap.d.ts +53 -0
  292. package/dist/migrate/export/ldap.js +277 -0
  293. package/dist/migrate/export/ldap.js.map +1 -0
  294. package/dist/migrate/export/logto-config.d.ts +27 -0
  295. package/dist/migrate/export/logto-config.js +264 -0
  296. package/dist/migrate/export/logto-config.js.map +1 -0
  297. package/dist/migrate/export/logto.d.ts +150 -0
  298. package/dist/migrate/export/logto.js +809 -0
  299. package/dist/migrate/export/logto.js.map +1 -0
  300. package/dist/migrate/export/magic-config.d.ts +14 -0
  301. package/dist/migrate/export/magic-config.js +28 -0
  302. package/dist/migrate/export/magic-config.js.map +1 -0
  303. package/dist/migrate/export/magic.d.ts +31 -0
  304. package/dist/migrate/export/magic.js +93 -0
  305. package/dist/migrate/export/magic.js.map +1 -0
  306. package/dist/migrate/export/mini-yaml.d.ts +19 -0
  307. package/dist/migrate/export/mini-yaml.js +581 -0
  308. package/dist/migrate/export/mini-yaml.js.map +1 -0
  309. package/dist/migrate/export/nhost-config.d.ts +26 -0
  310. package/dist/migrate/export/nhost-config.js +360 -0
  311. package/dist/migrate/export/nhost-config.js.map +1 -0
  312. package/dist/migrate/export/nhost.d.ts +64 -0
  313. package/dist/migrate/export/nhost.js +304 -0
  314. package/dist/migrate/export/nhost.js.map +1 -0
  315. package/dist/migrate/export/okta-config.d.ts +30 -0
  316. package/dist/migrate/export/okta-config.js +205 -0
  317. package/dist/migrate/export/okta-config.js.map +1 -0
  318. package/dist/migrate/export/okta.d.ts +43 -0
  319. package/dist/migrate/export/okta.js +337 -0
  320. package/dist/migrate/export/okta.js.map +1 -0
  321. package/dist/migrate/export/onelogin.d.ts +22 -0
  322. package/dist/migrate/export/onelogin.js +123 -0
  323. package/dist/migrate/export/onelogin.js.map +1 -0
  324. package/dist/migrate/export/ory-config.d.ts +58 -0
  325. package/dist/migrate/export/ory-config.js +451 -0
  326. package/dist/migrate/export/ory-config.js.map +1 -0
  327. package/dist/migrate/export/ory.d.ts +81 -0
  328. package/dist/migrate/export/ory.js +555 -0
  329. package/dist/migrate/export/ory.js.map +1 -0
  330. package/dist/migrate/export/password-detect.d.ts +29 -0
  331. package/dist/migrate/export/password-detect.js +81 -0
  332. package/dist/migrate/export/password-detect.js.map +1 -0
  333. package/dist/migrate/export/pingone.d.ts +36 -0
  334. package/dist/migrate/export/pingone.js +218 -0
  335. package/dist/migrate/export/pingone.js.map +1 -0
  336. package/dist/migrate/export/plugin-kit.d.ts +25 -0
  337. package/dist/migrate/export/plugin-kit.js +82 -0
  338. package/dist/migrate/export/plugin-kit.js.map +1 -0
  339. package/dist/migrate/export/pocketbase-config.d.ts +28 -0
  340. package/dist/migrate/export/pocketbase-config.js +180 -0
  341. package/dist/migrate/export/pocketbase-config.js.map +1 -0
  342. package/dist/migrate/export/pocketbase.d.ts +52 -0
  343. package/dist/migrate/export/pocketbase.js +243 -0
  344. package/dist/migrate/export/pocketbase.js.map +1 -0
  345. package/dist/migrate/export/project-files.d.ts +15 -0
  346. package/dist/migrate/export/project-files.js +43 -0
  347. package/dist/migrate/export/project-files.js.map +1 -0
  348. package/dist/migrate/export/propelauth-config.d.ts +18 -0
  349. package/dist/migrate/export/propelauth-config.js +58 -0
  350. package/dist/migrate/export/propelauth-config.js.map +1 -0
  351. package/dist/migrate/export/propelauth-harness.test-helper.d.ts +62 -0
  352. package/dist/migrate/export/propelauth-harness.test-helper.js +109 -0
  353. package/dist/migrate/export/propelauth-harness.test-helper.js.map +1 -0
  354. package/dist/migrate/export/propelauth.d.ts +48 -0
  355. package/dist/migrate/export/propelauth.js +255 -0
  356. package/dist/migrate/export/propelauth.js.map +1 -0
  357. package/dist/migrate/export/record-set.d.ts +44 -0
  358. package/dist/migrate/export/record-set.js +98 -0
  359. package/dist/migrate/export/record-set.js.map +1 -0
  360. package/dist/migrate/export/source-lines.d.ts +17 -0
  361. package/dist/migrate/export/source-lines.js +43 -0
  362. package/dist/migrate/export/source-lines.js.map +1 -0
  363. package/dist/migrate/export/sso-metadata.d.ts +47 -0
  364. package/dist/migrate/export/sso-metadata.js +180 -0
  365. package/dist/migrate/export/sso-metadata.js.map +1 -0
  366. package/dist/migrate/export/stytch-config.d.ts +22 -0
  367. package/dist/migrate/export/stytch-config.js +102 -0
  368. package/dist/migrate/export/stytch-config.js.map +1 -0
  369. package/dist/migrate/export/stytch.d.ts +68 -0
  370. package/dist/migrate/export/stytch.js +510 -0
  371. package/dist/migrate/export/stytch.js.map +1 -0
  372. package/dist/migrate/export/supabase-config.d.ts +48 -0
  373. package/dist/migrate/export/supabase-config.js +408 -0
  374. package/dist/migrate/export/supabase-config.js.map +1 -0
  375. package/dist/migrate/export/supabase.d.ts +86 -0
  376. package/dist/migrate/export/supabase.js +524 -0
  377. package/dist/migrate/export/supabase.js.map +1 -0
  378. package/dist/migrate/export/supertokens-config.d.ts +20 -0
  379. package/dist/migrate/export/supertokens-config.js +150 -0
  380. package/dist/migrate/export/supertokens-config.js.map +1 -0
  381. package/dist/migrate/export/supertokens.d.ts +125 -0
  382. package/dist/migrate/export/supertokens.js +464 -0
  383. package/dist/migrate/export/supertokens.js.map +1 -0
  384. package/dist/migrate/export/table.d.ts +35 -0
  385. package/dist/migrate/export/table.js +248 -0
  386. package/dist/migrate/export/table.js.map +1 -0
  387. package/dist/migrate/export/translate-kit.d.ts +46 -0
  388. package/dist/migrate/export/translate-kit.js +148 -0
  389. package/dist/migrate/export/translate-kit.js.map +1 -0
  390. package/dist/migrate/export/userfront-config.d.ts +15 -0
  391. package/dist/migrate/export/userfront-config.js +49 -0
  392. package/dist/migrate/export/userfront-config.js.map +1 -0
  393. package/dist/migrate/export/userfront.d.ts +38 -0
  394. package/dist/migrate/export/userfront.js +189 -0
  395. package/dist/migrate/export/userfront.js.map +1 -0
  396. package/dist/migrate/export/vendor-http.d.ts +46 -0
  397. package/dist/migrate/export/vendor-http.js +138 -0
  398. package/dist/migrate/export/vendor-http.js.map +1 -0
  399. package/dist/migrate/export/workos-config.d.ts +23 -0
  400. package/dist/migrate/export/workos-config.js +125 -0
  401. package/dist/migrate/export/workos-config.js.map +1 -0
  402. package/dist/migrate/export/workos.d.ts +46 -0
  403. package/dist/migrate/export/workos.js +272 -0
  404. package/dist/migrate/export/workos.js.map +1 -0
  405. package/dist/migrate/export/zip.d.ts +8 -0
  406. package/dist/migrate/export/zip.js +66 -0
  407. package/dist/migrate/export/zip.js.map +1 -0
  408. package/dist/migrate/export/zitadel-config.d.ts +37 -0
  409. package/dist/migrate/export/zitadel-config.js +279 -0
  410. package/dist/migrate/export/zitadel-config.js.map +1 -0
  411. package/dist/migrate/export/zitadel.d.ts +82 -0
  412. package/dist/migrate/export/zitadel.js +447 -0
  413. package/dist/migrate/export/zitadel.js.map +1 -0
  414. package/dist/migrate/firebase/plugin.d.ts +2 -0
  415. package/dist/migrate/firebase/plugin.js +152 -0
  416. package/dist/migrate/firebase/plugin.js.map +1 -0
  417. package/dist/migrate/framework/builtins.d.ts +2 -0
  418. package/dist/migrate/framework/builtins.js +52 -0
  419. package/dist/migrate/framework/builtins.js.map +1 -0
  420. package/dist/migrate/framework/commands.d.ts +20 -0
  421. package/dist/migrate/framework/commands.js +58 -0
  422. package/dist/migrate/framework/commands.js.map +1 -0
  423. package/dist/migrate/framework/custom.d.ts +12 -0
  424. package/dist/migrate/framework/custom.js +96 -0
  425. package/dist/migrate/framework/custom.js.map +1 -0
  426. package/dist/migrate/framework/orchestrator.d.ts +113 -0
  427. package/dist/migrate/framework/orchestrator.js +532 -0
  428. package/dist/migrate/framework/orchestrator.js.map +1 -0
  429. package/dist/migrate/framework/plugin.d.ts +167 -0
  430. package/dist/migrate/framework/plugin.js +3 -0
  431. package/dist/migrate/framework/plugin.js.map +1 -0
  432. package/dist/migrate/framework/registry.d.ts +11 -0
  433. package/dist/migrate/framework/registry.js +44 -0
  434. package/dist/migrate/framework/registry.js.map +1 -0
  435. package/dist/migrate/framework/report.d.ts +17 -0
  436. package/dist/migrate/framework/report.js +103 -0
  437. package/dist/migrate/framework/report.js.map +1 -0
  438. package/dist/migrate/frameworks/plugins.d.ts +29 -0
  439. package/dist/migrate/frameworks/plugins.js +402 -0
  440. package/dist/migrate/frameworks/plugins.js.map +1 -0
  441. package/dist/migrate/frameworks/report.d.ts +92 -0
  442. package/dist/migrate/frameworks/report.js +207 -0
  443. package/dist/migrate/frameworks/report.js.map +1 -0
  444. package/dist/migrate/frameworks/translate-js.d.ts +5 -0
  445. package/dist/migrate/frameworks/translate-js.js +503 -0
  446. package/dist/migrate/frameworks/translate-js.js.map +1 -0
  447. package/dist/migrate/frameworks/translate-rails-django.d.ts +3 -0
  448. package/dist/migrate/frameworks/translate-rails-django.js +1391 -0
  449. package/dist/migrate/frameworks/translate-rails-django.js.map +1 -0
  450. package/dist/migrate/frontegg/plugin.d.ts +2 -0
  451. package/dist/migrate/frontegg/plugin.js +78 -0
  452. package/dist/migrate/frontegg/plugin.js.map +1 -0
  453. package/dist/migrate/fusionauth/plugin.d.ts +2 -0
  454. package/dist/migrate/fusionauth/plugin.js +109 -0
  455. package/dist/migrate/fusionauth/plugin.js.map +1 -0
  456. package/dist/migrate/hanko/plugin.d.ts +2 -0
  457. package/dist/migrate/hanko/plugin.js +100 -0
  458. package/dist/migrate/hanko/plugin.js.map +1 -0
  459. package/dist/migrate/keycloak/plugin.d.ts +2 -0
  460. package/dist/migrate/keycloak/plugin.js +148 -0
  461. package/dist/migrate/keycloak/plugin.js.map +1 -0
  462. package/dist/migrate/kinde/plugin.d.ts +2 -0
  463. package/dist/migrate/kinde/plugin.js +105 -0
  464. package/dist/migrate/kinde/plugin.js.map +1 -0
  465. package/dist/migrate/ldap/plugin.d.ts +2 -0
  466. package/dist/migrate/ldap/plugin.js +73 -0
  467. package/dist/migrate/ldap/plugin.js.map +1 -0
  468. package/dist/migrate/logto/plugin.d.ts +2 -0
  469. package/dist/migrate/logto/plugin.js +131 -0
  470. package/dist/migrate/logto/plugin.js.map +1 -0
  471. package/dist/migrate/magic/plugin.d.ts +2 -0
  472. package/dist/migrate/magic/plugin.js +56 -0
  473. package/dist/migrate/magic/plugin.js.map +1 -0
  474. package/dist/migrate/nhost/plugin.d.ts +2 -0
  475. package/dist/migrate/nhost/plugin.js +115 -0
  476. package/dist/migrate/nhost/plugin.js.map +1 -0
  477. package/dist/migrate/oidc/plugin.d.ts +2 -0
  478. package/dist/migrate/oidc/plugin.js +73 -0
  479. package/dist/migrate/oidc/plugin.js.map +1 -0
  480. package/dist/migrate/okta/plugin.d.ts +2 -0
  481. package/dist/migrate/okta/plugin.js +105 -0
  482. package/dist/migrate/okta/plugin.js.map +1 -0
  483. package/dist/migrate/onelogin/plugin.d.ts +2 -0
  484. package/dist/migrate/onelogin/plugin.js +61 -0
  485. package/dist/migrate/onelogin/plugin.js.map +1 -0
  486. package/dist/migrate/ory/plugin.d.ts +2 -0
  487. package/dist/migrate/ory/plugin.js +186 -0
  488. package/dist/migrate/ory/plugin.js.map +1 -0
  489. package/dist/migrate/ping-identity/plugin.d.ts +2 -0
  490. package/dist/migrate/ping-identity/plugin.js +100 -0
  491. package/dist/migrate/ping-identity/plugin.js.map +1 -0
  492. package/dist/migrate/pocketbase/plugin.d.ts +2 -0
  493. package/dist/migrate/pocketbase/plugin.js +99 -0
  494. package/dist/migrate/pocketbase/plugin.js.map +1 -0
  495. package/dist/migrate/propelauth/plugin.d.ts +2 -0
  496. package/dist/migrate/propelauth/plugin.js +65 -0
  497. package/dist/migrate/propelauth/plugin.js.map +1 -0
  498. package/dist/migrate/saml/plugin.d.ts +2 -0
  499. package/dist/migrate/saml/plugin.js +79 -0
  500. package/dist/migrate/saml/plugin.js.map +1 -0
  501. package/dist/migrate/stytch/plugin.d.ts +2 -0
  502. package/dist/migrate/stytch/plugin.js +97 -0
  503. package/dist/migrate/stytch/plugin.js.map +1 -0
  504. package/dist/migrate/supabase/plugin.d.ts +2 -0
  505. package/dist/migrate/supabase/plugin.js +149 -0
  506. package/dist/migrate/supabase/plugin.js.map +1 -0
  507. package/dist/migrate/supertokens/plugin.d.ts +2 -0
  508. package/dist/migrate/supertokens/plugin.js +114 -0
  509. package/dist/migrate/supertokens/plugin.js.map +1 -0
  510. package/dist/migrate/user-table/plugin.d.ts +2 -0
  511. package/dist/migrate/user-table/plugin.js +62 -0
  512. package/dist/migrate/user-table/plugin.js.map +1 -0
  513. package/dist/migrate/userfront/plugin.d.ts +2 -0
  514. package/dist/migrate/userfront/plugin.js +60 -0
  515. package/dist/migrate/userfront/plugin.js.map +1 -0
  516. package/dist/migrate/workos/plugin.d.ts +2 -0
  517. package/dist/migrate/workos/plugin.js +81 -0
  518. package/dist/migrate/workos/plugin.js.map +1 -0
  519. package/dist/migrate/zitadel/plugin.d.ts +2 -0
  520. package/dist/migrate/zitadel/plugin.js +114 -0
  521. package/dist/migrate/zitadel/plugin.js.map +1 -0
  522. package/dist/output.d.ts +41 -0
  523. package/dist/output.js +72 -0
  524. package/dist/output.js.map +1 -0
  525. package/dist/project.d.ts +64 -0
  526. package/dist/project.js +86 -0
  527. package/dist/project.js.map +1 -0
  528. package/dist/prompt.d.ts +15 -0
  529. package/dist/prompt.js +46 -0
  530. package/dist/prompt.js.map +1 -0
  531. package/dist/redact.d.ts +41 -0
  532. package/dist/redact.js +115 -0
  533. package/dist/redact.js.map +1 -0
  534. package/dist/run.d.ts +12 -0
  535. package/dist/run.js +169 -0
  536. package/dist/run.js.map +1 -0
  537. package/dist/secrets.d.ts +41 -0
  538. package/dist/secrets.js +142 -0
  539. package/dist/secrets.js.map +1 -0
  540. package/dist/serialize.d.ts +30 -0
  541. package/dist/serialize.js +131 -0
  542. package/dist/serialize.js.map +1 -0
  543. package/dist/version.d.ts +7 -0
  544. package/dist/version.js +21 -0
  545. package/dist/version.js.map +1 -0
  546. package/package.json +3 -3
package/dist/run.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { type ParsedArgs } from './args';
2
+ import { type RunContext } from './context';
3
+ /** A command handler: given the context and parsed args, do the work; return an exit code. */
4
+ export type Handler = (ctx: RunContext, args: ParsedArgs) => Promise<number>;
5
+ /**
6
+ * The CLI's whole control flow, as a pure function of (argv, context) → exit
7
+ * code. It NEVER calls `process.exit` and NEVER throws: the bin calls it and
8
+ * exits with what it returns, and every test drives this same path with a
9
+ * captured IO. All error reporting funnels through the one try/catch so a user
10
+ * sees a clean message and a non-zero code — never a stack trace.
11
+ */
12
+ export declare function run(argv: string[], rawCtx: RunContext): Promise<number>;
package/dist/run.js ADDED
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.run = run;
4
+ const backend_1 = require("@atlasauth/backend");
5
+ const args_1 = require("./args");
6
+ const actions_1 = require("./commands/actions");
7
+ const pages_1 = require("./commands/pages");
8
+ const api_keys_1 = require("./commands/api-keys");
9
+ const auth_1 = require("./commands/auth");
10
+ const operator_1 = require("./commands/operator");
11
+ const config_1 = require("./commands/config");
12
+ const init_1 = require("./commands/init");
13
+ const golive_1 = require("./commands/golive");
14
+ const import_1 = require("./commands/import");
15
+ const info_1 = require("./commands/info");
16
+ const csp_1 = require("./commands/csp");
17
+ const fga_1 = require("./commands/fga");
18
+ const dev_1 = require("./commands/dev");
19
+ const listen_1 = require("./commands/listen");
20
+ const migrate_1 = require("./commands/migrate");
21
+ const move_origin_1 = require("./commands/move-origin");
22
+ const mcp_1 = require("./commands/mcp");
23
+ const project_commands_1 = require("./commands/project-commands");
24
+ const orgs_1 = require("./commands/orgs");
25
+ const referrals_1 = require("./commands/referrals");
26
+ const sessions_1 = require("./commands/sessions");
27
+ const status_1 = require("./commands/status");
28
+ const users_1 = require("./commands/users");
29
+ const webhooks_1 = require("./commands/webhooks");
30
+ const integrations_1 = require("./commands/integrations");
31
+ const id_accounts_1 = require("./commands/id-accounts");
32
+ const admin_1 = require("./commands/admin");
33
+ const partner_platforms_1 = require("./commands/partner-platforms");
34
+ const resources_1 = require("./commands/resources");
35
+ const context_1 = require("./context");
36
+ const errors_1 = require("./errors");
37
+ const help_1 = require("./help");
38
+ const redact_1 = require("./redact");
39
+ const setup_guide_1 = require("./commands/setup-guide");
40
+ const version_1 = require("./version");
41
+ /** The command table — the single place every top-level command is registered. */
42
+ const COMMANDS = {
43
+ login: auth_1.login,
44
+ logout: auth_1.logout,
45
+ whoami: auth_1.whoami,
46
+ token: operator_1.token,
47
+ keys: operator_1.keys,
48
+ users: users_1.users,
49
+ orgs: orgs_1.orgs,
50
+ 'api-keys': api_keys_1.apiKeys,
51
+ webhooks: webhooks_1.webhooks,
52
+ integrations: integrations_1.integrations,
53
+ 'partner-platforms': partner_platforms_1.partnerPlatforms,
54
+ 'id-accounts': id_accounts_1.idAccounts,
55
+ admin: admin_1.admin,
56
+ sessions: sessions_1.sessions,
57
+ config: config_1.config,
58
+ plan: config_1.planCommand,
59
+ apply: config_1.applyCommand,
60
+ actions: actions_1.actions,
61
+ pages: pages_1.pages,
62
+ init: init_1.init,
63
+ 'setup-guide': setup_guide_1.setupGuide,
64
+ preflight: project_commands_1.preflight,
65
+ doctor: project_commands_1.doctor,
66
+ golive: golive_1.golive,
67
+ env: project_commands_1.envCommand,
68
+ client: project_commands_1.client,
69
+ referrals: referrals_1.referrals,
70
+ status: status_1.status,
71
+ import: import_1.importUsers,
72
+ migrate: migrate_1.migrate,
73
+ info: info_1.info,
74
+ mcp: mcp_1.mcp,
75
+ listen: listen_1.listen,
76
+ dev: dev_1.dev,
77
+ 'move-origin': move_origin_1.moveOrigin,
78
+ csp: csp_1.csp,
79
+ fga: fga_1.fga,
80
+ workflows: (0, resources_1.resourceCommand)('workflows', resources_1.WORKFLOWS),
81
+ chat: (0, resources_1.resourceCommand)('chat', resources_1.CHAT),
82
+ cloud: (0, resources_1.resourceCommand)('cloud', resources_1.CLOUD),
83
+ 'saml-idp': (0, resources_1.resourceCommand)('saml-idp', resources_1.SAML_IDP),
84
+ provisioning: (0, resources_1.resourceCommand)('provisioning', resources_1.PROVISIONING),
85
+ catalog: (0, resources_1.resourceCommand)('catalog', resources_1.CATALOG),
86
+ 'device-sso': (0, resources_1.resourceCommand)('device-sso', resources_1.DEVICE_SSO),
87
+ 'connection-actions': (0, resources_1.resourceCommand)('connection-actions', resources_1.CONNECTION_ACTIONS),
88
+ triggers: (0, resources_1.resourceCommand)('triggers', resources_1.TRIGGERS),
89
+ agents: (0, resources_1.resourceCommand)('agents', resources_1.AGENTS),
90
+ telemetry: (0, resources_1.resourceCommand)('telemetry', resources_1.TELEMETRY),
91
+ pdp: (0, resources_1.resourceCommand)('pdp', resources_1.PDP),
92
+ billing: (0, resources_1.resourceCommand)('billing', resources_1.BILLING),
93
+ audit: (0, resources_1.resourceCommand)('audit', resources_1.AUDIT),
94
+ federation: (0, resources_1.resourceCommand)('federation', resources_1.FEDERATION),
95
+ vc: (0, resources_1.resourceCommand)('vc', resources_1.VC),
96
+ };
97
+ /**
98
+ * The CLI's whole control flow, as a pure function of (argv, context) → exit
99
+ * code. It NEVER calls `process.exit` and NEVER throws: the bin calls it and
100
+ * exits with what it returns, and every test drives this same path with a
101
+ * captured IO. All error reporting funnels through the one try/catch so a user
102
+ * sees a clean message and a non-zero code — never a stack trace.
103
+ */
104
+ async function run(argv, rawCtx) {
105
+ (0, redact_1.resetRedaction)();
106
+ const ctx = { ...rawCtx, io: (0, redact_1.scrubbingIO)(rawCtx.io) };
107
+ let args;
108
+ try {
109
+ args = (0, args_1.parse)(argv);
110
+ }
111
+ catch (err) {
112
+ return report(ctx, err);
113
+ }
114
+ // --version wins over everything, like most CLIs.
115
+ if (args.values.version) {
116
+ ctx.io.out((0, version_1.getVersion)());
117
+ return 0;
118
+ }
119
+ if (args.values['show-secrets']) {
120
+ if (!(0, context_1.ttyOf)(ctx).stdout || ctx.env.CI) {
121
+ return report(ctx, new errors_1.CliError('--show-secrets needs a terminal: it is refused when stdout is not a TTY or CI is set.'));
122
+ }
123
+ (0, redact_1.setRevealSecrets)(true);
124
+ }
125
+ const command = args.positionals[0];
126
+ // Bare `atlas` or `atlas --help`: top-level help on stdout, success.
127
+ if (!command) {
128
+ ctx.io.out(help_1.TOP_HELP);
129
+ return 0;
130
+ }
131
+ const handler = COMMANDS[command];
132
+ if (!handler) {
133
+ ctx.io.err(`Unknown command '${command}'.`);
134
+ ctx.io.err("Run 'atlas --help' to see available commands.");
135
+ return 1;
136
+ }
137
+ // `atlas <command> --help`: command-specific help on stdout, success.
138
+ if (args.values.help) {
139
+ ctx.io.out(help_1.COMMAND_HELP[command] ?? help_1.TOP_HELP);
140
+ return 0;
141
+ }
142
+ try {
143
+ return await handler(ctx, args);
144
+ }
145
+ catch (err) {
146
+ return report(ctx, err);
147
+ }
148
+ }
149
+ /**
150
+ * Turn any thrown error into a clean stderr message + exit code. An
151
+ * {@link AtlasApiError} keeps its HTTP status and stable `code` so the user can
152
+ * act on it; a {@link CliError} carries its own code; anything else is an
153
+ * unexpected bug reported as its message (still no stack).
154
+ */
155
+ function report(ctx, err) {
156
+ if (err instanceof backend_1.AtlasApiError) {
157
+ const code = err.code ? ` [${err.code}]` : '';
158
+ ctx.io.err(`atlas: API error (HTTP ${err.status})${code}: ${(0, redact_1.scrubText)(err.message)}`);
159
+ return 1;
160
+ }
161
+ if (err instanceof errors_1.CliError) {
162
+ ctx.io.err(`atlas: ${(0, redact_1.scrubText)(err.message)}`);
163
+ return err.exitCode;
164
+ }
165
+ const message = err instanceof Error ? err.message : String(err);
166
+ ctx.io.err(`atlas: ${(0, redact_1.scrubText)(message)}`);
167
+ return 1;
168
+ }
169
+ //# sourceMappingURL=run.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":";;AA4GA,kBAiDC;AA7JD,gDAAmD;AACnD,iCAAgD;AAChD,gDAA6C;AAC7C,4CAAyC;AACzC,kDAA8C;AAC9C,0CAAwD;AACxD,kDAAkD;AAClD,8CAAsE;AACtE,0CAAuC;AACvC,8CAA2C;AAC3C,8CAAgD;AAChD,0CAAuC;AACvC,wCAAqC;AACrC,wCAAqC;AACrC,wCAAqC;AACrC,8CAA2C;AAC3C,gDAA6C;AAC7C,wDAAoD;AACpD,wCAAqC;AACrC,kEAAoF;AACpF,0CAAuC;AACvC,oDAAiD;AACjD,kDAA+C;AAC/C,8CAA2C;AAC3C,4CAAyC;AACzC,kDAA+C;AAC/C,0DAAuD;AACvD,wDAAoD;AACpD,4CAAyC;AACzC,oEAAgE;AAChE,oDAG8B;AAC9B,uCAAmD;AACnD,qCAAoC;AACpC,iCAAgD;AAChD,qCAAoF;AACpF,wDAAoD;AACpD,uCAAuC;AAKvC,kFAAkF;AAClF,MAAM,QAAQ,GAA4B;IACxC,KAAK,EAAL,YAAK;IACL,MAAM,EAAN,aAAM;IACN,MAAM,EAAN,aAAM;IACN,KAAK,EAAL,gBAAK;IACL,IAAI,EAAJ,eAAI;IACJ,KAAK,EAAL,aAAK;IACL,IAAI,EAAJ,WAAI;IACJ,UAAU,EAAE,kBAAO;IACnB,QAAQ,EAAR,mBAAQ;IACR,YAAY,EAAZ,2BAAY;IACZ,mBAAmB,EAAE,oCAAgB;IACrC,aAAa,EAAE,wBAAU;IACzB,KAAK,EAAL,aAAK;IACL,QAAQ,EAAR,mBAAQ;IACR,MAAM,EAAN,eAAM;IACN,IAAI,EAAE,oBAAW;IACjB,KA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;IACX,CAAC;IACD,IAAI,GAAG,YAAY,iBAAQ,EAAE,CAAC;QAC5B,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,IAAA,kBAAS,EAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC/C,OAAO,GAAG,CAAC,QAAQ,CAAC;IACtB,CAAC;IACD,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACjE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,UAAU,IAAA,kBAAS,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC3C,OAAO,CAAC,CAAC;AACX,CAAC"}
@@ -0,0 +1,41 @@
1
+ import type { IO } from './io';
2
+ export declare function assertProductName(product: string): string;
3
+ /** `$XDG_CONFIG_HOME/<product>` (default `~/.config/<product>`). */
4
+ export declare function productDir(env: NodeJS.ProcessEnv, product: string): string;
5
+ export declare function renderDotenv(entries: Record<string, string>, comment?: string): string;
6
+ /** Parse a dotenv file this CLI wrote (KEY=value lines, `#` comments). */
7
+ export declare function parseDotenv(text: string): Record<string, string>;
8
+ /**
9
+ * Write a 0600 dotenv file inside a 0700 directory. Refuses an existing file
10
+ * unless `force` (the same content is not a conflict: a re-run is a no-op).
11
+ * Returns the path.
12
+ */
13
+ export declare function writeSecretFile(dir: string, fileName: string, entries: Record<string, string>, opts?: {
14
+ force?: boolean;
15
+ comment?: string;
16
+ }): {
17
+ path: string;
18
+ written: boolean;
19
+ };
20
+ /** Read one of the CLI's env files, or undefined when it does not exist. */
21
+ export declare function readEnvFile(path: string): Record<string, string> | undefined;
22
+ /** The env files in a product directory (for `atlas env`). */
23
+ export declare function listEnvFiles(dir: string): string[];
24
+ /**
25
+ * The common "a secret arrived" path for single-secret commands: write it to
26
+ * `<dir>/<fileName>` (0600) and print the path, or — only with
27
+ * `--print-secret` — print it after a warning on stderr.
28
+ */
29
+ export declare function deliverSecret(input: {
30
+ io: IO;
31
+ env: NodeJS.ProcessEnv;
32
+ product: string;
33
+ fileName: string;
34
+ entries: Record<string, string>;
35
+ label: string;
36
+ printSecret?: boolean;
37
+ force?: boolean;
38
+ comment?: string;
39
+ }): {
40
+ path?: string;
41
+ };
@@ -0,0 +1,142 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assertProductName = assertProductName;
4
+ exports.productDir = productDir;
5
+ exports.renderDotenv = renderDotenv;
6
+ exports.parseDotenv = parseDotenv;
7
+ exports.writeSecretFile = writeSecretFile;
8
+ exports.readEnvFile = readEnvFile;
9
+ exports.listEnvFiles = listEnvFiles;
10
+ exports.deliverSecret = deliverSecret;
11
+ const node_fs_1 = require("node:fs");
12
+ const node_os_1 = require("node:os");
13
+ const node_path_1 = require("node:path");
14
+ const errors_1 = require("./errors");
15
+ /**
16
+ * Secrets the CLI receives are written to disk, never printed.
17
+ *
18
+ * Every command that gets a secret back from the API (an instance secret key,
19
+ * an OAuth client secret, a webhook signing secret, an end-user API key) writes
20
+ * it to a dotenv file under `~/.config/<product>/` — directory 0700, file 0600 —
21
+ * and prints only the file path. `--print-secret` is the one explicit opt-out,
22
+ * and it prints a warning first. An existing file is never overwritten unless
23
+ * the command was given `--force`, so a re-run cannot silently destroy the only
24
+ * copy of a working secret.
25
+ *
26
+ * The product name doubles as the directory name, so it is restricted to a safe
27
+ * slug (no path separators, no dot-dot).
28
+ */
29
+ const PRODUCT_RE = /^[a-z0-9][a-z0-9_-]{0,62}$/i;
30
+ function assertProductName(product) {
31
+ if (!PRODUCT_RE.test(product)) {
32
+ throw new errors_1.CliError(`--product must be letters, digits, '-' or '_' (up to 63 characters), got '${product}'.`);
33
+ }
34
+ return product;
35
+ }
36
+ /** `$XDG_CONFIG_HOME/<product>` (default `~/.config/<product>`). */
37
+ function productDir(env, product) {
38
+ const base = env.XDG_CONFIG_HOME?.trim() || (0, node_path_1.join)(env.HOME?.trim() || (0, node_os_1.homedir)(), '.config');
39
+ return (0, node_path_1.join)(base, assertProductName(product));
40
+ }
41
+ /** Quote a dotenv value when it needs it. Secrets are token-shaped, so this is rarely used. */
42
+ function dotenvValue(v) {
43
+ return /^[A-Za-z0-9_./:@+=,-]*$/.test(v) ? v : JSON.stringify(v);
44
+ }
45
+ function renderDotenv(entries, comment) {
46
+ const lines = comment ? comment.split('\n').map((l) => `# ${l}`) : [];
47
+ for (const [k, v] of Object.entries(entries))
48
+ lines.push(`${k}=${dotenvValue(v)}`);
49
+ return lines.join('\n') + '\n';
50
+ }
51
+ /** Parse a dotenv file this CLI wrote (KEY=value lines, `#` comments). */
52
+ function parseDotenv(text) {
53
+ const out = {};
54
+ for (const raw of text.split(/\r?\n/)) {
55
+ const line = raw.trim();
56
+ if (!line || line.startsWith('#'))
57
+ continue;
58
+ const i = line.indexOf('=');
59
+ if (i < 1)
60
+ continue;
61
+ const key = line.slice(0, i).trim();
62
+ let value = line.slice(i + 1).trim();
63
+ if (value.startsWith('"') && value.endsWith('"')) {
64
+ try {
65
+ value = JSON.parse(value);
66
+ }
67
+ catch {
68
+ /* keep raw */
69
+ }
70
+ }
71
+ out[key] = value;
72
+ }
73
+ return out;
74
+ }
75
+ /**
76
+ * Write a 0600 dotenv file inside a 0700 directory. Refuses an existing file
77
+ * unless `force` (the same content is not a conflict: a re-run is a no-op).
78
+ * Returns the path.
79
+ */
80
+ function writeSecretFile(dir, fileName, entries, opts = {}) {
81
+ if (fileName.includes('/') || fileName.includes('\\') || fileName.startsWith('.')) {
82
+ throw new errors_1.CliError(`Refusing to write a secret file named '${fileName}'.`);
83
+ }
84
+ const path = (0, node_path_1.join)(dir, fileName);
85
+ const content = renderDotenv(entries, opts.comment);
86
+ (0, node_fs_1.mkdirSync)(dir, { recursive: true, mode: 0o700 });
87
+ (0, node_fs_1.chmodSync)(dir, 0o700);
88
+ if ((0, node_fs_1.existsSync)(path)) {
89
+ const current = (0, node_fs_1.readFileSync)(path, 'utf8');
90
+ if (current === content) {
91
+ (0, node_fs_1.chmodSync)(path, 0o600);
92
+ return { path, written: false };
93
+ }
94
+ if (!opts.force) {
95
+ throw new errors_1.CliError(`${path} already exists and holds a different secret. Nothing was overwritten. Move it aside, or re-run with --force to replace it.`);
96
+ }
97
+ }
98
+ // Write THEN chmod: `mode` is masked by umask and ignored for an existing file.
99
+ (0, node_fs_1.writeFileSync)(path, content, { mode: 0o600 });
100
+ (0, node_fs_1.chmodSync)(path, 0o600);
101
+ return { path, written: true };
102
+ }
103
+ /** Read one of the CLI's env files, or undefined when it does not exist. */
104
+ function readEnvFile(path) {
105
+ try {
106
+ return parseDotenv((0, node_fs_1.readFileSync)(path, 'utf8'));
107
+ }
108
+ catch {
109
+ return undefined;
110
+ }
111
+ }
112
+ /** The env files in a product directory (for `atlas env`). */
113
+ function listEnvFiles(dir) {
114
+ try {
115
+ return (0, node_fs_1.readdirSync)(dir)
116
+ .filter((f) => f.endsWith('.env'))
117
+ .sort();
118
+ }
119
+ catch {
120
+ return [];
121
+ }
122
+ }
123
+ /**
124
+ * The common "a secret arrived" path for single-secret commands: write it to
125
+ * `<dir>/<fileName>` (0600) and print the path, or — only with
126
+ * `--print-secret` — print it after a warning on stderr.
127
+ */
128
+ function deliverSecret(input) {
129
+ if (input.printSecret) {
130
+ input.io.err(`atlas: warning: printing ${input.label} because --print-secret was given. It may end up in your shell history, terminal scrollback or CI logs.`);
131
+ for (const [k, v] of Object.entries(input.entries))
132
+ input.io.out(`${k}=${v}`);
133
+ return {};
134
+ }
135
+ const { path } = writeSecretFile(productDir(input.env, input.product), input.fileName, input.entries, {
136
+ force: input.force,
137
+ comment: input.comment,
138
+ });
139
+ input.io.out(`${input.label} written to ${path} (mode 0600).`);
140
+ return { path };
141
+ }
142
+ //# sourceMappingURL=secrets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets.js","sourceRoot":"","sources":["../src/secrets.ts"],"names":[],"mappings":";;AAuBA,8CAOC;AAGD,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,CAAC;IAC/D,OAAO,EAAE,IAAI,EAAE,CAAC;AAClB,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The on-disk format for `atlas config` — the config-as-code layer. Two
3
+ * concerns live here, kept away from the command logic:
4
+ *
5
+ * 1. CANONICALIZATION. A value is normalised before it is written or compared
6
+ * so an export is byte-for-byte deterministic and a round-trip is a no-op
7
+ * diff. We sort object keys (the same rule Go's `json.Marshal` and the
8
+ * Terraform provider's `canonicalJSON` use) and PRESERVE array order — so a
9
+ * field whose order is meaningful (a claim mapping, an auth_config list) is
10
+ * never silently reordered.
11
+ *
12
+ * 2. THE CODEC. JSON is the robust default. YAML is offered for readable diffs
13
+ * in a repo; we WRITE a small subset where every map key and every scalar is
14
+ * JSON-encoded (it round-trips exactly: newlines, URL-shaped keys, unicode),
15
+ * and READ any YAML, so a hand-written atlas.yaml works too.
16
+ */
17
+ export type Json = string | number | boolean | null | Json[] | {
18
+ [k: string]: Json;
19
+ };
20
+ export type Format = 'json' | 'yaml';
21
+ /** A plain JSON value with all object keys recursively sorted; arrays untouched. */
22
+ export declare function canonicalize(value: unknown): Json;
23
+ /** Canonical JSON string — the equality oracle for the diff engine. */
24
+ export declare function canonicalString(value: unknown): string;
25
+ /** True when two config values are equal after canonicalization. */
26
+ export declare function deepEqual(a: unknown, b: unknown): boolean;
27
+ /** Serialize a canonicalizable value to the chosen format, with a trailing newline. */
28
+ export declare function serialize(value: unknown, format: Format): string;
29
+ /** Parse a document written by {@link serialize}. */
30
+ export declare function deserialize(text: string, format: Format): Json;
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ /**
3
+ * The on-disk format for `atlas config` — the config-as-code layer. Two
4
+ * concerns live here, kept away from the command logic:
5
+ *
6
+ * 1. CANONICALIZATION. A value is normalised before it is written or compared
7
+ * so an export is byte-for-byte deterministic and a round-trip is a no-op
8
+ * diff. We sort object keys (the same rule Go's `json.Marshal` and the
9
+ * Terraform provider's `canonicalJSON` use) and PRESERVE array order — so a
10
+ * field whose order is meaningful (a claim mapping, an auth_config list) is
11
+ * never silently reordered.
12
+ *
13
+ * 2. THE CODEC. JSON is the robust default. YAML is offered for readable diffs
14
+ * in a repo; we WRITE a small subset where every map key and every scalar is
15
+ * JSON-encoded (it round-trips exactly: newlines, URL-shaped keys, unicode),
16
+ * and READ any YAML, so a hand-written atlas.yaml works too.
17
+ */
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.canonicalize = canonicalize;
20
+ exports.canonicalString = canonicalString;
21
+ exports.deepEqual = deepEqual;
22
+ exports.serialize = serialize;
23
+ exports.deserialize = deserialize;
24
+ const yaml_1 = require("yaml");
25
+ /** A plain JSON value with all object keys recursively sorted; arrays untouched. */
26
+ function canonicalize(value) {
27
+ if (value === null || value === undefined)
28
+ return null;
29
+ if (Array.isArray(value))
30
+ return value.map((v) => canonicalize(v));
31
+ if (typeof value === 'object') {
32
+ const out = {};
33
+ for (const key of Object.keys(value).sort()) {
34
+ const v = value[key];
35
+ if (v === undefined)
36
+ continue; // omit undefined so it never reaches disk
37
+ out[key] = canonicalize(v);
38
+ }
39
+ return out;
40
+ }
41
+ if (typeof value === 'number' || typeof value === 'boolean' || typeof value === 'string') {
42
+ return value;
43
+ }
44
+ // Functions, symbols, bigint: not part of a config document.
45
+ return null;
46
+ }
47
+ /** Canonical JSON string — the equality oracle for the diff engine. */
48
+ function canonicalString(value) {
49
+ return JSON.stringify(canonicalize(value));
50
+ }
51
+ /** True when two config values are equal after canonicalization. */
52
+ function deepEqual(a, b) {
53
+ return canonicalString(a) === canonicalString(b);
54
+ }
55
+ /** Serialize a canonicalizable value to the chosen format, with a trailing newline. */
56
+ function serialize(value, format) {
57
+ const canon = canonicalize(value);
58
+ if (format === 'json')
59
+ return JSON.stringify(canon, null, 2) + '\n';
60
+ return emitYaml(canon, 0) + '\n';
61
+ }
62
+ /** Parse a document written by {@link serialize}. */
63
+ function deserialize(text, format) {
64
+ if (format === 'json')
65
+ return JSON.parse(text);
66
+ return parseYaml(text);
67
+ }
68
+ // ─────────────────────────────── YAML emit ───────────────────────────────
69
+ const INDENT = ' ';
70
+ function emitYaml(value, depth) {
71
+ const pad = INDENT.repeat(depth);
72
+ if (Array.isArray(value)) {
73
+ if (value.length === 0)
74
+ return `${pad}[]`;
75
+ return value.map((item) => emitSeqItem(item, depth)).join('\n');
76
+ }
77
+ if (value !== null && typeof value === 'object') {
78
+ const keys = Object.keys(value);
79
+ if (keys.length === 0)
80
+ return `${pad}{}`;
81
+ return keys.map((key) => emitMapEntry(key, value[key], depth)).join('\n');
82
+ }
83
+ // A bare scalar document.
84
+ return `${pad}${JSON.stringify(value)}`;
85
+ }
86
+ function emitMapEntry(key, value, depth) {
87
+ const pad = INDENT.repeat(depth);
88
+ const k = JSON.stringify(key);
89
+ if (isContainer(value) && !isEmptyContainer(value)) {
90
+ return `${pad}${k}:\n${emitYaml(value, depth + 1)}`;
91
+ }
92
+ return `${pad}${k}: ${scalarOrEmpty(value)}`;
93
+ }
94
+ function emitSeqItem(value, depth) {
95
+ const pad = INDENT.repeat(depth);
96
+ if (isContainer(value) && !isEmptyContainer(value)) {
97
+ return `${pad}-\n${emitYaml(value, depth + 1)}`;
98
+ }
99
+ return `${pad}- ${scalarOrEmpty(value)}`;
100
+ }
101
+ function scalarOrEmpty(value) {
102
+ if (Array.isArray(value))
103
+ return '[]';
104
+ if (value !== null && typeof value === 'object')
105
+ return '{}';
106
+ return JSON.stringify(value);
107
+ }
108
+ function isContainer(v) {
109
+ return Array.isArray(v) || (v !== null && typeof v === 'object');
110
+ }
111
+ function isEmptyContainer(v) {
112
+ if (Array.isArray(v))
113
+ return v.length === 0;
114
+ if (v !== null && typeof v === 'object')
115
+ return Object.keys(v).length === 0;
116
+ return false;
117
+ }
118
+ // ─────────────────────────────── YAML parse ───────────────────────────────
119
+ /**
120
+ * Any YAML 1.2 document: our own export (JSON-encoded keys and scalars) and a
121
+ * hand-written atlas.yaml with plain keys alike.
122
+ */
123
+ function parseYaml(text) {
124
+ try {
125
+ return ((0, yaml_1.parse)(text) ?? null);
126
+ }
127
+ catch (err) {
128
+ throw new Error(`atlas config: invalid YAML: ${err.message}`);
129
+ }
130
+ }
131
+ //# sourceMappingURL=serialize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serialize.js","sourceRoot":"","sources":["../src/serialize.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAQH,oCAiBC;AAGD,0CAEC;AAGD,8BAEC;AAGD,8BAIC;AAGD,kCAGC;AA9CD,+BAAkD;AAKlD,oFAAoF;AACpF,SAAgB,YAAY,CAAC,KAAc;IACzC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACvD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,MAAM,GAAG,GAA0B,EAAE,CAAC;QACtC,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,KAAgC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;YACvE,MAAM,CAAC,GAAI,KAAiC,CAAC,GAAG,CAAC,CAAC;YAClD,IAAI,CAAC,KAAK,SAAS;gBAAE,SAAS,CAAC,0CAA0C;YACzE,GAAG,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACzF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,6DAA6D;IAC7D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,uEAAuE;AACvE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GAAG,CAAC,CAAC,EAAE,CAAC;IAClD,CAAC;IACD,OAAO,GAAG,GAAG,KAAK,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,aAAa,CAAC,KAAW;IAChC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC7D,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAED,SAAS,WAAW,CAAC,CAAO;IAC1B,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;AACnE,CAAC;AACD,SAAS,gBAAgB,CAAC,CAAO;IAC/B,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;QAAE,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IAC5C,IAAI,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;IAC5E,OAAO,KAAK,CAAC;AACf,CAAC;AAED,6EAA6E;AAE7E;;;GAGG;AACH,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI,CAAC;QACH,OAAO,CAAC,IAAA,YAAiB,EAAC,IAAI,CAAC,IAAI,IAAI,CAAS,CAAC;IACnD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,+BAAgC,GAAa,CAAC,OAAO,EAAE,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Read the package version from the shipped package.json at runtime rather than
3
+ * importing it — `src/` is the tsc rootDir, so a static `import ../package.json`
4
+ * would both break rootDir and bake a stale number into the bundle. At runtime
5
+ * `__dirname` is `dist/`, so `../package.json` is the real manifest beside it.
6
+ */
7
+ export declare function getVersion(): string;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getVersion = getVersion;
4
+ const node_fs_1 = require("node:fs");
5
+ const node_path_1 = require("node:path");
6
+ /**
7
+ * Read the package version from the shipped package.json at runtime rather than
8
+ * importing it — `src/` is the tsc rootDir, so a static `import ../package.json`
9
+ * would both break rootDir and bake a stale number into the bundle. At runtime
10
+ * `__dirname` is `dist/`, so `../package.json` is the real manifest beside it.
11
+ */
12
+ function getVersion() {
13
+ try {
14
+ const manifest = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '..', 'package.json'), 'utf8'));
15
+ return manifest.version ?? '0.0.0';
16
+ }
17
+ catch {
18
+ return '0.0.0';
19
+ }
20
+ }
21
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;AASA,gCASC;AAlBD,qCAAuC;AACvC,yCAAiC;AAEjC;;;;;GAKG;AACH,SAAgB,UAAU;IACxB,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,sBAAY,EAAC,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,CAEtF,CAAC;QACF,OAAO,QAAQ,CAAC,OAAO,IAAI,OAAO,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,OAAO,CAAC;IACjB,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlasauth/cli",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "atlas — manage an Atlas instance from the terminal via the Backend API.",
5
5
  "bin": {
6
6
  "atlas": "dist/cli.js"
@@ -17,10 +17,10 @@
17
17
  "dependencies": {
18
18
  "yaml": "^2.6.0",
19
19
  "@atlasauth/actions": "0.5.0",
20
- "@atlasauth/backend": "0.35.0",
21
20
  "@atlasauth/emulator": "0.1.0",
22
- "@atlasauth/upgrade": "0.7.0",
21
+ "@atlasauth/backend": "0.37.0",
23
22
  "@atlasauth/referral-conformance": "0.2.1",
23
+ "@atlasauth/upgrade": "0.7.0",
24
24
  "@atlasauth/migrate": "0.2.0"
25
25
  },
26
26
  "devDependencies": {