@metabase/cli 0.1.0-alpha.workspaces-commands.818a8f1 → 0.1.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 (110) hide show
  1. package/README.md +0 -237
  2. package/dist/{archive-BPG5c88Y.mjs → archive-CsWeHXle.mjs} +4 -5
  3. package/dist/{auth--Hpjwlaf.mjs → auth-BF7IjZIH.mjs} +3 -3
  4. package/dist/{body-DwU2s6Pg.mjs → body-Dv9hQ0Qk.mjs} +2 -2
  5. package/dist/{branches-BbcoJXfp.mjs → branches-BujtceGr.mjs} +4 -5
  6. package/dist/{cancel-task-BDas45YO.mjs → cancel-task-CT2xUMRg.mjs} +4 -5
  7. package/dist/card-_Ta7zdYe.mjs +19 -0
  8. package/dist/cli.mjs +13 -17
  9. package/dist/{create-DpnjQvPw.mjs → create-B8ektf-R.mjs} +6 -7
  10. package/dist/{create-_UOeEXAj.mjs → create-CI2Cunq5.mjs} +6 -7
  11. package/dist/{create-CwVcoq0O.mjs → create-DdbU3TLX.mjs} +6 -7
  12. package/dist/{create-branch-sDttBORB.mjs → create-branch-goZBTNnr.mjs} +4 -5
  13. package/dist/{current-task-BGt1mqaX.mjs → current-task-DBjRNCFq.mjs} +4 -5
  14. package/dist/{db-Dm2u2ISJ.mjs → db-DMghzgb6.mjs} +2 -2
  15. package/dist/{delete-DRBTgyus.mjs → delete-8vGU35r3.mjs} +5 -6
  16. package/dist/{delete-DUC_stoL.mjs → delete-B27KLF5X.mjs} +5 -6
  17. package/dist/{delete-runtime-inOVw3IX.mjs → delete-runtime-Byr60cR3.mjs} +2 -4
  18. package/dist/{delete-table-9Is631O_.mjs → delete-table-BNaJ_gA4.mjs} +5 -6
  19. package/dist/{dirty-CLjHbz6J.mjs → dirty-aNUuph4I.mjs} +4 -5
  20. package/dist/{export-D2Anfu3p.mjs → export-QDkuuzSE.mjs} +5 -6
  21. package/dist/{field-Dhs2AND3.mjs → field-DaYo_90x.mjs} +1 -1
  22. package/dist/{get-DhIoNeOp.mjs → get-BGBIzMKY.mjs} +4 -5
  23. package/dist/{get-CAVVmdMX.mjs → get-COXHplHP.mjs} +4 -5
  24. package/dist/{get-CAPLfawI.mjs → get-Cl8-IauC.mjs} +4 -5
  25. package/dist/{get-DDWpubE8.mjs → get-Cwpj7lDe.mjs} +5 -6
  26. package/dist/{get-BHJA78zg.mjs → get-DI_IJvgk.mjs} +4 -5
  27. package/dist/{get-2po1uv9i.mjs → get-Dh_acl8q.mjs} +4 -5
  28. package/dist/{get-qPOsuTPw.mjs → get-i6LWOByV.mjs} +4 -5
  29. package/dist/{has-remote-changes-DAL5jetW.mjs → has-remote-changes-hjKoQuRy.mjs} +4 -5
  30. package/dist/{import-CUMxUfSF.mjs → import-HJsSKRYx.mjs} +5 -6
  31. package/dist/{input-BNqSFl38.mjs → input-Dojr-RTw.mjs} +1 -1
  32. package/dist/{is-dirty-B10S6MG0.mjs → is-dirty-1Qy7hiHB.mjs} +2 -3
  33. package/dist/is-dirty-DpKn9HJp.mjs +8 -0
  34. package/dist/{key-CyhOpgWt.mjs → key-DBxPSFwi.mjs} +1 -1
  35. package/dist/{license-DtsGJi3l.mjs → license-MoWse3ZI.mjs} +3 -3
  36. package/dist/{list-Y7iGsOfE.mjs → list-Bk6RsbJl.mjs} +3 -4
  37. package/dist/{list-DeFGwhhJ.mjs → list-C4Ajrw8f.mjs} +3 -4
  38. package/dist/{list-C5MGydGU.mjs → list-C8tdLOH5.mjs} +3 -4
  39. package/dist/{list-evtQS7jl.mjs → list-CBSBHtK-.mjs} +3 -4
  40. package/dist/{list-qetY9OIN.mjs → list-CWt3fqrZ.mjs} +3 -4
  41. package/dist/{list-OBx5B3gd.mjs → list-C_PRdL5e.mjs} +5 -6
  42. package/dist/{login-Dqw9ZtCx.mjs → login-C9WTwNn6.mjs} +4 -5
  43. package/dist/{logout-DwYJ5OUi.mjs → logout-oLszGCOg.mjs} +3 -4
  44. package/dist/{package-t8dKf4m_.mjs → package-BGfw4ZWJ.mjs} +1 -2
  45. package/dist/parse-id-BhmmfyCP.mjs +14 -0
  46. package/dist/{poll-D2sXM5rc.mjs → poll-ILanYysl.mjs} +1 -1
  47. package/dist/{poll-task-Byiunmaj.mjs → poll-task-DbpsiQhl.mjs} +2 -2
  48. package/dist/{prompt-fXeNtj0M.mjs → prompt-DpT8yAVy.mjs} +1 -1
  49. package/dist/{query-BnGVGeM3.mjs → query-PihYi-UZ.mjs} +4 -5
  50. package/dist/{remove-Bx48o-0S.mjs → remove-B2hVYn1v.mjs} +3 -4
  51. package/dist/{run-D4NgvaRh.mjs → run-C2so6Qp6.mjs} +27 -11
  52. package/dist/{runtime-DUgFfYkN.mjs → runtime-C9CEZhcn.mjs} +335 -203
  53. package/dist/{search-4wKx5ug2.mjs → search-CopOytXY.mjs} +4 -5
  54. package/dist/{set-BZnCRL4c.mjs → set-BcF7M1GQ.mjs} +4 -5
  55. package/dist/{set-DCjrmTFm.mjs → set-CbibegpA.mjs} +6 -7
  56. package/dist/{setting-C4vQSqer.mjs → setting-U3NtBMFo.mjs} +3 -3
  57. package/dist/{stash-ZZkmW_V7.mjs → stash-DOBbYozC.mjs} +5 -6
  58. package/dist/{status-DezF-PIM.mjs → status-Buf1ZbNR.mjs} +5 -6
  59. package/dist/{status-JH6BZppo.mjs → status-CUcs8XBH.mjs} +2 -3
  60. package/dist/{status-9KAPIpX8.mjs → status-D1F5XHae.mjs} +2 -3
  61. package/dist/sync-BPyGXfUk.mjs +26 -0
  62. package/dist/{table-BvAr2ixC.mjs → table-Cfk7oSvw.mjs} +1 -1
  63. package/dist/{table-D-Mb5Nvw.mjs → table-D7nJt7JO.mjs} +2 -2
  64. package/dist/transform-UbyewMxY.mjs +21 -0
  65. package/dist/transform-job-CrYkr-Ma.mjs +19 -0
  66. package/dist/{update-DxKlQ0hP.mjs → update-CL8tRbxr.mjs} +7 -8
  67. package/dist/{update-CDtm71m2.mjs → update-DU2oU2j-.mjs} +7 -8
  68. package/dist/{wait-Cj_8wu4y.mjs → wait-Bugr9eXD.mjs} +5 -6
  69. package/package.json +1 -2
  70. package/dist/api-key-D9XxErQn.mjs +0 -13
  71. package/dist/card-D4zZSPUb.mjs +0 -19
  72. package/dist/create-Bd_U1zWU.mjs +0 -124
  73. package/dist/create-CCzsCZMm.mjs +0 -47
  74. package/dist/credentials-C0xKke5D.mjs +0 -84
  75. package/dist/database-4V1iiPEx.mjs +0 -17
  76. package/dist/deprovision-BAMzZc6f.mjs +0 -60
  77. package/dist/docker-QWVMG2gl.mjs +0 -605
  78. package/dist/eid-BNhutC1U.mjs +0 -13
  79. package/dist/flag-pair-CWvvzDJ_.mjs +0 -17
  80. package/dist/is-dirty-CUuq-aB6.mjs +0 -9
  81. package/dist/list-B8s7Qnzk.mjs +0 -31
  82. package/dist/logs-B_lrY7Js.mjs +0 -57
  83. package/dist/parse-id-C1prc9US.mjs +0 -12
  84. package/dist/provision-DC4_HWZD.mjs +0 -80
  85. package/dist/ps-1bZKIwWh.mjs +0 -9
  86. package/dist/ps-BiOrecEe.mjs +0 -78
  87. package/dist/remove-DecoZzNd.mjs +0 -97
  88. package/dist/render-DlBijc5i.mjs +0 -179
  89. package/dist/setup-Dqh9hN6l.mjs +0 -70
  90. package/dist/start-xXQypG5L.mjs +0 -324
  91. package/dist/stop-br-ZOnve.mjs +0 -80
  92. package/dist/sync-C7VOWD00.mjs +0 -26
  93. package/dist/transform-CqxZwhGs.mjs +0 -21
  94. package/dist/transform-job-HjbqjEoP.mjs +0 -19
  95. package/dist/translate-DJxDVAE4.mjs +0 -110
  96. package/dist/update-DYVeVjk2.mjs +0 -76
  97. package/dist/url-DP88YHNo.mjs +0 -53
  98. package/dist/wait-DwZN3ZwR.mjs +0 -19
  99. package/dist/wait-flags-CjW4ogUJ.mjs +0 -35
  100. package/dist/workspace-CbwR0vX_.mjs +0 -24
  101. package/dist/workspace-Dr9lWU3D.mjs +0 -72
  102. package/dist/workspace-credentials-q5RRFMT8.mjs +0 -139
  103. /package/dist/{body-flags-7oqLhu5j.mjs → body-flags-BUA9XV1u.mjs} +0 -0
  104. /package/dist/{card-C31pGtBZ.mjs → card-CsXk8T6A.mjs} +0 -0
  105. /package/dist/{database-BTX5qbSv.mjs → database-PA9Goi25.mjs} +0 -0
  106. /package/dist/{field-QwBMAWsq.mjs → field-C8IVs6rp.mjs} +0 -0
  107. /package/dist/{manifest-wzEFG0JB.mjs → manifest-CAdjQYH8.mjs} +0 -0
  108. /package/dist/{setting-DM7pm7yh.mjs → setting-26ckqHAP.mjs} +0 -0
  109. /package/dist/{transform-DfVkUttP.mjs → transform-B5uRpg1G.mjs} +0 -0
  110. /package/dist/{transform-job-DuB_OjhO.mjs → transform-job-C7QXWTVE.mjs} +0 -0
@@ -1,10 +1,9 @@
1
- import "./package-t8dKf4m_.mjs";
1
+ import "./package-BGfw4ZWJ.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DlBijc5i.mjs";
4
- import { ConfigError, connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DUgFfYkN.mjs";
5
- import { parseId } from "./parse-id-C1prc9US.mjs";
6
- import { REMOTE_SYNC_PATHS, SyncTask, pollFlags, pollSyncTask, throwIfFailedTask } from "./poll-task-Byiunmaj.mjs";
7
- import "./poll-D2sXM5rc.mjs";
3
+ import { ConfigError, connectionFlags, defineMetabaseCommand, outputFlags, profileFlag, renderItem } from "./runtime-C9CEZhcn.mjs";
4
+ import { parseId } from "./parse-id-BhmmfyCP.mjs";
5
+ import { REMOTE_SYNC_PATHS, SyncTask, pollFlags, pollSyncTask, throwIfFailedTask } from "./poll-task-DbpsiQhl.mjs";
6
+ import "./poll-ILanYysl.mjs";
8
7
  import { z } from "zod";
9
8
 
10
9
  //#region src/commands/sync/stash.ts
@@ -1,10 +1,9 @@
1
- import "./package-t8dKf4m_.mjs";
1
+ import "./package-BGfw4ZWJ.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DlBijc5i.mjs";
4
- import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DUgFfYkN.mjs";
5
- import { REMOTE_SYNC_PATHS, SyncTask, fetchCurrentTask, fetchOptionalParsed } from "./poll-task-Byiunmaj.mjs";
6
- import "./poll-D2sXM5rc.mjs";
7
- import { IsDirtyResult } from "./is-dirty-B10S6MG0.mjs";
3
+ import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag, renderItem } from "./runtime-C9CEZhcn.mjs";
4
+ import { REMOTE_SYNC_PATHS, SyncTask, fetchCurrentTask, fetchOptionalParsed } from "./poll-task-DbpsiQhl.mjs";
5
+ import "./poll-ILanYysl.mjs";
6
+ import { IsDirtyResult } from "./is-dirty-1Qy7hiHB.mjs";
8
7
  import { z } from "zod";
9
8
 
10
9
  //#region src/commands/sync/status.ts
@@ -1,7 +1,6 @@
1
- import "./package-t8dKf4m_.mjs";
1
+ import "./package-BGfw4ZWJ.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DlBijc5i.mjs";
4
- import { account, credentials, defineMetabaseCommand, originOnly, outputFlags, profileFlag, resolveProfileName } from "./runtime-DUgFfYkN.mjs";
3
+ import { account, credentials, defineMetabaseCommand, originOnly, outputFlags, profileFlag, renderItem, resolveProfileName } from "./runtime-C9CEZhcn.mjs";
5
4
  import { z } from "zod";
6
5
 
7
6
  //#region src/commands/auth/status.ts
@@ -1,7 +1,6 @@
1
- import "./package-t8dKf4m_.mjs";
1
+ import "./package-BGfw4ZWJ.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DlBijc5i.mjs";
4
- import { account, credentials, defineMetabaseCommand, outputFlags } from "./runtime-DUgFfYkN.mjs";
3
+ import { account, credentials, defineMetabaseCommand, outputFlags, renderItem } from "./runtime-C9CEZhcn.mjs";
5
4
  import { z } from "zod";
6
5
 
7
6
  //#region src/commands/license/status.ts
@@ -0,0 +1,26 @@
1
+ import { defineCommand } from "citty";
2
+
3
+ //#region src/commands/sync/index.ts
4
+ var sync_default = defineCommand({
5
+ meta: {
6
+ name: "sync",
7
+ description: "Remote-sync operations (import, export, status, branches)"
8
+ },
9
+ subCommands: {
10
+ status: () => import("./status-Buf1ZbNR.mjs").then((mod) => mod.default),
11
+ "is-dirty": () => import("./is-dirty-DpKn9HJp.mjs").then((mod) => mod.default),
12
+ "has-remote-changes": () => import("./has-remote-changes-hjKoQuRy.mjs").then((mod) => mod.default),
13
+ dirty: () => import("./dirty-aNUuph4I.mjs").then((mod) => mod.default),
14
+ "current-task": () => import("./current-task-DBjRNCFq.mjs").then((mod) => mod.default),
15
+ "cancel-task": () => import("./cancel-task-CT2xUMRg.mjs").then((mod) => mod.default),
16
+ wait: () => import("./wait-Bugr9eXD.mjs").then((mod) => mod.default),
17
+ import: () => import("./import-HJsSKRYx.mjs").then((mod) => mod.default),
18
+ export: () => import("./export-QDkuuzSE.mjs").then((mod) => mod.default),
19
+ stash: () => import("./stash-DOBbYozC.mjs").then((mod) => mod.default),
20
+ branches: () => import("./branches-BujtceGr.mjs").then((mod) => mod.default),
21
+ "create-branch": () => import("./create-branch-goZBTNnr.mjs").then((mod) => mod.default)
22
+ }
23
+ });
24
+
25
+ //#endregion
26
+ export { sync_default as default };
@@ -1,4 +1,4 @@
1
- import { Field } from "./field-QwBMAWsq.mjs";
1
+ import { Field } from "./field-C8IVs6rp.mjs";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/domain/table.ts
@@ -7,8 +7,8 @@ var table_default = defineCommand({
7
7
  description: "Inspect Metabase tables"
8
8
  },
9
9
  subCommands: {
10
- list: () => import("./list-OBx5B3gd.mjs").then((m) => m.default),
11
- get: () => import("./get-DDWpubE8.mjs").then((m) => m.default)
10
+ list: () => import("./list-C_PRdL5e.mjs").then((m) => m.default),
11
+ get: () => import("./get-Cwpj7lDe.mjs").then((m) => m.default)
12
12
  }
13
13
  });
14
14
 
@@ -0,0 +1,21 @@
1
+ import { defineCommand } from "citty";
2
+
3
+ //#region src/commands/transform/index.ts
4
+ var transform_default = defineCommand({
5
+ meta: {
6
+ name: "transform",
7
+ description: "Manage Metabase transforms"
8
+ },
9
+ subCommands: {
10
+ list: () => import("./list-CWt3fqrZ.mjs").then((mod) => mod.default),
11
+ get: () => import("./get-i6LWOByV.mjs").then((mod) => mod.default),
12
+ create: () => import("./create-CI2Cunq5.mjs").then((mod) => mod.default),
13
+ update: () => import("./update-DU2oU2j-.mjs").then((mod) => mod.default),
14
+ delete: () => import("./delete-8vGU35r3.mjs").then((mod) => mod.default),
15
+ "delete-table": () => import("./delete-table-BNaJ_gA4.mjs").then((mod) => mod.default),
16
+ run: () => import("./run-C2so6Qp6.mjs").then((mod) => mod.default)
17
+ }
18
+ });
19
+
20
+ //#endregion
21
+ export { transform_default as default };
@@ -0,0 +1,19 @@
1
+ import { defineCommand } from "citty";
2
+
3
+ //#region src/commands/transform-job/index.ts
4
+ var transform_job_default = defineCommand({
5
+ meta: {
6
+ name: "transform-job",
7
+ description: "Manage Metabase transform jobs"
8
+ },
9
+ subCommands: {
10
+ list: () => import("./list-C8tdLOH5.mjs").then((mod) => mod.default),
11
+ get: () => import("./get-BGBIzMKY.mjs").then((mod) => mod.default),
12
+ create: () => import("./create-B8ektf-R.mjs").then((mod) => mod.default),
13
+ update: () => import("./update-CL8tRbxr.mjs").then((mod) => mod.default),
14
+ delete: () => import("./delete-B27KLF5X.mjs").then((mod) => mod.default)
15
+ }
16
+ });
17
+
18
+ //#endregion
19
+ export { transform_job_default as default };
@@ -1,12 +1,11 @@
1
- import "./package-t8dKf4m_.mjs";
1
+ import "./package-BGfw4ZWJ.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DlBijc5i.mjs";
4
- import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DUgFfYkN.mjs";
5
- import "./input-BNqSFl38.mjs";
6
- import { readBody } from "./body-DwU2s6Pg.mjs";
7
- import { bodyInputFlags } from "./body-flags-7oqLhu5j.mjs";
8
- import { parseId } from "./parse-id-C1prc9US.mjs";
9
- import { TransformJob, TransformJobUpdateInput, transformJobView } from "./transform-job-DuB_OjhO.mjs";
3
+ import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag, renderItem } from "./runtime-C9CEZhcn.mjs";
4
+ import "./input-Dojr-RTw.mjs";
5
+ import { parseId } from "./parse-id-BhmmfyCP.mjs";
6
+ import { readBody } from "./body-Dv9hQ0Qk.mjs";
7
+ import { bodyInputFlags } from "./body-flags-BUA9XV1u.mjs";
8
+ import { TransformJob, TransformJobUpdateInput, transformJobView } from "./transform-job-C7QXWTVE.mjs";
10
9
 
11
10
  //#region src/commands/transform-job/update.ts
12
11
  var update_default = defineMetabaseCommand({
@@ -1,12 +1,11 @@
1
- import "./package-t8dKf4m_.mjs";
1
+ import "./package-BGfw4ZWJ.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DlBijc5i.mjs";
4
- import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DUgFfYkN.mjs";
5
- import "./input-BNqSFl38.mjs";
6
- import { readBody } from "./body-DwU2s6Pg.mjs";
7
- import { bodyInputFlags } from "./body-flags-7oqLhu5j.mjs";
8
- import { parseId } from "./parse-id-C1prc9US.mjs";
9
- import { Transform, TransformUpdateInput, transformView } from "./transform-DfVkUttP.mjs";
3
+ import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag, renderItem } from "./runtime-C9CEZhcn.mjs";
4
+ import "./input-Dojr-RTw.mjs";
5
+ import { parseId } from "./parse-id-BhmmfyCP.mjs";
6
+ import { readBody } from "./body-Dv9hQ0Qk.mjs";
7
+ import { bodyInputFlags } from "./body-flags-BUA9XV1u.mjs";
8
+ import { Transform, TransformUpdateInput, transformView } from "./transform-B5uRpg1G.mjs";
10
9
 
11
10
  //#region src/commands/transform/update.ts
12
11
  var update_default = defineMetabaseCommand({
@@ -1,10 +1,9 @@
1
- import "./package-t8dKf4m_.mjs";
1
+ import "./package-BGfw4ZWJ.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DlBijc5i.mjs";
4
- import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DUgFfYkN.mjs";
5
- import { parseId } from "./parse-id-C1prc9US.mjs";
6
- import { SyncTaskOrIdle, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-Byiunmaj.mjs";
7
- import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-D2sXM5rc.mjs";
3
+ import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag, renderItem } from "./runtime-C9CEZhcn.mjs";
4
+ import { parseId } from "./parse-id-BhmmfyCP.mjs";
5
+ import { SyncTaskOrIdle, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-DbpsiQhl.mjs";
6
+ import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-ILanYysl.mjs";
8
7
 
9
8
  //#region src/commands/sync/wait.ts
10
9
  const WaitResult = SyncTaskOrIdle;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metabase/cli",
3
- "version": "0.1.0-alpha.workspaces-commands.818a8f1",
3
+ "version": "0.1.0",
4
4
  "description": "Metabase CLI",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
@@ -42,7 +42,6 @@
42
42
  "@napi-rs/keyring": "^1.3.0",
43
43
  "citty": "^0.2.2",
44
44
  "cli-table3": "^0.6.5",
45
- "yaml": "^2.8.4",
46
45
  "zod": "^4.0.0"
47
46
  },
48
47
  "devDependencies": {
@@ -1,13 +0,0 @@
1
- import { defineCommand } from "citty";
2
-
3
- //#region src/commands/api-key/index.ts
4
- var api_key_default = defineCommand({
5
- meta: {
6
- name: "api-key",
7
- description: "Manage Metabase API keys"
8
- },
9
- subCommands: { create: () => import("./create-Bd_U1zWU.mjs").then((mod) => mod.default) }
10
- });
11
-
12
- //#endregion
13
- export { api_key_default as default };
@@ -1,19 +0,0 @@
1
- import { defineCommand } from "citty";
2
-
3
- //#region src/commands/card/index.ts
4
- var card_default = defineCommand({
5
- meta: {
6
- name: "card",
7
- description: "Manage Metabase cards (questions, models, metrics)"
8
- },
9
- subCommands: {
10
- list: () => import("./list-DeFGwhhJ.mjs").then((mod) => mod.default),
11
- get: () => import("./get-CAPLfawI.mjs").then((mod) => mod.default),
12
- query: () => import("./query-BnGVGeM3.mjs").then((mod) => mod.default),
13
- create: () => import("./create-CwVcoq0O.mjs").then((mod) => mod.default),
14
- archive: () => import("./archive-BPG5c88Y.mjs").then((mod) => mod.default)
15
- }
16
- });
17
-
18
- //#endregion
19
- export { card_default as default };
@@ -1,124 +0,0 @@
1
- import "./package-t8dKf4m_.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DlBijc5i.mjs";
4
- import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DUgFfYkN.mjs";
5
- import "./input-BNqSFl38.mjs";
6
- import { readBody } from "./body-DwU2s6Pg.mjs";
7
- import { bodyInputFlags } from "./body-flags-7oqLhu5j.mjs";
8
- import { requireBothOrNeither } from "./flag-pair-CWvvzDJ_.mjs";
9
- import { parseId } from "./parse-id-C1prc9US.mjs";
10
- import { z } from "zod";
11
-
12
- //#region src/domain/api-key.ts
13
- const ApiKeyCreateInput = z.object({
14
- name: z.string().min(1),
15
- group_id: z.number().int().positive()
16
- }).loose();
17
- const ApiKeyGroup = z.object({
18
- id: z.number().int().nullable(),
19
- name: z.string().nullable()
20
- }).loose();
21
- const ApiKeyUpdatedBy = z.object({
22
- id: z.number().int(),
23
- common_name: z.string().nullable().optional()
24
- }).loose();
25
- const ApiKey = z.object({
26
- id: z.number().int(),
27
- name: z.string(),
28
- group: ApiKeyGroup.nullable().optional(),
29
- unmasked_key: z.string().nullable().optional(),
30
- masked_key: z.string().nullable().optional(),
31
- updated_by: ApiKeyUpdatedBy.nullable().optional(),
32
- created_at: z.string().nullable().optional(),
33
- updated_at: z.string().nullable().optional()
34
- }).loose();
35
- const ApiKeyCompact = ApiKey.pick({
36
- id: true,
37
- name: true,
38
- group: true,
39
- masked_key: true
40
- }).strip();
41
- const apiKeyView = {
42
- compactPick: ApiKeyCompact,
43
- tableColumns: [
44
- {
45
- key: "id",
46
- label: "ID"
47
- },
48
- {
49
- key: "name",
50
- label: "Name"
51
- },
52
- {
53
- key: "group",
54
- label: "Group",
55
- format: (value) => formatGroup(value)
56
- },
57
- {
58
- key: "unmasked_key",
59
- label: "Key"
60
- }
61
- ]
62
- };
63
- function formatGroup(value) {
64
- const parsed = ApiKeyGroup.nullable().safeParse(value);
65
- if (!parsed.success || parsed.data === null) return "";
66
- const { id, name } = parsed.data;
67
- if (name === null && id === null) return "";
68
- if (name === null) return String(id);
69
- return id === null ? name : `${name} (${id})`;
70
- }
71
-
72
- //#endregion
73
- //#region src/commands/api-key/create.ts
74
- var create_default = defineMetabaseCommand({
75
- meta: {
76
- name: "create",
77
- description: "Create a new API key"
78
- },
79
- args: {
80
- ...outputFlags,
81
- ...profileFlag,
82
- ...connectionFlags,
83
- ...bodyInputFlags,
84
- name: {
85
- type: "string",
86
- description: "API key name (alternative to --body / --file)"
87
- },
88
- "group-id": {
89
- type: "string",
90
- description: "Permission group id (alternative to --body / --file)"
91
- }
92
- },
93
- outputSchema: ApiKey,
94
- examples: [
95
- "metabase api-key create --name \"deploy-bot\" --group-id 2",
96
- "echo '{\"name\":\"k\",\"group_id\":2}' | metabase api-key create",
97
- "metabase api-key create --file key.json"
98
- ],
99
- async run({ args, ctx, getClient }) {
100
- const pair = requireBothOrNeither({
101
- name: "--name",
102
- value: args.name
103
- }, {
104
- name: "--group-id",
105
- value: args["group-id"]
106
- });
107
- const body = pair ? ApiKeyCreateInput.parse({
108
- name: pair.first,
109
- group_id: parseId(pair.second, "--group-id")
110
- }) : await readBody({
111
- flag: args.body,
112
- file: args.file
113
- }, ApiKeyCreateInput);
114
- const client = await getClient();
115
- const created = await client.requestParsed(ApiKey, "/api/api-key", {
116
- method: "POST",
117
- body
118
- });
119
- renderItem(created, apiKeyView, ctx);
120
- }
121
- });
122
-
123
- //#endregion
124
- export { create_default as default };
@@ -1,47 +0,0 @@
1
- import "./package-t8dKf4m_.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DlBijc5i.mjs";
4
- import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DUgFfYkN.mjs";
5
- import "./input-BNqSFl38.mjs";
6
- import { readBody } from "./body-DwU2s6Pg.mjs";
7
- import { bodyInputFlags } from "./body-flags-7oqLhu5j.mjs";
8
- import { Workspace, WorkspaceCreateInput, workspaceView } from "./workspace-Dr9lWU3D.mjs";
9
-
10
- //#region src/commands/workspace/create.ts
11
- var create_default = defineMetabaseCommand({
12
- meta: {
13
- name: "create",
14
- description: "Create a workspace"
15
- },
16
- args: {
17
- ...outputFlags,
18
- ...profileFlag,
19
- ...connectionFlags,
20
- ...bodyInputFlags,
21
- name: {
22
- type: "string",
23
- description: "Workspace name (alternative to --body / --file)"
24
- }
25
- },
26
- outputSchema: Workspace,
27
- examples: [
28
- "metabase workspace create --name \"analytics\"",
29
- "echo '{\"name\":\"analytics\"}' | metabase workspace create",
30
- "metabase workspace create --file workspace.json"
31
- ],
32
- async run({ args, ctx, getClient }) {
33
- const body = args.name !== void 0 && args.name !== "" ? WorkspaceCreateInput.parse({ name: args.name }) : await readBody({
34
- flag: args.body,
35
- file: args.file
36
- }, WorkspaceCreateInput);
37
- const client = await getClient();
38
- const created = await client.requestParsed(Workspace, "/api/ee/workspace-manager", {
39
- method: "POST",
40
- body
41
- });
42
- renderItem(created, workspaceView, ctx);
43
- }
44
- });
45
-
46
- //#endregion
47
- export { create_default as default };
@@ -1,84 +0,0 @@
1
- import "./package-t8dKf4m_.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import { renderItem } from "./render-DlBijc5i.mjs";
4
- import { defineMetabaseCommand, localUrl, outputFlags, parseJson } from "./runtime-DUgFfYkN.mjs";
5
- import { parseId } from "./parse-id-C1prc9US.mjs";
6
- import "./poll-D2sXM5rc.mjs";
7
- import { checkDockerReady, readContainerCredentialsFile, requireWorkspaceContainerLocation } from "./docker-QWVMG2gl.mjs";
8
- import { WorkspaceCredentials } from "./workspace-credentials-q5RRFMT8.mjs";
9
- import { z } from "zod";
10
-
11
- //#region src/commands/workspace/credentials.ts
12
- const WorkspaceCredentialsResult = z.object({
13
- workspace_id: z.number().int().positive(),
14
- url: z.string(),
15
- email: z.string(),
16
- password: z.string(),
17
- api_key_name: z.string(),
18
- api_key: z.string()
19
- });
20
- const credentialsView = {
21
- compactPick: WorkspaceCredentialsResult,
22
- tableColumns: [
23
- {
24
- key: "workspace_id",
25
- label: "ID"
26
- },
27
- {
28
- key: "url",
29
- label: "URL"
30
- },
31
- {
32
- key: "email",
33
- label: "Email"
34
- },
35
- {
36
- key: "password",
37
- label: "Password"
38
- },
39
- {
40
- key: "api_key_name",
41
- label: "API Key Name"
42
- },
43
- {
44
- key: "api_key",
45
- label: "API Key"
46
- }
47
- ]
48
- };
49
- const textDecoder = new TextDecoder("utf-8");
50
- var credentials_default = defineMetabaseCommand({
51
- meta: {
52
- name: "credentials",
53
- description: "Read the workspace child instance's admin credentials (email + password + API key) from the running container"
54
- },
55
- args: {
56
- ...outputFlags,
57
- id: {
58
- type: "positional",
59
- description: "Workspace id",
60
- required: true
61
- }
62
- },
63
- outputSchema: WorkspaceCredentialsResult,
64
- examples: ["metabase workspace credentials 1", "metabase workspace credentials 1 --json"],
65
- async run({ args, ctx }) {
66
- const workspaceId = parseId(args.id);
67
- await checkDockerReady();
68
- const { containerName, hostPort } = await requireWorkspaceContainerLocation(workspaceId);
69
- const bytes = await readContainerCredentialsFile(workspaceId);
70
- const credentials = parseJson(textDecoder.decode(bytes), WorkspaceCredentials, { source: `${containerName}:credentials.json` });
71
- const result = {
72
- workspace_id: workspaceId,
73
- url: localUrl(hostPort),
74
- email: credentials.user.email,
75
- password: credentials.user.password,
76
- api_key_name: credentials.api_key.name,
77
- api_key: credentials.api_key.key
78
- };
79
- renderItem(result, credentialsView, ctx);
80
- }
81
- });
82
-
83
- //#endregion
84
- export { credentials_default as default };
@@ -1,17 +0,0 @@
1
- import { defineCommand } from "citty";
2
-
3
- //#region src/commands/workspace/database/index.ts
4
- var database_default = defineCommand({
5
- meta: {
6
- name: "database",
7
- description: "Manage databases provisioned to a workspace"
8
- },
9
- subCommands: {
10
- provision: () => import("./provision-DC4_HWZD.mjs").then((mod) => mod.default),
11
- update: () => import("./update-DYVeVjk2.mjs").then((mod) => mod.default),
12
- deprovision: () => import("./deprovision-BAMzZc6f.mjs").then((mod) => mod.default)
13
- }
14
- });
15
-
16
- //#endregion
17
- export { database_default as default };
@@ -1,60 +0,0 @@
1
- import "./package-t8dKf4m_.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import "./render-DlBijc5i.mjs";
4
- import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DUgFfYkN.mjs";
5
- import { parseId } from "./parse-id-C1prc9US.mjs";
6
- import "./prompt-fXeNtj0M.mjs";
7
- import "./poll-D2sXM5rc.mjs";
8
- import { DeleteResult, confirmAndDelete } from "./delete-runtime-inOVw3IX.mjs";
9
- import { parseWaitFlags, waitFlags } from "./wait-flags-CjW4ogUJ.mjs";
10
- import "./workspace-Dr9lWU3D.mjs";
11
- import { waitForDatabaseGone } from "./wait-DwZN3ZwR.mjs";
12
-
13
- //#region src/commands/workspace/database/deprovision.ts
14
- var deprovision_default = defineMetabaseCommand({
15
- meta: {
16
- name: "deprovision",
17
- description: "Deprovision a database from a workspace"
18
- },
19
- args: {
20
- ...outputFlags,
21
- ...profileFlag,
22
- ...connectionFlags,
23
- ...waitFlags,
24
- yes: {
25
- type: "boolean",
26
- description: "Skip confirmation",
27
- default: false
28
- },
29
- id: {
30
- type: "positional",
31
- description: "Workspace id",
32
- required: true
33
- },
34
- "db-id": {
35
- type: "positional",
36
- description: "Database id",
37
- required: true
38
- }
39
- },
40
- outputSchema: DeleteResult,
41
- examples: ["metabase workspace database deprovision 1 5 --yes", "metabase workspace database deprovision 1 5 --yes --wait"],
42
- async run({ args, ctx, getClient }) {
43
- const workspaceId = parseId(args.id);
44
- const databaseId = parseId(args["db-id"], "db-id");
45
- const wait = parseWaitFlags(args);
46
- const client = await getClient();
47
- await confirmAndDelete({
48
- id: databaseId,
49
- path: `/api/ee/workspace-manager/${workspaceId}/database/${databaseId}`,
50
- yes: args.yes,
51
- promptMessage: `Deprovision database ${databaseId} from workspace ${workspaceId}?`,
52
- client,
53
- ctx,
54
- ...wait.enabled ? { afterDelete: () => waitForDatabaseGone(client, workspaceId, databaseId, wait.schedule) } : {}
55
- });
56
- }
57
- });
58
-
59
- //#endregion
60
- export { deprovision_default as default };