@superlayer/cli 1.0.67

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 (329) hide show
  1. package/LICENSE.md +202 -0
  2. package/NOTICE +4 -0
  3. package/README.md +67 -0
  4. package/bin/index.js +3 -0
  5. package/dist/auth/index.d.ts +4 -0
  6. package/dist/auth/index.d.ts.map +1 -0
  7. package/dist/auth/index.js +103 -0
  8. package/dist/auth/index.js.map +1 -0
  9. package/dist/commands/app/delete.d.ts +7 -0
  10. package/dist/commands/app/delete.d.ts.map +1 -0
  11. package/dist/commands/app/delete.js +57 -0
  12. package/dist/commands/app/delete.js.map +1 -0
  13. package/dist/commands/app/list.d.ts +6 -0
  14. package/dist/commands/app/list.d.ts.map +1 -0
  15. package/dist/commands/app/list.js +29 -0
  16. package/dist/commands/app/list.js.map +1 -0
  17. package/dist/commands/auth/client/add.d.ts +9 -0
  18. package/dist/commands/auth/client/add.d.ts.map +1 -0
  19. package/dist/commands/auth/client/add.js +409 -0
  20. package/dist/commands/auth/client/add.js.map +1 -0
  21. package/dist/commands/auth/client/delete.d.ts +11 -0
  22. package/dist/commands/auth/client/delete.d.ts.map +1 -0
  23. package/dist/commands/auth/client/delete.js +48 -0
  24. package/dist/commands/auth/client/delete.js.map +1 -0
  25. package/dist/commands/auth/client/list.d.ts +6 -0
  26. package/dist/commands/auth/client/list.d.ts.map +1 -0
  27. package/dist/commands/auth/client/list.js +38 -0
  28. package/dist/commands/auth/client/list.js.map +1 -0
  29. package/dist/commands/auth/client/shared.d.ts +70 -0
  30. package/dist/commands/auth/client/shared.d.ts.map +1 -0
  31. package/dist/commands/auth/client/shared.js +140 -0
  32. package/dist/commands/auth/client/shared.js.map +1 -0
  33. package/dist/commands/auth/client/update.d.ts +8 -0
  34. package/dist/commands/auth/client/update.d.ts.map +1 -0
  35. package/dist/commands/auth/client/update.js +445 -0
  36. package/dist/commands/auth/client/update.js.map +1 -0
  37. package/dist/commands/auth/email/pull.d.ts +24 -0
  38. package/dist/commands/auth/email/pull.d.ts.map +1 -0
  39. package/dist/commands/auth/email/pull.js +100 -0
  40. package/dist/commands/auth/email/pull.js.map +1 -0
  41. package/dist/commands/auth/email/push.d.ts +8 -0
  42. package/dist/commands/auth/email/push.d.ts.map +1 -0
  43. package/dist/commands/auth/email/push.js +58 -0
  44. package/dist/commands/auth/email/push.js.map +1 -0
  45. package/dist/commands/auth/email/resend.d.ts +3 -0
  46. package/dist/commands/auth/email/resend.d.ts.map +1 -0
  47. package/dist/commands/auth/email/resend.js +7 -0
  48. package/dist/commands/auth/email/resend.js.map +1 -0
  49. package/dist/commands/auth/email/reset.d.ts +5 -0
  50. package/dist/commands/auth/email/reset.d.ts.map +1 -0
  51. package/dist/commands/auth/email/reset.js +25 -0
  52. package/dist/commands/auth/email/reset.js.map +1 -0
  53. package/dist/commands/auth/email/status.d.ts +57 -0
  54. package/dist/commands/auth/email/status.d.ts.map +1 -0
  55. package/dist/commands/auth/email/status.js +96 -0
  56. package/dist/commands/auth/email/status.js.map +1 -0
  57. package/dist/commands/auth/email/verify.d.ts +5 -0
  58. package/dist/commands/auth/email/verify.d.ts.map +1 -0
  59. package/dist/commands/auth/email/verify.js +12 -0
  60. package/dist/commands/auth/email/verify.js.map +1 -0
  61. package/dist/commands/auth/origin/add.d.ts +12 -0
  62. package/dist/commands/auth/origin/add.d.ts.map +1 -0
  63. package/dist/commands/auth/origin/add.js +153 -0
  64. package/dist/commands/auth/origin/add.js.map +1 -0
  65. package/dist/commands/auth/origin/delete.d.ts +8 -0
  66. package/dist/commands/auth/origin/delete.d.ts.map +1 -0
  67. package/dist/commands/auth/origin/delete.js +38 -0
  68. package/dist/commands/auth/origin/delete.js.map +1 -0
  69. package/dist/commands/auth/origin/list.d.ts +9 -0
  70. package/dist/commands/auth/origin/list.d.ts.map +1 -0
  71. package/dist/commands/auth/origin/list.js +52 -0
  72. package/dist/commands/auth/origin/list.js.map +1 -0
  73. package/dist/commands/backup/download.d.ts +10 -0
  74. package/dist/commands/backup/download.d.ts.map +1 -0
  75. package/dist/commands/backup/download.js +174 -0
  76. package/dist/commands/backup/download.js.map +1 -0
  77. package/dist/commands/backup/list.d.ts +11 -0
  78. package/dist/commands/backup/list.d.ts.map +1 -0
  79. package/dist/commands/backup/list.js +74 -0
  80. package/dist/commands/backup/list.js.map +1 -0
  81. package/dist/commands/claim.d.ts +6 -0
  82. package/dist/commands/claim.d.ts.map +1 -0
  83. package/dist/commands/claim.js +22 -0
  84. package/dist/commands/claim.js.map +1 -0
  85. package/dist/commands/explorer.d.ts +6 -0
  86. package/dist/commands/explorer.d.ts.map +1 -0
  87. package/dist/commands/explorer.js +13 -0
  88. package/dist/commands/explorer.js.map +1 -0
  89. package/dist/commands/info.d.ts +9 -0
  90. package/dist/commands/info.d.ts.map +1 -0
  91. package/dist/commands/info.js +41 -0
  92. package/dist/commands/info.js.map +1 -0
  93. package/dist/commands/init.d.ts +5 -0
  94. package/dist/commands/init.d.ts.map +1 -0
  95. package/dist/commands/init.js +41 -0
  96. package/dist/commands/init.js.map +1 -0
  97. package/dist/commands/initWithoutFiles.d.ts +6 -0
  98. package/dist/commands/initWithoutFiles.d.ts.map +1 -0
  99. package/dist/commands/initWithoutFiles.js +64 -0
  100. package/dist/commands/initWithoutFiles.js.map +1 -0
  101. package/dist/commands/login.d.ts +9 -0
  102. package/dist/commands/login.d.ts.map +1 -0
  103. package/dist/commands/login.js +44 -0
  104. package/dist/commands/login.js.map +1 -0
  105. package/dist/commands/logout.d.ts +3 -0
  106. package/dist/commands/logout.d.ts.map +1 -0
  107. package/dist/commands/logout.js +14 -0
  108. package/dist/commands/logout.js.map +1 -0
  109. package/dist/commands/pull.d.ts +5 -0
  110. package/dist/commands/pull.d.ts.map +1 -0
  111. package/dist/commands/pull.js +15 -0
  112. package/dist/commands/pull.js.map +1 -0
  113. package/dist/commands/push.d.ts +6 -0
  114. package/dist/commands/push.d.ts.map +1 -0
  115. package/dist/commands/push.js +20 -0
  116. package/dist/commands/push.js.map +1 -0
  117. package/dist/commands/query.d.ts +7 -0
  118. package/dist/commands/query.d.ts.map +1 -0
  119. package/dist/commands/query.js +52 -0
  120. package/dist/commands/query.js.map +1 -0
  121. package/dist/commands/webhooks/add.d.ts +9 -0
  122. package/dist/commands/webhooks/add.d.ts.map +1 -0
  123. package/dist/commands/webhooks/add.js +75 -0
  124. package/dist/commands/webhooks/add.js.map +1 -0
  125. package/dist/commands/webhooks/delete.d.ts +6 -0
  126. package/dist/commands/webhooks/delete.d.ts.map +1 -0
  127. package/dist/commands/webhooks/delete.js +17 -0
  128. package/dist/commands/webhooks/delete.js.map +1 -0
  129. package/dist/commands/webhooks/disable.d.ts +7 -0
  130. package/dist/commands/webhooks/disable.d.ts.map +1 -0
  131. package/dist/commands/webhooks/disable.js +18 -0
  132. package/dist/commands/webhooks/disable.js.map +1 -0
  133. package/dist/commands/webhooks/enable.d.ts +6 -0
  134. package/dist/commands/webhooks/enable.d.ts.map +1 -0
  135. package/dist/commands/webhooks/enable.js +18 -0
  136. package/dist/commands/webhooks/enable.js.map +1 -0
  137. package/dist/commands/webhooks/events/list.d.ts +7 -0
  138. package/dist/commands/webhooks/events/list.d.ts.map +1 -0
  139. package/dist/commands/webhooks/events/list.js +31 -0
  140. package/dist/commands/webhooks/events/list.js.map +1 -0
  141. package/dist/commands/webhooks/events/payload.d.ts +8 -0
  142. package/dist/commands/webhooks/events/payload.d.ts.map +1 -0
  143. package/dist/commands/webhooks/events/payload.js +39 -0
  144. package/dist/commands/webhooks/events/payload.js.map +1 -0
  145. package/dist/commands/webhooks/events/resend.d.ts +8 -0
  146. package/dist/commands/webhooks/events/resend.d.ts.map +1 -0
  147. package/dist/commands/webhooks/events/resend.js +43 -0
  148. package/dist/commands/webhooks/events/resend.js.map +1 -0
  149. package/dist/commands/webhooks/list.d.ts +8 -0
  150. package/dist/commands/webhooks/list.d.ts.map +1 -0
  151. package/dist/commands/webhooks/list.js +29 -0
  152. package/dist/commands/webhooks/list.js.map +1 -0
  153. package/dist/commands/webhooks/shared.d.ts +40 -0
  154. package/dist/commands/webhooks/shared.d.ts.map +1 -0
  155. package/dist/commands/webhooks/shared.js +248 -0
  156. package/dist/commands/webhooks/shared.js.map +1 -0
  157. package/dist/commands/webhooks/update.d.ts +10 -0
  158. package/dist/commands/webhooks/update.d.ts.map +1 -0
  159. package/dist/commands/webhooks/update.js +189 -0
  160. package/dist/commands/webhooks/update.js.map +1 -0
  161. package/dist/context/authToken.d.ts +29 -0
  162. package/dist/context/authToken.d.ts.map +1 -0
  163. package/dist/context/authToken.js +73 -0
  164. package/dist/context/authToken.js.map +1 -0
  165. package/dist/context/currentApp.d.ts +38 -0
  166. package/dist/context/currentApp.d.ts.map +1 -0
  167. package/dist/context/currentApp.js +222 -0
  168. package/dist/context/currentApp.js.map +1 -0
  169. package/dist/context/globalOpts.d.ts +11 -0
  170. package/dist/context/globalOpts.d.ts.map +1 -0
  171. package/dist/context/globalOpts.js +13 -0
  172. package/dist/context/globalOpts.js.map +1 -0
  173. package/dist/context/platformApi.d.ts +19 -0
  174. package/dist/context/platformApi.d.ts.map +1 -0
  175. package/dist/context/platformApi.js +24 -0
  176. package/dist/context/platformApi.js.map +1 -0
  177. package/dist/context/projectInfo.d.ts +30 -0
  178. package/dist/context/projectInfo.d.ts.map +1 -0
  179. package/dist/context/projectInfo.js +152 -0
  180. package/dist/context/projectInfo.js.map +1 -0
  181. package/dist/errors.d.ts +10 -0
  182. package/dist/errors.d.ts.map +1 -0
  183. package/dist/errors.js +6 -0
  184. package/dist/errors.js.map +1 -0
  185. package/dist/index.d.ts +159 -0
  186. package/dist/index.d.ts.map +1 -0
  187. package/dist/index.js +714 -0
  188. package/dist/index.js.map +1 -0
  189. package/dist/layer.d.ts +25 -0
  190. package/dist/layer.d.ts.map +1 -0
  191. package/dist/layer.js +119 -0
  192. package/dist/layer.js.map +1 -0
  193. package/dist/lib/args.d.ts +212 -0
  194. package/dist/lib/args.d.ts.map +1 -0
  195. package/dist/lib/args.js +313 -0
  196. package/dist/lib/args.js.map +1 -0
  197. package/dist/lib/backupDownload.d.ts +21 -0
  198. package/dist/lib/backupDownload.d.ts.map +1 -0
  199. package/dist/lib/backupDownload.js +151 -0
  200. package/dist/lib/backupDownload.js.map +1 -0
  201. package/dist/lib/backups.d.ts +12 -0
  202. package/dist/lib/backups.d.ts.map +1 -0
  203. package/dist/lib/backups.js +26 -0
  204. package/dist/lib/backups.js.map +1 -0
  205. package/dist/lib/config.d.ts +6 -0
  206. package/dist/lib/config.d.ts.map +1 -0
  207. package/dist/lib/config.js +39 -0
  208. package/dist/lib/config.js.map +1 -0
  209. package/dist/lib/createApp.d.ts +12 -0
  210. package/dist/lib/createApp.d.ts.map +1 -0
  211. package/dist/lib/createApp.js +15 -0
  212. package/dist/lib/createApp.js.map +1 -0
  213. package/dist/lib/email.d.ts +47 -0
  214. package/dist/lib/email.d.ts.map +1 -0
  215. package/dist/lib/email.js +71 -0
  216. package/dist/lib/email.js.map +1 -0
  217. package/dist/lib/handleEnv.d.ts +7 -0
  218. package/dist/lib/handleEnv.d.ts.map +1 -0
  219. package/dist/lib/handleEnv.js +99 -0
  220. package/dist/lib/handleEnv.js.map +1 -0
  221. package/dist/lib/http.d.ts +30 -0
  222. package/dist/lib/http.d.ts.map +1 -0
  223. package/dist/lib/http.js +55 -0
  224. package/dist/lib/http.js.map +1 -0
  225. package/dist/lib/login.d.ts +12 -0
  226. package/dist/lib/login.d.ts.map +1 -0
  227. package/dist/lib/login.js +38 -0
  228. package/dist/lib/login.js.map +1 -0
  229. package/dist/lib/oauth.d.ts +306 -0
  230. package/dist/lib/oauth.d.ts.map +1 -0
  231. package/dist/lib/oauth.js +195 -0
  232. package/dist/lib/oauth.js.map +1 -0
  233. package/dist/lib/platformApi.d.ts +5 -0
  234. package/dist/lib/platformApi.d.ts.map +1 -0
  235. package/dist/lib/platformApi.js +11 -0
  236. package/dist/lib/platformApi.js.map +1 -0
  237. package/dist/lib/pullPerms.d.ts +7 -0
  238. package/dist/lib/pullPerms.d.ts.map +1 -0
  239. package/dist/lib/pullPerms.js +41 -0
  240. package/dist/lib/pullPerms.js.map +1 -0
  241. package/dist/lib/pullSchema.d.ts +12 -0
  242. package/dist/lib/pullSchema.d.ts.map +1 -0
  243. package/dist/lib/pullSchema.js +62 -0
  244. package/dist/lib/pullSchema.js.map +1 -0
  245. package/dist/lib/pushPerms.d.ts +13 -0
  246. package/dist/lib/pushPerms.d.ts.map +1 -0
  247. package/dist/lib/pushPerms.js +54 -0
  248. package/dist/lib/pushPerms.js.map +1 -0
  249. package/dist/lib/pushSchema.d.ts +53 -0
  250. package/dist/lib/pushSchema.d.ts.map +1 -0
  251. package/dist/lib/pushSchema.js +165 -0
  252. package/dist/lib/pushSchema.js.map +1 -0
  253. package/dist/lib/ui.d.ts +18 -0
  254. package/dist/lib/ui.d.ts.map +1 -0
  255. package/dist/lib/ui.js +32 -0
  256. package/dist/lib/ui.js.map +1 -0
  257. package/dist/lib/webhooks.d.ts +27 -0
  258. package/dist/lib/webhooks.d.ts.map +1 -0
  259. package/dist/lib/webhooks.js +95 -0
  260. package/dist/lib/webhooks.js.map +1 -0
  261. package/dist/logging.d.ts +5 -0
  262. package/dist/logging.d.ts.map +1 -0
  263. package/dist/logging.js +25 -0
  264. package/dist/logging.js.map +1 -0
  265. package/dist/old.d.ts +17 -0
  266. package/dist/old.d.ts.map +1 -0
  267. package/dist/old.js +410 -0
  268. package/dist/old.js.map +1 -0
  269. package/dist/program.d.ts +3 -0
  270. package/dist/program.d.ts.map +1 -0
  271. package/dist/program.js +3 -0
  272. package/dist/program.js.map +1 -0
  273. package/dist/renderSchemaPlan.d.ts +19 -0
  274. package/dist/renderSchemaPlan.d.ts.map +1 -0
  275. package/dist/renderSchemaPlan.js +220 -0
  276. package/dist/renderSchemaPlan.js.map +1 -0
  277. package/dist/ui/index.d.ts +292 -0
  278. package/dist/ui/index.d.ts.map +1 -0
  279. package/dist/ui/index.js +1296 -0
  280. package/dist/ui/index.js.map +1 -0
  281. package/dist/ui/lib.d.ts +124 -0
  282. package/dist/ui/lib.d.ts.map +1 -0
  283. package/dist/ui/lib.js +333 -0
  284. package/dist/ui/lib.js.map +1 -0
  285. package/dist/util/findConfigCandidates.d.ts +13 -0
  286. package/dist/util/findConfigCandidates.d.ts.map +1 -0
  287. package/dist/util/findConfigCandidates.js +211 -0
  288. package/dist/util/findConfigCandidates.js.map +1 -0
  289. package/dist/util/fs.d.ts +4 -0
  290. package/dist/util/fs.d.ts.map +1 -0
  291. package/dist/util/fs.js +22 -0
  292. package/dist/util/fs.js.map +1 -0
  293. package/dist/util/getAppName.d.ts +5 -0
  294. package/dist/util/getAppName.d.ts.map +1 -0
  295. package/dist/util/getAppName.js +14 -0
  296. package/dist/util/getAppName.js.map +1 -0
  297. package/dist/util/instantConfig.d.ts +9 -0
  298. package/dist/util/instantConfig.d.ts.map +1 -0
  299. package/dist/util/instantConfig.js +13 -0
  300. package/dist/util/instantConfig.js.map +1 -0
  301. package/dist/util/isHeadlessEnvironment.d.ts +4 -0
  302. package/dist/util/isHeadlessEnvironment.d.ts.map +1 -0
  303. package/dist/util/isHeadlessEnvironment.js +11 -0
  304. package/dist/util/isHeadlessEnvironment.js.map +1 -0
  305. package/dist/util/loadConfig.d.ts +3 -0
  306. package/dist/util/loadConfig.d.ts.map +1 -0
  307. package/dist/util/loadConfig.js +72 -0
  308. package/dist/util/loadConfig.js.map +1 -0
  309. package/dist/util/loadEnv.d.ts +2 -0
  310. package/dist/util/loadEnv.d.ts.map +1 -0
  311. package/dist/util/loadEnv.js +10 -0
  312. package/dist/util/loadEnv.js.map +1 -0
  313. package/dist/util/mergeSchema.d.ts +10 -0
  314. package/dist/util/mergeSchema.d.ts.map +1 -0
  315. package/dist/util/mergeSchema.js +338 -0
  316. package/dist/util/mergeSchema.js.map +1 -0
  317. package/dist/util/projectDir.d.ts +7 -0
  318. package/dist/util/projectDir.d.ts.map +1 -0
  319. package/dist/util/projectDir.js +43 -0
  320. package/dist/util/projectDir.js.map +1 -0
  321. package/dist/util/renamePrompt.d.ts +15 -0
  322. package/dist/util/renamePrompt.d.ts.map +1 -0
  323. package/dist/util/renamePrompt.js +57 -0
  324. package/dist/util/renamePrompt.js.map +1 -0
  325. package/dist/version.d.ts +3 -0
  326. package/dist/version.d.ts.map +1 -0
  327. package/dist/version.js +3 -0
  328. package/dist/version.js.map +1 -0
  329. package/package.json +96 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,CAAC;AAEV,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,OAAO,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEjD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBA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EH,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC","sourcesContent":["import { loadEnv } from './util/loadEnv.ts';\n\nloadEnv();\n\nimport minimist from 'minimist';\nimport { Command, Option } from '@commander-js/extra-typings';\nimport chalk from 'chalk';\nimport { Effect, Layer } from 'effect';\nimport version from './version.js';\nimport { initCommand } from './commands/init.ts';\nimport { initWithoutFilesCommand } from './commands/initWithoutFiles.ts';\nimport { loginCommand } from './commands/login.ts';\nimport { logoutCommand } from './commands/logout.ts';\nimport {\n AuthLayerLive,\n BaseLayerLive,\n runCommandEffect,\n WithAppLayer,\n} from './layer.ts';\nimport { infoCommand } from './commands/info.ts';\nimport { pullCommand } from './commands/pull.ts';\nimport type { SchemaPermsOrBoth } from './commands/pull.ts';\nimport { claimCommand } from './commands/claim.ts';\nimport { pushCommand } from './commands/push.ts';\nimport { explorerCmd } from './commands/explorer.ts';\nimport { queryCmd } from './commands/query.ts';\nimport { program } from './program.ts';\nimport { PACKAGE_ALIAS_AND_FULL_NAMES } from './context/projectInfo.ts';\nimport { authClientAddCmd } from './commands/auth/client/add.ts';\nimport { authClientListCmd } from './commands/auth/client/list.ts';\nimport { authClientDeleteCmd } from './commands/auth/client/delete.ts';\nimport { authClientUpdateCmd } from './commands/auth/client/update.ts';\nimport { authOriginListCmd } from './commands/auth/origin/list.ts';\nimport { authOriginDeleteCmd } from './commands/auth/origin/delete.ts';\nimport { authOriginAddCmd } from './commands/auth/origin/add.ts';\nimport { authEmailPushCmd } from './commands/auth/email/push.ts';\nimport { authEmailPullCmd } from './commands/auth/email/pull.ts';\nimport { authEmailResetCmd } from './commands/auth/email/reset.ts';\nimport { link } from './logging.ts';\nimport { appListCommand } from './commands/app/list.ts';\nimport { appDeleteCommand } from './commands/app/delete.ts';\nimport { webhooksListCmd } from './commands/webhooks/list.ts';\nimport { webhooksAddCmd } from './commands/webhooks/add.ts';\nimport { webhooksUpdateCmd } from './commands/webhooks/update.ts';\nimport { webhooksDeleteCmd } from './commands/webhooks/delete.ts';\nimport { webhooksEnableCmd } from './commands/webhooks/enable.ts';\nimport { webhooksDisableCmd } from './commands/webhooks/disable.ts';\nimport { webhooksEventsListCmd } from './commands/webhooks/events/list.ts';\nimport { webhooksEventsPayloadCmd } from './commands/webhooks/events/payload.ts';\nimport { webhooksEventsResendCmd } from './commands/webhooks/events/resend.ts';\nimport { emailStatusCmd } from './commands/auth/email/status.ts';\nimport { verifyCmd } from './commands/auth/email/verify.ts';\nimport { resendEmailCmd } from './commands/auth/email/resend.ts';\nimport { backupListCmd } from './commands/backup/list.ts';\nimport { backupDownloadCmd } from './commands/backup/download.ts';\n\nexport type OptsFromCommand<C> =\n C extends Command<any, infer R, any> ? R : never;\n\nprogram\n .name('superlayer')\n .addOption(globalOption('-t --token <token>', 'Auth token override'))\n .addOption(globalOption('-y --yes', \"Answer 'yes' to all prompts\"))\n .addOption(globalOption('--env <file>', 'Use a specific .env file'))\n .addOption(\n globalOption('-v --version', 'Print the version number', () => {\n console.log(version);\n process.exit(0);\n }),\n )\n .addHelpOption(globalOption('-h --help', 'Print the help text for a command'))\n .usage(`<command> ${chalk.dim('[options] [args]')}`);\n\n// Command List\nexport const initDef = program\n .command('init')\n .description('Set up a new project.')\n .option(\n '-a --app <app-id>',\n 'If you have an existing app ID, we can pull schema and perms from there.',\n )\n .option(\n '-p --package <react|react-native|core|admin|solid|svelte>',\n 'Which package to automatically install if there is not one installed already.',\n )\n .option('--title <title>', 'Title for the created app')\n .option(\n '--temp',\n 'Create a temporary app which will automatically delete itself after >24 hours.',\n )\n .action((options) => {\n return runCommandEffect(\n initCommand(options).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: true,\n coerceAuth: true,\n title: options.title,\n appId: options.app,\n packageName: options.package as any,\n applyEnv: true,\n temp: options.temp,\n }),\n ),\n ),\n );\n });\n\nconst auth = program\n .command('auth')\n .description('Manage authentication for your app');\nconst app = program\n .command('app')\n .description('Manage individual Superlayer apps');\n\nexport const appListDef = app\n .command('list')\n .description('List apps on your Superlayer account')\n .option('--json', 'Output apps as JSON')\n .action(async (opts) => {\n return runCommandEffect(\n appListCommand(opts).pipe(\n Effect.provide(\n AuthLayerLive({\n coerce: false,\n allowAdminToken: false,\n }).pipe(Layer.annotateLogs('silent', !!opts.json)),\n ),\n ),\n );\n });\n\nexport const appDeleteDef = app\n .command('delete')\n .description('Delete an app from your Superlayer account')\n .option(\n '-a --app <app-id>',\n 'App ID to delete. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action(async (opts) => {\n return runCommandEffect(\n appDeleteCommand(opts).pipe(\n Effect.provide(\n AuthLayerLive({\n coerce: false,\n allowAdminToken: false,\n }),\n ),\n ),\n );\n });\n\nconst authClient = auth.command('client');\nexport const authClientAddDef = authClient\n .command('add')\n .allowExcessArguments(true)\n .allowUnknownOption(true)\n .option(\n '--type <google|github|apple|linkedin>',\n 'Type of oauth client to add',\n )\n .option(\n '--name <client name>',\n 'Custom name to identify the OAuth client (ex: google-web)',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to modify. Defaults to *_INSTANT_APP_ID in .env',\n )\n .addHelpText(\n 'after',\n `\nProvider Specific Options:\n Google:\n --app-type web|ios|android|button-for-web\n --dev-credentials (optional, web only)\n --client-id (required unless using dev credentials)\n --client-secret (web only, unless using dev credentials)\n --custom-redirect-uri (optional, web only)\n GitHub:\n --client-id\n --client-secret\n --custom-redirect-uri (optional)\n Apple:\n --services-id (Services ID from ${link('https://developer.apple.com', 'developer.apple.com')})\n --team-id (optional, required for web redirect flow)\n --key-id (optional, required for web redirect flow)\n --private-key-file (optional, path to .p8 PEM; required for web redirect flow)\n --custom-redirect-uri (optional, web redirect flow only)\n LinkedIn:\n --client-id\n --client-secret\n --custom-redirect-uri (optional)\n Clerk:\n --publishable-key (Publishable Key from ${link('https://dashboard.clerk.com', 'dashboard.clerk.com')})\n Firebase:\n --project-id (Project ID from ${link('https://console.firebase.google.com', 'console.firebase.google.com')})\n`,\n )\n .action((opts) => {\n opts = {\n ...opts,\n ...minimist(process.argv),\n };\n return runCommandEffect(\n authClientAddCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\nexport const authClientListDef = authClient\n .command('list')\n .option(\n '-a --app <app-id>',\n 'App ID to list clients for. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--json', 'Enable JSON output')\n .allowUnknownOption(true)\n .action((opts) => {\n return runCommandEffect(\n authClientListCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n // Silence \"searching for instant sdk.. logs for json output\"\n }).pipe(Layer.annotateLogs('silent', !!opts.json)),\n ),\n ),\n );\n });\n\nexport const authClientDeleteDef = authClient\n .command('delete')\n .option('--id <client-id>', 'Client ID to delete')\n .option('--name <client-name>', 'Client name to delete')\n .option(\n '-a --app <app-id>',\n 'App ID to delete a client from. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n authClientDeleteCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nexport const authClientUpdateDef = authClient\n .command('update')\n .description('Update an OAuth client')\n .allowExcessArguments(true)\n .allowUnknownOption(true)\n .option('--id <client-id>', 'Client ID to update')\n .option('--name <client-name>', 'Client name to update')\n .option(\n '-a --app <app-id>',\n 'App ID to update a client in. Defaults to *_INSTANT_APP_ID in .env',\n )\n .addHelpText(\n 'after',\n `\nProvider Specific Options:\n Google:\n --dev-credentials (web only)\n --client-id\n --client-secret (web only)\n --custom-redirect-uri (optional, web only)\n GitHub:\n --client-id\n --client-secret\n --custom-redirect-uri (optional)\n Apple:\n --services-id\n --team-id (web redirect flow)\n --key-id (web redirect flow)\n --private-key-file (web redirect flow)\n --custom-redirect-uri (optional, web redirect flow only)\n LinkedIn:\n --client-id\n --client-secret\n --custom-redirect-uri (optional)\n Clerk:\n --publishable-key\n Firebase:\n --project-id\n`,\n )\n .action((opts) => {\n opts = {\n ...opts,\n ...minimist(process.argv),\n };\n\n return runCommandEffect(\n authClientUpdateCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nconst authOrigin = auth.command('origin');\nexport const authOriginListDef = authOrigin\n .command('list')\n .option(\n '-a --app <app-id>',\n 'App ID to list origins for. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--json', 'Enable JSON output')\n .action((opts) => {\n return runCommandEffect(\n authOriginListCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }).pipe(Layer.annotateLogs('silent', !!opts.json)),\n ),\n ),\n );\n });\n\nexport const authOriginAddDef = authOrigin\n .command('add')\n .option(\n '--type <website|vercel|netlify|custom-scheme>',\n 'Type of origin to add.',\n )\n .option('--url <url>', 'Website URL (for website type, e.g. example.com)')\n .option(\n '--project <name>',\n 'Vercel project name (for vercel type, e.g. my-project)',\n )\n .option('--site <name>', 'Netlify site name (for netlify type, e.g. my-site)')\n .option(\n '--scheme <scheme>',\n 'App scheme (for custom-scheme type, e.g. myapp://)',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to add an origin to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .addHelpText(\n 'after',\n `\nOrigin Types:\n website A standard website origin (e.g. example.com)\n vercel Vercel preview deployments (project name)\n netlify Netlify preview deployments (site name)\n custom-scheme Native app scheme (e.g. your-app-scheme://)\n`,\n )\n .action((opts) => {\n return runCommandEffect(\n authOriginAddCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nexport const authOriginDeleteDef = authOrigin\n .command('delete')\n .option('--id <origin-id>', 'Origin ID to delete')\n .option(\n '-a --app <app-id>',\n 'App ID to delete an origin from. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n authOriginDeleteCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nconst webhooks = program\n .command('webhook')\n .description('Manage webhooks for an app');\n\nexport const webhooksListDef = webhooks\n .command('list')\n .description('List webhooks for an app')\n .option(\n '-a --app <app-id>',\n 'App ID to list webhooks for. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--json', 'Enable JSON output')\n .action((opts) => {\n return runCommandEffect(\n webhooksListCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: false,\n }).pipe(Layer.annotateLogs('silent', !!opts.json)),\n ),\n ),\n );\n });\n\nexport const webhooksAddDef = webhooks\n .command('add')\n .description('Add a webhook to an app')\n .option('--url <url>', 'HTTPS endpoint to deliver events to')\n .option(\n '--namespaces <e1,e2>',\n 'Comma-separated list of namespaces to listen on',\n )\n .option(\n '--actions <a1,a2>',\n 'Comma-separated list of actions (create, update, delete)',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to add a webhook to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n webhooksAddCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: false,\n }),\n ),\n ),\n );\n });\n\nexport const webhooksUpdateDef = webhooks\n .command('update')\n .description('Update a webhook')\n .option('--id <webhook-id>', 'Webhook ID to update')\n .option('--url <url>', 'New HTTPS endpoint')\n .option('--namespaces <e1,e2>', 'New comma-separated namespaces')\n .option(\n '--actions <a1,a2>',\n 'New comma-separated actions (create, update, delete)',\n )\n .option(\n '-a --app <app-id>',\n 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n webhooksUpdateCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: false,\n }),\n ),\n ),\n );\n });\n\nexport const webhooksDeleteDef = webhooks\n .command('delete')\n .description('Delete a webhook')\n .option('--id <webhook-id>', 'Webhook ID to delete')\n .option(\n '-a --app <app-id>',\n 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n webhooksDeleteCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: false,\n }),\n ),\n ),\n );\n });\n\nexport const webhooksEnableDef = webhooks\n .command('enable')\n .description('Re-enable a disabled webhook')\n .option('--id <webhook-id>', 'Webhook ID to enable')\n .option(\n '-a --app <app-id>',\n 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n webhooksEnableCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: false,\n }),\n ),\n ),\n );\n });\n\nexport const webhooksDisableDef = webhooks\n .command('disable')\n .description('Disable an active webhook')\n .option('--id <webhook-id>', 'Webhook ID to disable')\n .option('--reason <reason>', 'Human-readable reason stored on the webhook')\n .option(\n '-a --app <app-id>',\n 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n webhooksDisableCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: false,\n }),\n ),\n ),\n );\n });\n\nconst webhooksEvents = webhooks\n .command('event')\n .description('Inspect and resend webhook events');\n\nexport const webhooksEventsListDef = webhooksEvents\n .command('list')\n .description('List recent events for a webhook (up to 100, newest first)')\n .option('--webhook-id <webhook-id>', 'Webhook ID to inspect')\n .option('--json', 'Enable JSON output')\n .option(\n '-a --app <app-id>',\n 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n webhooksEventsListCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: false,\n }).pipe(Layer.annotateLogs('silent', !!opts.json)),\n ),\n ),\n );\n });\n\nexport const webhooksEventsResendDef = webhooksEvents\n .command('resend')\n .description('Re-queue a webhook event for delivery')\n .option('--webhook-id <webhook-id>', 'Webhook ID the event belongs to')\n .option('--isn <isn>', 'Event ISN to resend')\n .option(\n '-a --app <app-id>',\n 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n webhooksEventsResendCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: false,\n }),\n ),\n ),\n );\n });\n\nexport const webhooksEventsPayloadDef = webhooksEvents\n .command('payload')\n .description('Print the JSON payload for a webhook event')\n .option('--webhook-id <webhook-id>', 'Webhook ID the event belongs to')\n .option('--isn <isn>', 'Event ISN to fetch')\n .option(\n '-a --app <app-id>',\n 'App ID the webhook belongs to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) => {\n return runCommandEffect(\n webhooksEventsPayloadCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: false,\n }),\n ),\n ),\n );\n });\n\nconst backup = program\n .command('backup')\n .description('View and download backups of your app');\n\nexport const backupListDef = backup\n .command('list')\n .description('List downloadable backups for an app')\n .option(\n '-a --app <app-id>',\n 'App ID to list backups for. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--json', 'Output backups as JSON')\n .action((opts) => {\n return runCommandEffect(\n backupListCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }).pipe(Layer.annotateLogs('silent', !!opts.json)),\n ),\n ),\n );\n });\n\nexport const backupDownloadDef = backup\n .command('download')\n .description('Download a backup as a zip file')\n .argument(\n '[backup-id]',\n 'Backup ID to download. Defaults to an interactive picker',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to download a backup of. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--latest', 'Download the most recent backup')\n .option(\n '-o --out <path>',\n 'Output zip path. Defaults to instant-backup-<timestamp>.zip',\n )\n .action((backupId, opts) => {\n return runCommandEffect(\n backupDownloadCmd(backupId, opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nconst authEmail = auth\n .command('email')\n .description('Manage custom magic code email templates');\n\nexport const authEmailStatusDef = authEmail\n .command('status')\n .description('Get status for the custom magic code email template')\n .option(\n '-a --app <app-id>',\n 'App ID to push email settings to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--json', 'Output email status as JSON')\n .action((opts) => {\n runCommandEffect(\n emailStatusCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n appId: opts.app,\n coerce: false,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nexport const authEmailPushDef = authEmail\n .command('push')\n .description('Push the custom magic code email template.')\n .option(\n '-a --app <app-id>',\n 'App ID to push email settings to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option(\n '-f --file <path>',\n 'Path to instant.email.ts. Defaults to INSTANT_EMAIL_FILE_PATH or auto-discovery.',\n )\n .action((opts) =>\n runCommandEffect(\n authEmailPushCmd({ file: opts.file }).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n ),\n );\n\nexport const authEmailPullDef = authEmail\n .command('pull')\n .description('Pull the custom magic code email template.')\n .option(\n '-a --app <app-id>',\n 'App ID to pull email settings from. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option(\n '-f --file <path>',\n 'Path to instant.email.ts. Defaults to INSTANT_EMAIL_FILE_PATH or auto-discovery.',\n )\n .action((opts) =>\n runCommandEffect(\n authEmailPullCmd({ file: opts.file }).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n ),\n );\n\nexport const authEmailResetDef = authEmail\n .command('reset')\n .description('Delete the custom magic code email template.')\n .option(\n '-a --app <app-id>',\n 'App ID to reset email settings for. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((opts) =>\n runCommandEffect(\n authEmailResetCmd().pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n ),\n );\n\nexport const authEmailResendDef = authEmail\n .command('resend')\n .description('Resend the verification email')\n .option(\n '-a --app <app-id>',\n 'App ID to reset email settings for. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action(() => {\n runCommandEffect(\n resendEmailCmd.pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nexport const authEmailVerifyDef = authEmail\n .command('verify')\n .description('Verify a custom email sender with a magic code')\n .argument('<code>', 'The magic code to verify')\n .option(\n '-a --app <app-id>',\n 'App ID to reset email settings for. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action((code, opts) => {\n runCommandEffect(\n verifyCmd(code, opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n coerceAuth: false,\n appId: opts.app,\n allowAdminToken: true,\n }),\n ),\n ),\n );\n });\n\nexport const initWithoutFilesDef = program\n .command('init-without-files')\n .description('Generate a new app id and admin token pair without any files.')\n .option('--title <title>', 'Title for the created app.')\n .option(\n '--org-id <org-id>',\n 'Organization id for app. Cannot be used with --temp flag.',\n )\n .option(\n '--temp',\n 'Create a temporary app which will automatically delete itself after >24 hours.',\n )\n .action((opts) => {\n return runCommandEffect(\n initWithoutFilesCommand(opts).pipe(Effect.provide(BaseLayerLive)),\n );\n });\n\nexport const loginDef = program\n .command('login')\n .description('Log into your account')\n .option('-p --print', 'Prints the auth token into the console.')\n .option(\n '--headless',\n 'Print the login URL instead of trying to open the browser',\n )\n .action(async (opts) => {\n await runCommandEffect(\n loginCommand(opts).pipe(Effect.provide(BaseLayerLive)),\n );\n });\n\nprogram\n .command('logout')\n .description('Log out of your Superlayer account')\n .action(async () => {\n return runCommandEffect(\n logoutCommand().pipe(Effect.provide(BaseLayerLive)),\n );\n });\n\nexport const infoDef = program\n .command('info')\n .description('Display CLI version, login status, and app info')\n .action(async () => {\n const authLayer = AuthLayerLive({\n coerce: false,\n allowAdminToken: false,\n });\n\n return runCommandEffect(\n infoCommand().pipe(\n Effect.provide(\n Layer.mergeAll(\n BaseLayerLive,\n authLayer.pipe(Layer.catchAll(() => Layer.empty)),\n WithAppLayer({ coerce: false, allowAdminToken: true }).pipe(\n Layer.annotateLogs('silent', true),\n Layer.catchAll(() => Layer.empty),\n ),\n ),\n ),\n ),\n );\n });\n\nexport const explorerDef = program\n .command('explorer')\n .description('Opens the Explorer in your browser')\n .option(\n '-a --app <app-id>',\n 'App ID to open the explorer to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action(async (opts) => {\n return runCommandEffect(\n explorerCmd(opts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: true,\n coerceAuth: true,\n appId: opts.app,\n }),\n ),\n ),\n );\n });\n\nexport const queryDef = program\n .command('query')\n .argument('<query>', 'InstaQL query as JSON/JSON5')\n .option(\n '-a --app <app-id>',\n 'App ID to query. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option('--admin', 'Run the query as admin (bypasses permissions)')\n .option('--as-email <email>', 'Run the query as a specific user by email')\n .option('--as-guest', 'Run the query as an unauthenticated guest')\n .option(\n '--as-token <refresh-token>',\n 'Run the query as a user identified by refresh token',\n )\n .description('Run an InstaQL query against your app.')\n .action(async function (queryArg, opts) {\n return runCommandEffect(queryCmd(queryArg, opts));\n });\n\nexport const pullDef = program\n .command('pull')\n .argument(\n '[schema|perms|all]',\n 'Which configuration to pull. Defaults to `all`',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to pull to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option(\n '-p --package <react|react-native|core|admin|solid|svelte>',\n 'Which package to automatically install if there is not one installed already.',\n )\n .option(\n '--experimental-type-preservation',\n \"[Experimental] Preserve manual type changes like `status: i.json<'online' | 'offline'>()` when doing `superlayer pull schema`\",\n )\n .description('Pull schema and perm files from production.')\n .addHelpText(\n 'after',\n `\nEnvironment Variables:\n INSTANT_SCHEMA_FILE_PATH Override schema file location (default: instant.schema.ts)\n INSTANT_PERMS_FILE_PATH Override perms file location (default: instant.perms.ts)\n`,\n )\n .action(async function (arg, inputOpts) {\n return runCommandEffect(\n pullCommand(arg as SchemaPermsOrBoth, inputOpts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: true,\n packageName: inputOpts.package as\n | 'react'\n | 'react-native'\n | 'core'\n | 'admin'\n | undefined,\n appId: inputOpts.app,\n }),\n ),\n ),\n );\n });\n\nexport const pushDef = program\n .command('push')\n .argument(\n '[schema|perms|all]',\n 'Which configuration to push. Defaults to `all`',\n )\n .option(\n '-a --app <app-id>',\n 'App ID to push to. Defaults to *_INSTANT_APP_ID in .env',\n )\n .option(\n '--skip-check-types',\n \"Don't check types on the server when pushing schema\",\n )\n .option(\n '--rename [renames...]',\n 'List of full attribute names separated by a \":\"\\n Example:`push --rename posts.author:posts.creator stores.owner:stores.manager`',\n )\n .option(\n '-p --package <react|react-native|core|admin|solid|svelte>',\n 'Which package to automatically install if there is not one installed already.',\n )\n .description('Push schema and perm files to production.')\n .addHelpText(\n 'after',\n `\nEnvironment Variables:\n INSTANT_SCHEMA_FILE_PATH Override schema file location (default: instant.schema.ts)\n INSTANT_PERMS_FILE_PATH Override perms file location (default: instant.perms.ts)\n`,\n )\n .action(async function (arg, inputOpts) {\n return runCommandEffect(\n pushCommand(arg, inputOpts).pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n appId: inputOpts.app,\n coerceLibraryInstall: true,\n coerceAuth: false,\n allowAdminToken: true,\n applyEnv: true,\n packageName:\n inputOpts.package as keyof typeof PACKAGE_ALIAS_AND_FULL_NAMES,\n }),\n ),\n ),\n );\n });\n\nexport const claimDef = program\n .command('claim')\n .description('Transfer a temporary app into your Superlayer account')\n .option(\n '-a --app <app-id>',\n 'App to claim. Defaults to *_INSTANT_APP_ID in .env',\n )\n .action(async function (opts) {\n return runCommandEffect(\n claimCommand.pipe(\n Effect.provide(\n WithAppLayer({\n coerce: false,\n allowAdminToken: false,\n appId: opts.app,\n applyEnv: false,\n }),\n ),\n ),\n );\n });\n//// Program setup /////\n\nfunction globalOption(\n flags: string,\n description?: string,\n argParser?: (value: string, prev?: unknown) => unknown,\n) {\n const opt = new Option(flags, description);\n if (argParser) {\n opt.argParser(argParser);\n }\n // @ts-ignore\n // __global does not exist on `Option`,\n // but we use it in `getLocalAndGlobalOptions`, to produce\n // our own custom list of local and global options.\n // For more info, see the original PR:\n // https://github.com/InterfaceLDN/Superlayer/pull/505\n opt.__global = true;\n return opt;\n}\n\nfunction getLocalAndGlobalOptions(cmd: any, helper: any) {\n const mixOfLocalAndGlobal = helper.visibleOptions(cmd);\n const localOptionsFromMix = mixOfLocalAndGlobal.filter(\n (option: any) => !option.__global,\n );\n const globalOptionsFromMix = mixOfLocalAndGlobal.filter(\n (option: any) => option.__global,\n );\n const globalOptions = helper.visibleGlobalOptions(cmd);\n\n return [localOptionsFromMix, globalOptionsFromMix.concat(globalOptions)];\n}\n\nfunction formatHelp(\n this: { showGlobalOptions: boolean },\n cmd: any,\n helper: any,\n) {\n const termWidth = helper.padWidth(cmd, helper);\n const helpWidth = helper.helpWidth || 80;\n const itemIndentWidth = 2;\n const itemSeparatorWidth = 2; // between term and description\n function formatItem(term: string, description: string | undefined) {\n if (description) {\n const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;\n return helper.boxWrap(\n fullText,\n helpWidth - itemIndentWidth,\n termWidth + itemSeparatorWidth,\n );\n }\n return term;\n }\n function formatList(textArray: string[]) {\n return textArray.join('\\n').replace(/^/gm, ' '.repeat(itemIndentWidth));\n }\n\n // Usage\n let output = [`${helper.commandUsage(cmd)}`, ''];\n\n // Description\n const commandDescription = helper.commandDescription(cmd);\n if (commandDescription.length > 0) {\n output = output.concat([\n helper.boxWrap(commandDescription, helpWidth, 0),\n '',\n ]);\n }\n\n // Arguments\n const argumentList = helper.visibleArguments(cmd).map((argument: any) => {\n return formatItem(\n helper.argumentTerm(argument),\n helper.argumentDescription(argument),\n );\n });\n if (argumentList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Arguments'),\n formatList(argumentList),\n '',\n ]);\n }\n const [visibleOptions, visibleGlobalOptions] = getLocalAndGlobalOptions(\n cmd,\n helper,\n );\n\n // Options\n const optionList = visibleOptions.map((option: any) => {\n return formatItem(\n helper.optionTerm(option),\n helper.optionDescription(option),\n );\n });\n if (optionList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Options'),\n formatList(optionList),\n '',\n ]);\n }\n // Commands\n const commandList = helper.visibleCommands(cmd).map((cmd: any) => {\n return formatItem(\n helper.subcommandTerm(cmd),\n helper.subcommandDescription(cmd),\n );\n });\n if (commandList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Commands'),\n formatList(commandList),\n '',\n ]);\n }\n\n if (this.showGlobalOptions) {\n const globalOptionList = visibleGlobalOptions.map((option: any) => {\n return formatItem(\n helper.optionTerm(option),\n helper.optionDescription(option),\n );\n });\n if (globalOptionList.length > 0) {\n output = output.concat([\n chalk.dim.bold('Global Options'),\n formatList(globalOptionList),\n '',\n ]);\n }\n }\n\n return output.join('\\n');\n}\n\nprogram.configureHelp({\n showGlobalOptions: true,\n formatHelp,\n});\n\nprogram.parse(process.argv);\n"]}
@@ -0,0 +1,25 @@
1
+ import * as NodeContext from '@effect/platform-node/NodeContext';
2
+ import { Cause, Effect, Layer } from 'effect';
3
+ import { PlatformApi, PlatformApiError } from './context/platformApi.ts';
4
+ import { PACKAGE_ALIAS_AND_FULL_NAMES } from './context/projectInfo.ts';
5
+ import { InstantHttpError } from './lib/http.ts';
6
+ import { RequestError } from '@effect/platform/HttpClientError';
7
+ export declare const runCommandEffect: <A, E, R extends never>(effect: Effect.Effect<A, E, R>) => Promise<A>;
8
+ export declare const printRedErrors: <A, R>(self: Effect.Effect<A, unknown, R>) => Effect.Effect<void | A, unknown, unknown>;
9
+ export declare const BaseLayerLive: Layer.Layer<import("./context/globalOpts.ts").GlobalOpts | import("./lib/http.ts").InstantHttp | PlatformApi | NodeContext.NodeContext, import("./errors.ts").BadArgsError | Cause.UnknownException | import("effect/ConfigError").ConfigError, never>;
10
+ export declare const AuthLayerLive: ({ allowAdminToken, coerce, }: {
11
+ allowAdminToken: boolean;
12
+ coerce: boolean;
13
+ }) => Layer.Layer<import("./context/globalOpts.ts").GlobalOpts | import("./lib/http.ts").InstantHttp | import("./context/authToken.ts").AuthToken | import("./lib/http.ts").InstantHttpAuthed | PlatformApi | NodeContext.NodeContext, import("./errors.ts").BadArgsError | Cause.UnknownException | import("effect/ConfigError").ConfigError | import("effect/ParseResult").ParseError | InstantHttpError | Cause.TimeoutException | RequestError | import("@effect/platform/HttpClientError").ResponseError | import("./context/authToken.ts").NotAuthedError, never>;
14
+ export declare const WithAppLayer: (args: {
15
+ appId?: string;
16
+ title?: string;
17
+ coerce: boolean;
18
+ coerceAuth?: boolean;
19
+ coerceLibraryInstall?: boolean;
20
+ packageName?: keyof typeof PACKAGE_ALIAS_AND_FULL_NAMES;
21
+ allowAdminToken?: boolean;
22
+ applyEnv?: boolean;
23
+ temp?: boolean;
24
+ }) => Layer.Layer<import("./context/globalOpts.ts").GlobalOpts | import("./context/projectInfo.ts").ProjectInfo | import("./lib/http.ts").InstantHttp | import("./context/authToken.ts").AuthToken | import("./lib/http.ts").InstantHttpAuthed | PlatformApi | import("./context/currentApp.ts").CurrentApp | NodeContext.NodeContext, import("./errors.ts").BadArgsError | import("./lib/ui.ts").UIError | Cause.UnknownException | import("./context/projectInfo.ts").ProjectInfoError | import("effect/ConfigError").ConfigError | import("effect/ParseResult").ParseError | InstantHttpError | Cause.TimeoutException | RequestError | import("@effect/platform/HttpClientError").ResponseError | import("./context/authToken.ts").NotAuthedError | import("@effect/platform/Error").PlatformError | PlatformApiError | import("./context/currentApp.ts").CurrentAppContextError | import("./context/currentApp.ts").AppNotFoundError | import("@effect/platform/HttpBody").HttpBodyError, never>;
25
+ //# sourceMappingURL=layer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"layer.d.ts","sourceRoot":"","sources":["../src/layer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAkB,MAAM,QAAQ,CAAC;AAO9D,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EACL,4BAA4B,EAE7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAiBhE,eAAO,MAAM,gBAAgB,GAAI,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,KAAK,EACpD,QAAQ,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,KAC7B,OAAO,CAAC,CAAC,CAA2D,CAAC;AAExE,eAAO,MAAM,cAAc,yFAuF1B,CAAC;AAwBF,eAAO,MAAM,aAAa,wPAGzB,CAAC;AAGF,eAAO,MAAM,aAAa,GAAI,8BAG3B;IACD,eAAe,EAAE,OAAO,CAAC;IACzB,MAAM,EAAE,OAAO,CAAC;CACjB,siBAUE,CAAC;AAEJ,eAAO,MAAM,YAAY,GAAI,MAAM;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,OAAO,4BAA4B,CAAC;IACxD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,o8BAwBE,CAAC"}
package/dist/layer.js ADDED
@@ -0,0 +1,119 @@
1
+ import * as NodeContext from '@effect/platform-node/NodeContext';
2
+ import * as NodeHttpClient from '@effect/platform-node/NodeHttpClient';
3
+ import { Cause, Effect, Layer, ManagedRuntime } from 'effect';
4
+ import { UnknownException } from 'effect/Cause';
5
+ import { inspect } from 'node:util';
6
+ import chalk from 'chalk';
7
+ import { AuthTokenLive } from "./context/authToken.js";
8
+ import { CurrentAppLive } from "./context/currentApp.js";
9
+ import { GlobalOptsLive } from "./context/globalOpts.js";
10
+ import { PlatformApi, PlatformApiError } from "./context/platformApi.js";
11
+ import { PACKAGE_ALIAS_AND_FULL_NAMES, ProjectInfoLive, } from "./context/projectInfo.js";
12
+ import { InstantHttpAuthedLive, InstantHttpError, InstantHttpLive, } from "./lib/http.js";
13
+ import { SimpleLogLayer } from "./logging.js";
14
+ import { RequestError } from '@effect/platform/HttpClientError';
15
+ const runtime = ManagedRuntime.make(SimpleLogLayer);
16
+ // Best-effort stringification for unknown error causes. Tries JSON first
17
+ // (compact, readable) and falls back to util.inspect for circular refs or
18
+ // values JSON can't serialize (functions, BigInt, etc.).
19
+ function serializeCause(cause) {
20
+ try {
21
+ const json = JSON.stringify(cause);
22
+ if (json !== undefined)
23
+ return json;
24
+ }
25
+ catch {
26
+ // fall through
27
+ }
28
+ return inspect(cause, { depth: 2, breakLength: Infinity });
29
+ }
30
+ export const runCommandEffect = (effect) => runtime.runPromise(effect.pipe(printRedErrors));
31
+ export const printRedErrors = Effect.catchAllCause((cause) => Effect.gen(function* () {
32
+ const failure = Cause.failureOption(cause);
33
+ // This should never happen because the catchAllCause should only fire when there IS a failure
34
+ if (failure._tag !== 'Some') {
35
+ return;
36
+ }
37
+ // Unwrap Effect.tryPromise's UnknownException so instanceof checks below
38
+ // match regardless of whether the error was Effect.fail'd or thrown from a Promise.
39
+ const theError = failure.value instanceof UnknownException
40
+ ? failure.value.error
41
+ : failure.value;
42
+ // Simplify "can't connect to url errors" instead of printing
43
+ // crazy stack trace
44
+ if (theError instanceof RequestError) {
45
+ yield* Effect.logError(theError.toString());
46
+ return process.exit(1);
47
+ }
48
+ // Surface server-side validation messages instead of dumping a stack with
49
+ // the useful detail buried in [cause].
50
+ if (theError instanceof PlatformApiError) {
51
+ const cause = theError.cause;
52
+ const causeMessage = cause instanceof Error
53
+ ? cause.message
54
+ : cause != null
55
+ ? serializeCause(cause)
56
+ : '';
57
+ yield* Effect.logError(causeMessage
58
+ ? `${theError.message}: ${causeMessage}`
59
+ : theError.message);
60
+ return process.exit(1);
61
+ }
62
+ // Special error handling for specific error types
63
+ if (theError instanceof InstantHttpError) {
64
+ if (theError?.message) {
65
+ yield* Effect.logError('Error making request to Instant API: ' + theError.message);
66
+ }
67
+ if (Array.isArray(theError?.hint?.errors)) {
68
+ for (const err of theError.hint.errors) {
69
+ if (err) {
70
+ if (typeof err === 'string') {
71
+ yield* Effect.logError(err);
72
+ }
73
+ else {
74
+ yield* Effect.logError(`${err.in ? err.in.join('->') + ': ' : ''}${err.message}`);
75
+ }
76
+ }
77
+ }
78
+ }
79
+ return process.exit(1);
80
+ }
81
+ // Print just the message if the error has a message attribute and no cause
82
+ if (typeof theError === 'object' &&
83
+ theError !== null &&
84
+ 'message' in theError &&
85
+ typeof theError.message === 'string' &&
86
+ !('cause' in theError)) {
87
+ return yield* Effect.logError(theError.message).pipe(Effect.tap(() => {
88
+ process.exit(1);
89
+ }));
90
+ }
91
+ return yield* Effect.logError(Cause.pretty(cause, { renderErrorCause: true })).pipe(Effect.tap(() => {
92
+ process.exit(1);
93
+ }));
94
+ }));
95
+ /**
96
+ * Note:
97
+ Avoid Duplicate Layer Creation
98
+
99
+ Layers are memoized using reference equality. Therefore, if you have a layer that is created by calling a function like f(), you should only call that f once and re-use the resulting layer so that you are always using the same instance.
100
+ */
101
+ // TODO: make coerce param work for auth too
102
+ // Base layers
103
+ const AuthTokenLayer = ({ allowAdminToken = true, coerce = false, }) => Layer.provide(AuthTokenLive({ allowAdminToken, coerce }), NodeContext.layer);
104
+ const InstantHttpLayer = Layer.provide(InstantHttpLive, NodeHttpClient.layer);
105
+ // Unauthenticated layer with InstantHttp + PlatformApi + GlobalOpts + NodeContext
106
+ export const BaseLayerLive = Layer.provideMerge(Layer.mergeAll(InstantHttpLayer, PlatformApi.Default, GlobalOptsLive), NodeContext.layer);
107
+ // Authenticated layer extends BaseLayerLive with InstantHttpAuthed
108
+ export const AuthLayerLive = ({ allowAdminToken = true, coerce = false, }) => Layer.provideMerge(Layer.provideMerge(InstantHttpAuthedLive, Layer.merge(AuthTokenLayer({ allowAdminToken, coerce }), InstantHttpLayer)), BaseLayerLive);
109
+ export const WithAppLayer = (args) => Layer.mergeAll(CurrentAppLive({
110
+ coerce: args.coerce,
111
+ appId: args.appId,
112
+ title: args.title,
113
+ applyEnv: args.applyEnv,
114
+ temp: args.temp,
115
+ })).pipe(Layer.provideMerge(AuthLayerLive({
116
+ allowAdminToken: args.allowAdminToken !== undefined ? args.allowAdminToken : true,
117
+ coerce: args.coerceAuth ?? false,
118
+ })), Layer.provideMerge(ProjectInfoLive(args.coerceLibraryInstall ?? args.coerce, args.packageName)), Layer.provideMerge(BaseLayerLive));
119
+ //# sourceMappingURL=layer.js.map
@@ -0,0 +1 @@
1
+ {"version":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Y,CAChB,KAAK,CAAC,YAAY,CAChB,qBAAqB,EACrB,KAAK,CAAC,KAAK,CACT,cAAc,CAAC,EAAE,eAAe,EAAE,MAAM,EAAE,CAAC,EAC3C,gBAAgB,CACjB,CACF,EACD,aAAa,CACd,CAAC;AAEJ,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,IAU5B,EAAE,EAAE,CACH,KAAK,CAAC,QAAQ,CACZ,cAAc,CAAC;IACb,MAAM,EAAE,IAAI,CAAC,MAAM;IACnB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,KAAK,EAAE,IAAI,CAAC,KAAK;IACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;IACvB,IAAI,EAAE,IAAI,CAAC,IAAI;CAChB,CAAC,CACH,CAAC,IAAI,CACJ,KAAK,CAAC,YAAY,CAChB,aAAa,CAAC;IACZ,eAAe,EACb,IAAI,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI;IAClE,MAAM,EAAE,IAAI,CAAC,UAAU,IAAI,KAAK;CACjC,CAAC,CACH,EACD,KAAK,CAAC,YAAY,CAChB,eAAe,CACb,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,MAAM,EACxC,IAAI,CAAC,WAAW,CACjB,CACF,EACD,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,CAClC,CAAC","sourcesContent":["import * as NodeContext from '@effect/platform-node/NodeContext';\nimport * as NodeHttpClient from '@effect/platform-node/NodeHttpClient';\nimport { Cause, Effect, Layer, ManagedRuntime } from 'effect';\nimport { UnknownException } from 'effect/Cause';\nimport { inspect } from 'node:util';\nimport chalk from 'chalk';\nimport { AuthTokenLive } from './context/authToken.ts';\nimport { CurrentAppLive } from './context/currentApp.ts';\nimport { GlobalOptsLive } from './context/globalOpts.ts';\nimport { PlatformApi, PlatformApiError } from './context/platformApi.ts';\nimport {\n PACKAGE_ALIAS_AND_FULL_NAMES,\n ProjectInfoLive,\n} from './context/projectInfo.ts';\nimport {\n InstantHttpAuthedLive,\n InstantHttpError,\n InstantHttpLive,\n} from './lib/http.ts';\nimport { SimpleLogLayer } from './logging.ts';\nimport { RequestError } from '@effect/platform/HttpClientError';\n\nconst runtime = ManagedRuntime.make(SimpleLogLayer);\n\n// Best-effort stringification for unknown error causes. Tries JSON first\n// (compact, readable) and falls back to util.inspect for circular refs or\n// values JSON can't serialize (functions, BigInt, etc.).\nfunction serializeCause(cause: unknown): string {\n try {\n const json = JSON.stringify(cause);\n if (json !== undefined) return json;\n } catch {\n // fall through\n }\n return inspect(cause, { depth: 2, breakLength: Infinity });\n}\n\nexport const runCommandEffect = <A, E, R extends never>(\n effect: Effect.Effect<A, E, R>,\n): Promise<A> => runtime.runPromise(effect.pipe(printRedErrors) as any);\n\nexport const printRedErrors = Effect.catchAllCause((cause) =>\n Effect.gen(function* () {\n const failure = Cause.failureOption(cause);\n\n // This should never happen because the catchAllCause should only fire when there IS a failure\n if (failure._tag !== 'Some') {\n return;\n }\n\n // Unwrap Effect.tryPromise's UnknownException so instanceof checks below\n // match regardless of whether the error was Effect.fail'd or thrown from a Promise.\n const theError =\n failure.value instanceof UnknownException\n ? failure.value.error\n : failure.value;\n\n // Simplify \"can't connect to url errors\" instead of printing\n // crazy stack trace\n if (theError instanceof RequestError) {\n yield* Effect.logError(theError.toString());\n return process.exit(1);\n }\n\n // Surface server-side validation messages instead of dumping a stack with\n // the useful detail buried in [cause].\n if (theError instanceof PlatformApiError) {\n const cause = theError.cause;\n const causeMessage =\n cause instanceof Error\n ? cause.message\n : cause != null\n ? serializeCause(cause)\n : '';\n yield* Effect.logError(\n causeMessage\n ? `${theError.message}: ${causeMessage}`\n : theError.message,\n );\n return process.exit(1);\n }\n\n // Special error handling for specific error types\n if (theError instanceof InstantHttpError) {\n if (theError?.message) {\n yield* Effect.logError(\n 'Error making request to Instant API: ' + theError.message,\n );\n }\n if (Array.isArray(theError?.hint?.errors)) {\n for (const err of theError.hint.errors) {\n if (err) {\n if (typeof err === 'string') {\n yield* Effect.logError(err);\n } else {\n yield* Effect.logError(\n `${err.in ? err.in.join('->') + ': ' : ''}${err.message}`,\n );\n }\n }\n }\n }\n return process.exit(1);\n }\n\n // Print just the message if the error has a message attribute and no cause\n if (\n typeof theError === 'object' &&\n theError !== null &&\n 'message' in theError &&\n typeof theError.message === 'string' &&\n !('cause' in theError)\n ) {\n return yield* Effect.logError(theError.message).pipe(\n Effect.tap(() => {\n process.exit(1);\n }),\n );\n }\n\n return yield* Effect.logError(\n Cause.pretty(cause, { renderErrorCause: true }),\n ).pipe(\n Effect.tap(() => {\n process.exit(1);\n }),\n );\n }),\n);\n\n/**\n * Note:\n Avoid Duplicate Layer Creation\n\n Layers are memoized using reference equality. Therefore, if you have a layer that is created by calling a function like f(), you should only call that f once and re-use the resulting layer so that you are always using the same instance.\n */\n\n// TODO: make coerce param work for auth too\n\n// Base layers\nconst AuthTokenLayer = ({\n allowAdminToken = true,\n coerce = false,\n}: {\n allowAdminToken: boolean;\n coerce: boolean;\n}) =>\n Layer.provide(AuthTokenLive({ allowAdminToken, coerce }), NodeContext.layer);\n\nconst InstantHttpLayer = Layer.provide(InstantHttpLive, NodeHttpClient.layer);\n\n// Unauthenticated layer with InstantHttp + PlatformApi + GlobalOpts + NodeContext\nexport const BaseLayerLive = Layer.provideMerge(\n Layer.mergeAll(InstantHttpLayer, PlatformApi.Default, GlobalOptsLive),\n NodeContext.layer,\n);\n\n// Authenticated layer extends BaseLayerLive with InstantHttpAuthed\nexport const AuthLayerLive = ({\n allowAdminToken = true,\n coerce = false,\n}: {\n allowAdminToken: boolean;\n coerce: boolean;\n}) =>\n Layer.provideMerge(\n Layer.provideMerge(\n InstantHttpAuthedLive,\n Layer.merge(\n AuthTokenLayer({ allowAdminToken, coerce }),\n InstantHttpLayer,\n ),\n ),\n BaseLayerLive,\n );\n\nexport const WithAppLayer = (args: {\n appId?: string;\n title?: string;\n coerce: boolean;\n coerceAuth?: boolean;\n coerceLibraryInstall?: boolean;\n packageName?: keyof typeof PACKAGE_ALIAS_AND_FULL_NAMES;\n allowAdminToken?: boolean;\n applyEnv?: boolean;\n temp?: boolean;\n}) =>\n Layer.mergeAll(\n CurrentAppLive({\n coerce: args.coerce,\n appId: args.appId,\n title: args.title,\n applyEnv: args.applyEnv,\n temp: args.temp,\n }),\n ).pipe(\n Layer.provideMerge(\n AuthLayerLive({\n allowAdminToken:\n args.allowAdminToken !== undefined ? args.allowAdminToken : true,\n coerce: args.coerceAuth ?? false,\n }),\n ),\n Layer.provideMerge(\n ProjectInfoLive(\n args.coerceLibraryInstall ?? args.coerce,\n args.packageName,\n ),\n ),\n Layer.provideMerge(BaseLayerLive),\n );\n"]}
@@ -0,0 +1,212 @@
1
+ /**
2
+ * Args lets commands read CLI flags as a small pipeline:
3
+ *
4
+ * 1. Parse a value from opts
5
+ * 2. Gate it: when is this flag available?
6
+ * 3. Prompt for a missing value, when interactive
7
+ * 4. Validate and finish as required or optional
8
+ *
9
+ * This keeps the "can this flag be used here?" logic next to the value it
10
+ * controls. For example, a Google client secret is only meaningful when using
11
+ * custom web credentials:
12
+ *
13
+ * const clientSecret = yield* Args.text(opts, 'client-secret').pipe(
14
+ * Args.availableWhen(usesCustomWebCredentials),
15
+ * Args.prompt(clientSecretPrompt({ providerUrl })),
16
+ * Args.required(),
17
+ * );
18
+ *
19
+ * The key argument to text/bool/has is the exact opts lookup key. If the
20
+ * user-facing flag name differs, pass simpleName for errors:
21
+ *
22
+ * Args.text(opts, 'customRedirectUri', { simpleName: '--custom-redirect-uri' })
23
+ */
24
+ import { Effect } from 'effect';
25
+ import { type Pipeable } from 'effect/Pipeable';
26
+ import { BadArgsError } from '../errors.ts';
27
+ import { GlobalOpts } from '../context/globalOpts.ts';
28
+ import { UI } from '../ui/index.ts';
29
+ type ActiveArg<A, E, R> = {
30
+ readonly _tag: 'Active';
31
+ readonly provided: boolean;
32
+ readonly value: Effect.Effect<A | undefined, E, R>;
33
+ };
34
+ type InactiveArg = {
35
+ readonly _tag: 'Inactive';
36
+ };
37
+ type ArgState<A, E, R, CanBeInactive extends boolean> = ActiveArg<A, E, R> | (CanBeInactive extends true ? InactiveArg : never);
38
+ /**
39
+ * A parsed CLI arg that can be composed with Args helpers.
40
+ *
41
+ * Commands usually create one with text() or bool(), then finish with
42
+ * required() or optional().
43
+ *
44
+ * @example
45
+ * const name = yield* Args.text(opts, 'name').pipe(
46
+ * Args.prompt({ prompt: 'Client Name:' }),
47
+ * Args.required(),
48
+ * );
49
+ */
50
+ export interface Arg<A, E = never, R = never, CanBeInactive extends boolean = false> extends Pipeable {
51
+ readonly flag: string;
52
+ readonly state: Effect.Effect<ArgState<A, E, R, CanBeInactive>, E, R>;
53
+ }
54
+ export type ArgOptions = {
55
+ /**
56
+ * Use when the opts key is not the user-facing flag name.
57
+ *
58
+ * @example
59
+ * Args.text(opts, 'customRedirectUri', {
60
+ * simpleName: '--custom-redirect-uri',
61
+ * })
62
+ */
63
+ simpleName?: string;
64
+ };
65
+ type MissingOptions = {
66
+ message?: string;
67
+ };
68
+ type UnavailableOptions = {
69
+ message?: string;
70
+ };
71
+ /**
72
+ * @example
73
+ * if (Args.has(opts, 'custom-redirect-uri')) {
74
+ * // The user explicitly passed --custom-redirect-uri.
75
+ * }
76
+ */
77
+ declare function has(opts: Record<string, unknown>, key: string): boolean;
78
+ /**
79
+ * @example
80
+ * const configureWeb = Args.hasAny(opts, [
81
+ * 'team-id',
82
+ * 'key-id',
83
+ * 'private-key-file',
84
+ * ]);
85
+ */
86
+ declare function hasAny(opts: Record<string, unknown>, keys: string[]): boolean;
87
+ /**
88
+ * Returns true only for boolean true or the string "true".
89
+ *
90
+ * @example
91
+ * const useDevCredentials = Args.isTrue(opts, 'dev-credentials');
92
+ */
93
+ declare function isTrue(opts: Record<string, unknown>, key: string): boolean;
94
+ /**
95
+ * Starts a string arg pipeline. Strings are trimmed, numbers are stringified,
96
+ * empty values become missing values, and other types produce BadArgsError.
97
+ *
98
+ * @example
99
+ * const clientId = yield* Args.text(opts, 'client-id').pipe(
100
+ * Args.prompt(clientIdPrompt({ providerUrl })),
101
+ * Args.required(),
102
+ * );
103
+ */
104
+ declare function text(opts: Record<string, unknown>, key: string, options?: ArgOptions): Arg<string, BadArgsError>;
105
+ /**
106
+ * Starts a boolean arg pipeline. Accepts booleans and the strings "true" or
107
+ * "false"; other supplied values produce BadArgsError.
108
+ *
109
+ * @example
110
+ * const configureWeb = yield* Args.bool(opts, 'configure-web').pipe(
111
+ * Args.confirm({ promptText: 'Configure web redirect flow?' }),
112
+ * Args.required(),
113
+ * );
114
+ */
115
+ declare function bool(opts: Record<string, unknown>, key: string, options?: ArgOptions): Arg<boolean, BadArgsError>;
116
+ /**
117
+ * Gates an arg behind a mode or earlier choice.
118
+ *
119
+ * If the condition is false and the user supplied the flag, this returns an
120
+ * error.
121
+ *
122
+ * @example
123
+ * const clientSecret = yield* Args.text(opts, 'client-secret').pipe(
124
+ * Args.availableWhen(appType === 'web'),
125
+ * Args.prompt(clientSecretPrompt({ providerUrl })),
126
+ * Args.required(),
127
+ * );
128
+ */
129
+ declare function availableWhen(condition: boolean, options?: UnavailableOptions): <A, E, R, CanBeInactive extends boolean>(arg: Arg<A, E, R, CanBeInactive>) => Arg<A, BadArgsError | E, R, true>;
130
+ /**
131
+ * Prompts for a missing text value.
132
+ *
133
+ * With --yes, the prompt is skipped. If inputProps.defaultValue is set, that
134
+ * value is used. Otherwise the value stays missing.
135
+ *
136
+ * @example
137
+ * const clientName = yield* Args.text(opts, 'name').pipe(
138
+ * Args.prompt({
139
+ * prompt: 'Client Name:',
140
+ * defaultValue: suggestedClientName,
141
+ * }),
142
+ * Args.required(),
143
+ * );
144
+ */
145
+ declare function prompt(inputProps: UI.TextInputProps): <E, R, CanBeInactive extends boolean>(arg: Arg<string, E, R, CanBeInactive>) => Arg<string, E | BadArgsError, R | GlobalOpts, CanBeInactive>;
146
+ /**
147
+ * Prompts for a missing boolean value.
148
+ *
149
+ * With --yes, the prompt is skipped and confirmationProps.defaultValue is used.
150
+ *
151
+ * @example
152
+ * const configureWeb = yield* Args.bool(opts, 'configure-web').pipe(
153
+ * Args.confirm({
154
+ * promptText: 'Configure web redirect flow?',
155
+ * defaultValue: false,
156
+ * }),
157
+ * Args.required(),
158
+ * );
159
+ */
160
+ declare function confirm(confirmationProps: UI.ConfirmationProps): <E, R, CanBeInactive extends boolean>(arg: Arg<boolean, E, R, CanBeInactive>) => Arg<boolean, E | BadArgsError, R | GlobalOpts, CanBeInactive>;
161
+ /**
162
+ * Validates a present value. Return an error message to fail, or undefined to
163
+ * accept the value. Missing and inactive args pass through unchanged.
164
+ *
165
+ * @example
166
+ * const projectId = yield* Args.text(opts, 'project-id').pipe(
167
+ * Args.prompt(firebaseProjectIdPrompt({})),
168
+ * Args.validate(validateFirebaseProjectId),
169
+ * Args.required(),
170
+ * );
171
+ */
172
+ declare function validate<A>(validator: (value: A) => string | undefined): <E, R, CanBeInactive extends boolean>(arg: Arg<A, E, R, CanBeInactive>) => Arg<A, E | BadArgsError, R, CanBeInactive>;
173
+ /**
174
+ * Finishes a pipeline with a required value.
175
+ *
176
+ * Missing active args produce BadArgsError. Inactive args return undefined, so
177
+ * callers can skip downstream work for unavailable flags.
178
+ *
179
+ * @example
180
+ * const clientId = yield* Args.text(opts, 'client-id').pipe(
181
+ * Args.prompt(clientIdPrompt({ providerUrl })),
182
+ * Args.required(),
183
+ * );
184
+ */
185
+ declare function required(options?: MissingOptions): <A, E, R, CanBeInactive extends boolean>(arg: Arg<A, E, R, CanBeInactive>) => Effect.Effect<CanBeInactive extends true ? A | undefined : A, E | BadArgsError, R>;
186
+ /**
187
+ * Finishes a pipeline with an optional value.
188
+ *
189
+ * Missing and inactive args return undefined.
190
+ *
191
+ * @example
192
+ * const customRedirectUri = yield* Args.text(opts, 'custom-redirect-uri').pipe(
193
+ * Args.prompt(optionalRedirectPrompt),
194
+ * Args.optional(),
195
+ * );
196
+ */
197
+ declare function optional(): <A, E, R, CanBeInactive extends boolean>(arg: Arg<A, E, R, CanBeInactive>) => Effect.Effect<A | undefined, E, R>;
198
+ export declare const Args: {
199
+ text: typeof text;
200
+ bool: typeof bool;
201
+ has: typeof has;
202
+ hasAny: typeof hasAny;
203
+ isTrue: typeof isTrue;
204
+ availableWhen: typeof availableWhen;
205
+ prompt: typeof prompt;
206
+ confirm: typeof confirm;
207
+ validate: typeof validate;
208
+ required: typeof required;
209
+ optional: typeof optional;
210
+ };
211
+ export {};
212
+ //# sourceMappingURL=args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../../src/lib/args.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAiB,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAGpC,KAAK,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI;IACxB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;CACpD,CAAC;AAEF,KAAK,WAAW,GAAG;IACjB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B,CAAC;AAEF,KAAK,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,aAAa,SAAS,OAAO,IAChD,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAClB,CAAC,aAAa,SAAS,IAAI,GAAG,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