@metabase/cli 0.1.18 → 0.2.1-alpha.bcm-ghy-4075-spawn-default-profile.eb120d1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +283 -45
- package/dist/add-collection-CCpC-GUz.mjs +9 -0
- package/dist/{add-collection-CRZAFCZy.mjs → add-collection-CLXfrgp4.mjs} +4 -5
- package/dist/append-DMcxP1LM.mjs +42 -0
- package/dist/archive-4WqMsPWB.mjs +38 -0
- package/dist/{archive-De4yVEV8.mjs → archive-5inmbMDL.mjs} +5 -7
- package/dist/{archive-3mEhK9_H.mjs → archive-BggM_AuL.mjs} +5 -7
- package/dist/{archive-Z8ZM-ilB.mjs → archive-BmhehbS0.mjs} +8 -9
- package/dist/{archive-d74nDcp4.mjs → archive-BwIZzWGe.mjs} +5 -7
- package/dist/{archive-CFHYRF65.mjs → archive-DErhQn8A.mjs} +5 -7
- package/dist/archive-DTnz1suV.mjs +38 -0
- package/dist/{archive-C3RWdM-2.mjs → archive-Q1387APe.mjs} +7 -8
- package/dist/{archive-errg-EKw.mjs → archive-h-3H5b4K.mjs} +5 -7
- package/dist/auth-DzCAiArV.mjs +22 -0
- package/dist/{body-BS2s2zDl.mjs → body-5snfmiwR.mjs} +3 -3
- package/dist/{branches-mcyT7wI-.mjs → branches-PL170CYS.mjs} +5 -7
- package/dist/{cancel-B2l-i2NS.mjs → cancel-EFKcF5J_.mjs} +4 -6
- package/dist/{cancel-task-CugcIeIi.mjs → cancel-task-mFFx0d5m.mjs} +5 -7
- package/dist/capabilities-CiaAfUgX.mjs +684 -0
- package/dist/{card-DEmcRlNO.mjs → card-B8G5jQQT.mjs} +24 -18
- package/dist/card-BsfdXK0O.mjs +26 -0
- package/dist/{cards-BGkz5BeZ.mjs → cards-BI7zKb9M.mjs} +7 -8
- package/dist/cli.mjs +178 -29
- package/dist/collection-2h_by9Ue.mjs +23 -0
- package/dist/{collection-DrLpA1SO.mjs → collection-C52Ndi_O.mjs} +5 -3
- package/dist/{collection-namespace-BP_LJrAD.mjs → collection-namespace-uNA5WhLB.mjs} +2 -2
- package/dist/{create-Cztp5kES.mjs → create-BLD0YniB.mjs} +6 -7
- package/dist/create-BP8EIWrP.mjs +161 -0
- package/dist/{create-CkRFKtFG.mjs → create-BpizGzgQ.mjs} +8 -9
- package/dist/create-BxCsAdqc.mjs +45 -0
- package/dist/{create-DzyMvAVy.mjs → create-CBKT7SE_.mjs} +8 -9
- package/dist/{create-D8KA4zJA.mjs → create-CQ32FwVe.mjs} +11 -11
- package/dist/{create-YfGzANNB.mjs → create-CU3bYpsT.mjs} +8 -9
- package/dist/create-DAH24ltu.mjs +45 -0
- package/dist/{create-BOmmMSjF.mjs → create-DutkaD7P.mjs} +11 -12
- package/dist/{create-B4HAEEE0.mjs → create-FuZa4j1N.mjs} +8 -9
- package/dist/{create-wpvDXSSY.mjs → create-KveE3j3p.mjs} +12 -13
- package/dist/{create-DhrftYre.mjs → create-VrSowEbj.mjs} +14 -14
- package/dist/{create-CD9Rp8qs.mjs → create-acWKw4Y1.mjs} +14 -14
- package/dist/{create-branch-DsoMfx_2.mjs → create-branch-CP1Y4_El.mjs} +5 -7
- package/dist/{create-kWzqvTGR.mjs → create-xPfmI1Tu.mjs} +11 -12
- package/dist/csv-CZyYi0vi.mjs +58 -0
- package/dist/{current-task-WuKPZpZ6.mjs → current-task-BR4koo9z.mjs} +5 -7
- package/dist/dashboard-ARgJfamb.mjs +35 -0
- package/dist/{dashboard-DOplbKyQ.mjs → dashboard-BLihjDXg.mjs} +35 -15
- package/dist/{database-D9fftP-i.mjs → database-BOqzcexD.mjs} +2 -2
- package/dist/db-dbnxMPSR.mjs +27 -0
- package/dist/{delete-Buai0_e_.mjs → delete-BpL3vaaT.mjs} +6 -8
- package/dist/{delete-BCitmugk.mjs → delete-C5DqDwev.mjs} +6 -8
- package/dist/delete-DCDFLHFa.mjs +49 -0
- package/dist/delete-P2Qlsr_s.mjs +49 -0
- package/dist/{delete-CmGh0jo1.mjs → delete-ea_ns1uM.mjs} +6 -8
- package/dist/{delete-runtime-B0ha5QR4.mjs → delete-runtime-DdBn6poA.mjs} +2 -3
- package/dist/{delete-table-BOkYxdjA.mjs → delete-table-tM048btr.mjs} +6 -8
- package/dist/{dependencies-XZrEvHUA.mjs → dependencies-DdOTClO2.mjs} +5 -7
- package/dist/destroy-B51EPvOJ.mjs +168 -0
- package/dist/{dirty-B-5NDbG9.mjs → dirty-CEQYmhNF.mjs} +5 -7
- package/dist/{document-1W7NRaO_.mjs → document-D4zB-5a0.mjs} +20 -4
- package/dist/document-DR1FLOn9.mjs +22 -0
- package/dist/{eid-BCuJRv7a.mjs → eid-CtKGjAkz.mjs} +10 -11
- package/dist/embedding-CKdw8q7p.mjs +11 -0
- package/dist/events-C26DZ6yZ.mjs +44 -0
- package/dist/{export-Dod2gdyE.mjs → export-CippuWZJ.mjs} +5 -10
- package/dist/export-Cy2DFtR2.mjs +10 -0
- package/dist/field-CXDndCbB.mjs +21 -0
- package/dist/{field-CMY_LWUe.mjs → field-DsXTeqBy.mjs} +6 -4
- package/dist/{fields-B0yttrzR.mjs → fields-Xm_HVNcX.mjs} +6 -8
- package/dist/get-3O7hv4zv.mjs +67 -0
- package/dist/{get-D-pNrQGA.mjs → get-B0cq1uGy.mjs} +5 -7
- package/dist/{get-k6M5nGMC.mjs → get-B90bXbpw.mjs} +5 -7
- package/dist/{get-D7QMqPOK.mjs → get-BQBu2c94.mjs} +5 -7
- package/dist/{get-CfeYa0v5.mjs → get-BQz45IBF.mjs} +6 -7
- package/dist/get-BSfKWZNJ.mjs +35 -0
- package/dist/get-BdNC8WM8.mjs +38 -0
- package/dist/{get-DBY5esTW.mjs → get-Bj66bcuU.mjs} +5 -7
- package/dist/{get-BpZ81hX8.mjs → get-BrKqMM1d.mjs} +5 -7
- package/dist/{get-9p0Gt1c7.mjs → get-CjZWjRa5.mjs} +5 -7
- package/dist/{get-DISgP66L.mjs → get-CwGqARAf.mjs} +16 -9
- package/dist/{get-BkGh9BPd.mjs → get-D5crrFSf.mjs} +5 -7
- package/dist/{get-Dz7fcqoG.mjs → get-DTkvGu_J.mjs} +8 -9
- package/dist/{get-u5Uq9vms.mjs → get-DX2fp6BB.mjs} +4 -6
- package/dist/get-DYuJVlP-.mjs +35 -0
- package/dist/{get-DJ8huA8y.mjs → get-FIE88hj9.mjs} +7 -8
- package/dist/{get-B0OsW6jk.mjs → get-Ihx_XaaI.mjs} +5 -7
- package/dist/{get-run-DQJVpDw1.mjs → get-run-lVwhQVFx.mjs} +5 -7
- package/dist/{get-CbpHt4Hs.mjs → get-z0BKkiRX.mjs} +4 -6
- package/dist/git-sync-CmB4YBmS.mjs +31 -0
- package/dist/{group-BNE_RiH5.mjs → group-CILtQqCL.mjs} +2 -1
- package/dist/{has-remote-changes-DvQBXudi.mjs → has-remote-changes-DHrYSnTg.mjs} +5 -7
- package/dist/{import-PGS8-DwE.mjs → import-BU40xXSF.mjs} +7 -9
- package/dist/{input-7Sj85_K7.mjs → input-BGyHn0Kr.mjs} +6 -3
- package/dist/{is-dirty-DyEVFQVJ.mjs → is-dirty-BPluqPPP.mjs} +3 -4
- package/dist/is-dirty-DOy1TRcf.mjs +8 -0
- package/dist/{items-CkFEy2Du.mjs → items-BZpYkImP.mjs} +6 -8
- package/dist/{key-bltP32Pm.mjs → key-B8UAsQmB.mjs} +1 -1
- package/dist/{library-1AAVbk-K.mjs → library-BGWDIfEM.mjs} +6 -6
- package/dist/list-B037kJtH.mjs +39 -0
- package/dist/{list-82NkvRpI.mjs → list-B7Ihu6XI.mjs} +7 -8
- package/dist/{list-pQ22nXhQ.mjs → list-BCeZlfpQ.mjs} +4 -6
- package/dist/{list-CKzpoTgP.mjs → list-Bct00qku.mjs} +6 -8
- package/dist/{list-D-rgDFa5.mjs → list-Be8xMtS3.mjs} +8 -9
- package/dist/{list-Bb8YRON_.mjs → list-CjBPVJqd.mjs} +4 -6
- package/dist/{list-BCYTTCFD.mjs → list-CoqHnusK.mjs} +4 -6
- package/dist/{list-B9wXg3qi.mjs → list-CvaoHnl-.mjs} +3 -5
- package/dist/{list-BVzu2RIZ.mjs → list-DamRE5Ds.mjs} +4 -6
- package/dist/{list-BWAYDSbQ.mjs → list-DmopauvJ.mjs} +4 -6
- package/dist/{list-CJx5q-Yn.mjs → list-M_1sdYNH.mjs} +6 -8
- package/dist/{list-CK0p7vvK.mjs → list-Ov6bYzT9.mjs} +7 -8
- package/dist/{list-Sgo3RfDY.mjs → list-SfpASSFx.mjs} +4 -6
- package/dist/{list-BBxRjuMn.mjs → list-fPfgG0PY.mjs} +4 -6
- package/dist/list-lsPeumLP.mjs +34 -0
- package/dist/{list-BY4S32Lg.mjs → list-sn9M7QQX.mjs} +4 -6
- package/dist/{list-CjF12k1G.mjs → list-wxIVl45_.mjs} +5 -7
- package/dist/listing-wFZuS5li.mjs +10 -0
- package/dist/{login-C6ZAnGHz.mjs → login-CRlmR4op.mjs} +61 -23
- package/dist/{logout-CWjyY3Y8.mjs → logout-DSZEUxSQ.mjs} +5 -7
- package/dist/{measure-DoJvtCaA.mjs → measure-C3G1srWb.mjs} +5 -4
- package/dist/measure-Ka0n3426.mjs +25 -0
- package/dist/{parameter-values-DmDOuE-j.mjs → parameter-values-CwW8Xes7.mjs} +5 -7
- package/dist/{parse-enum-BL9i_brN.mjs → parse-enum-ooCsJWn6.mjs} +1 -1
- package/dist/parse-id-xS1tWJAq.mjs +18 -0
- package/dist/{parse-ref-CB_KvF9h.mjs → parse-ref-j4lxaQmd.mjs} +1 -1
- package/dist/{path-D8IJ4YrW.mjs → path-CVmg-bmf.mjs} +4 -6
- package/dist/{poll-hgnrHBoh.mjs → poll-CuTlWBwI.mjs} +2 -2
- package/dist/{poll-task-NQNLT_aA.mjs → poll-task-DhsYs8Hx.mjs} +2 -2
- package/dist/{preflight-DvaPQHHf.mjs → preflight-D3VgjEg7.mjs} +4 -5
- package/dist/{process-j8UHMHc2.mjs → process-7c8BcQEi.mjs} +1 -1
- package/dist/profile-name-CZ1-Vtrh.mjs +7 -0
- package/dist/{prompt-C85xd9HR.mjs → prompt-jQnNKtlx.mjs} +1 -1
- package/dist/{publish-BntmFR6g.mjs → publish-DFTCsjHU.mjs} +13 -10
- package/dist/{query-DSKQZu91.mjs → query-CPq-dhFV.mjs} +15 -15
- package/dist/{query-BQfgKV68.mjs → query-Dfx69iJ4.mjs} +9 -10
- package/dist/{query-result-D6mfoVfQ.mjs → query-result-Cg7odyR_.mjs} +1 -1
- package/dist/{remove-collection-BguaI3-6.mjs → remove-collection-DUAMhx5L.mjs} +7 -9
- package/dist/replace-DZWd6avZ.mjs +42 -0
- package/dist/requests-DYrDe-D0.mjs +96 -0
- package/dist/{rescan-values-DjD6IW3J.mjs → rescan-values-DZSnEFA0.mjs} +7 -9
- package/dist/{resolve-Dj2MTBkn.mjs → resolve-BTZuO3Yq.mjs} +22 -15
- package/dist/{run-Bp1yxkBN.mjs → run-B2b3Bjmv.mjs} +4 -6
- package/dist/{run-RQfQj7Rk.mjs → run-ryZ4sXK5.mjs} +7 -9
- package/dist/{runs-CSsatfWb.mjs → runs-F82HVSie.mjs} +5 -7
- package/dist/{runtime-oxjmrYoP.mjs → runtime-C6ASrgVA.mjs} +944 -909
- package/dist/{schema-tables-5I5pCxHl.mjs → schema-tables-CCOKb715.mjs} +6 -8
- package/dist/{schemas-CfzFCfBt.mjs → schemas-LtVrNECH.mjs} +4 -6
- package/dist/{search-Vo-BqliA.mjs → search-9GSZHgJQ.mjs} +4 -6
- package/dist/segment-C40bORNZ.mjs +25 -0
- package/dist/{segment-TXktTCfU.mjs → segment-CxRYEXeO.mjs} +6 -5
- package/dist/{selectors-DBnJsKlW.mjs → selectors-B2nDmrIV.mjs} +3 -3
- package/dist/{set-1Vh0AF-T.mjs → set-C57KDMGM.mjs} +9 -9
- package/dist/{set-active-C0mUZlNN.mjs → set-active-BDHGHtj2.mjs} +4 -6
- package/dist/setting-zrJwy48C.mjs +20 -0
- package/dist/{setup-CzYFvFK5.mjs → setup-Doq8atTG.mjs} +11 -12
- package/dist/{skills-B6gfH0iR.mjs → skills-y-KsUqT9.mjs} +1 -1
- package/dist/{skills-CR2xyV33.mjs → skills-yuzH_o8s.mjs} +3 -3
- package/dist/{snippet-CtA2Pkoa.mjs → snippet-C8PVaPY9.mjs} +7 -4
- package/dist/snippet-ScFM8re8.mjs +22 -0
- package/dist/{stash-CQHXwBu_.mjs → stash-D_u6z4q6.mjs} +7 -9
- package/dist/{status-C_7aqTvB.mjs → status--Dm2Jv6k.mjs} +5 -7
- package/dist/{status-DXQkM18v.mjs → status-CDPhDX5I.mjs} +27 -13
- package/dist/{summary-1aNpQc8j.mjs → summary-C9a2cBTE.mjs} +5 -7
- package/dist/{sync-schema-BqLp5uTS.mjs → sync-schema-CDIWNCGI.mjs} +9 -11
- package/dist/sync-scope-DW2QpGwv.mjs +55 -0
- package/dist/{table-DE3i82T_.mjs → table-3onHpwcb.mjs} +16 -4
- package/dist/table-BKehBm_E.mjs +21 -0
- package/dist/timeline-DEaiuB5V.mjs +157 -0
- package/dist/timeline-event-CLWMxvE0.mjs +22 -0
- package/dist/timeline-n3Nw9Egt.mjs +24 -0
- package/dist/transform-CrOOqKen.mjs +31 -0
- package/dist/{transform-DEF38FWe.mjs → transform-DP6J2ber.mjs} +31 -5
- package/dist/transform-job-J-E0Mec7.mjs +25 -0
- package/dist/transform-tag-Bkyasy_s.mjs +21 -0
- package/dist/{transforms-BelyllUL.mjs → transforms-w2a5qsjJ.mjs} +5 -7
- package/dist/{tree-YvmwGql7.mjs → tree-JZC6vD9q.mjs} +4 -6
- package/dist/{unpublish-CHjGLMu9.mjs → unpublish-BsfIH46y.mjs} +5 -7
- package/dist/{update-D7vc8GBF.mjs → update-B8hn6VxO.mjs} +12 -13
- package/dist/{update-BKhekuqr.mjs → update-BSNK36fk.mjs} +15 -15
- package/dist/update-BTFj6WHo.mjs +52 -0
- package/dist/{update-BACl_bJS.mjs → update-BfIGjAVA.mjs} +9 -10
- package/dist/{update-CrRz47aj.mjs → update-C1_aIL6X.mjs} +15 -15
- package/dist/{update-K-jjQ0Aw.mjs → update-CXKWHOIN.mjs} +10 -11
- package/dist/{update-BnHYSu96.mjs → update-Cg09lBb5.mjs} +13 -14
- package/dist/update-D01S8hnw.mjs +52 -0
- package/dist/{update-txUfAJxy.mjs → update-DKQjMsuE.mjs} +9 -10
- package/dist/{update-Zz01Woxj.mjs → update-DSlSr7Ky.mjs} +9 -10
- package/dist/{update-C9fndCqb.mjs → update-QaBVvlz9.mjs} +9 -10
- package/dist/{update-BGMJTpA6.mjs → update-WLb9099y.mjs} +12 -13
- package/dist/{update-BWlN3QDo.mjs → update-bFNKpay8.mjs} +9 -10
- package/dist/{update-dashcard-Dvth-yLC.mjs → update-dashcard-CKZC7scy.mjs} +11 -11
- package/dist/{upgrade-DsXlfPef.mjs → upgrade-DkK1ZbEY.mjs} +5 -7
- package/dist/upload-DOMoaR9f.mjs +16 -0
- package/dist/{uuid-ByJmWV7b.mjs → uuid-DDbLKnbe.mjs} +3 -5
- package/dist/{validate-BqNW4Sk1.mjs → validate-DqQ7DQnP.mjs} +1 -2
- package/dist/{validate-query-CcZVKYPV.mjs → validate-query-BYG7lyaY.mjs} +2 -3
- package/dist/{values-CIjJI4sz.mjs → values-Bc99Kkuv.mjs} +5 -7
- package/dist/{verify-Jsuc2dat.mjs → verify-WvMbaT8W.mjs} +2 -2
- package/dist/{wait-5ltTFvSa.mjs → wait-DmgEPnHW.mjs} +6 -8
- package/dist/{wait-flags-D6kd_G7c.mjs → wait-flags-BpzyrpAL.mjs} +2 -2
- package/dist/workspace-BgH_4xFO.mjs +75 -0
- package/dist/workspace-LFtHxcw9.mjs +19 -0
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +31 -23
- package/skill-data/dashboard/SKILL.md +26 -3
- package/skill-data/data-workflow/SKILL.md +17 -15
- package/skill-data/git-sync/SKILL.md +20 -5
- package/skill-data/visualization/SKILL.md +1 -0
- package/dist/add-collection-DbalcC3_.mjs +0 -11
- package/dist/auth--PWX0oj5.mjs +0 -22
- package/dist/capabilities-N0jo5U7S.mjs +0 -239
- package/dist/card-D07WYCQY.mjs +0 -26
- package/dist/collection-Dss2qSEF.mjs +0 -23
- package/dist/dashboard-Crh4v6Fq.mjs +0 -35
- package/dist/db-BCAURQei.mjs +0 -28
- package/dist/document-upxL2nKH.mjs +0 -22
- package/dist/error-BaBm-UrT.mjs +0 -227
- package/dist/field-CloFa1oe.mjs +0 -21
- package/dist/get-B8tugTku.mjs +0 -50
- package/dist/git-sync-C9m-OHac.mjs +0 -31
- package/dist/is-dirty-DpyKeGAJ.mjs +0 -10
- package/dist/manifest-BVf8P4bl.mjs +0 -126
- package/dist/measure-Cbly1r0E.mjs +0 -25
- package/dist/metadata-CW5Lfw5d.mjs +0 -39
- package/dist/metadata-aQAqseCm.mjs +0 -38
- package/dist/notice-DyVl5aYB.mjs +0 -206
- package/dist/parse-id-DlXnOcmP.mjs +0 -12
- package/dist/segment-BuN_IoM8.mjs +0 -25
- package/dist/setting-BbdKR-lO.mjs +0 -20
- package/dist/snippet-Bzo2U9Fv.mjs +0 -22
- package/dist/table-BwGOz97O.mjs +0 -22
- package/dist/transform-B65ZD9-e.mjs +0 -31
- package/dist/transform-job-BWVKXSV6.mjs +0 -25
- package/dist/transform-tag-C4qvmicL.mjs +0 -21
- /package/dist/{body-flags-DWTTxJpP.mjs → body-flags-CgHgJBRC.mjs} +0 -0
- /package/dist/{command-augment-DdZIfx1V.mjs → command-augment-D9pI9Vbh.mjs} +0 -0
- /package/dist/{parameter-CiJ4CwWE.mjs → parameter-BZ6y-Gfs.mjs} +0 -0
- /package/dist/{render-BTKnWL0d.mjs → render-CkuFkWlQ.mjs} +0 -0
- /package/dist/{transform-job-CtixL4An.mjs → transform-job-B5x8aYfV.mjs} +0 -0
- /package/dist/{transform-tag-rsIrckCM.mjs → transform-tag-BRwfWeHf.mjs} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EmbeddingParams } from "./embedding-CKdw8q7p.mjs";
|
|
2
|
+
import { Parameter, ParameterMapping } from "./parameter-BZ6y-Gfs.mjs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
|
|
4
5
|
//#region src/domain/dashboard.ts
|
|
@@ -126,29 +127,48 @@ const dashboardView = {
|
|
|
126
127
|
}
|
|
127
128
|
]
|
|
128
129
|
};
|
|
130
|
+
const DashcardWrite = z.object({
|
|
131
|
+
id: z.number().int().describe("existing dashcard id; negative to create a new dashcard"),
|
|
132
|
+
size_x: z.number().int().positive(),
|
|
133
|
+
size_y: z.number().int().positive(),
|
|
134
|
+
row: z.number().int().nonnegative(),
|
|
135
|
+
col: z.number().int().nonnegative(),
|
|
136
|
+
parameter_mappings: z.array(ParameterMapping).nullable().optional(),
|
|
137
|
+
inline_parameters: z.array(z.string().min(1)).nullable().optional(),
|
|
138
|
+
series: z.array(z.record(z.string(), z.unknown())).nullable().optional()
|
|
139
|
+
}).loose();
|
|
140
|
+
const DashboardTabWrite = z.object({
|
|
141
|
+
id: z.number().int().describe("existing tab id; negative to create a new tab"),
|
|
142
|
+
name: z.string().min(1)
|
|
143
|
+
}).loose();
|
|
129
144
|
const DashboardCreateInput = z.object({
|
|
130
145
|
name: z.string().min(1),
|
|
131
146
|
description: z.string().nullable().optional(),
|
|
132
|
-
parameters: z.array(Parameter).optional(),
|
|
133
|
-
cache_ttl: z.number().int().positive().optional(),
|
|
147
|
+
parameters: z.array(Parameter).nullable().optional(),
|
|
148
|
+
cache_ttl: z.number().int().positive().nullable().optional(),
|
|
134
149
|
collection_id: z.number().int().positive().nullable().optional(),
|
|
135
150
|
collection_position: z.number().int().positive().nullable().optional(),
|
|
136
|
-
dashcards: z.array(
|
|
137
|
-
tabs: z.array(
|
|
151
|
+
dashcards: z.array(DashcardWrite).optional(),
|
|
152
|
+
tabs: z.array(DashboardTabWrite).optional()
|
|
138
153
|
}).loose();
|
|
139
154
|
const DashboardUpdateInput = z.object({
|
|
140
|
-
name: z.string().min(1).optional(),
|
|
155
|
+
name: z.string().min(1).nullable().optional(),
|
|
141
156
|
description: z.string().nullable().optional(),
|
|
142
|
-
|
|
157
|
+
caveats: z.string().nullable().optional(),
|
|
158
|
+
points_of_interest: z.string().nullable().optional(),
|
|
159
|
+
show_in_getting_started: z.boolean().nullable().optional(),
|
|
160
|
+
archived: z.boolean().nullable().optional(),
|
|
161
|
+
position: z.number().int().positive().nullable().optional(),
|
|
143
162
|
width: DashboardWidth.optional(),
|
|
144
|
-
enable_embedding: z.boolean().optional(),
|
|
145
|
-
|
|
146
|
-
|
|
163
|
+
enable_embedding: z.boolean().nullable().optional(),
|
|
164
|
+
embedding_type: z.string().nullable().optional(),
|
|
165
|
+
embedding_params: EmbeddingParams.nullable().optional(),
|
|
166
|
+
parameters: z.array(Parameter).nullable().optional(),
|
|
147
167
|
cache_ttl: z.number().int().positive().nullable().optional(),
|
|
148
168
|
collection_id: z.number().int().positive().nullable().optional(),
|
|
149
169
|
collection_position: z.number().int().positive().nullable().optional(),
|
|
150
|
-
dashcards: z.array(
|
|
151
|
-
tabs: z.array(
|
|
170
|
+
dashcards: z.array(DashcardWrite).nullable().optional(),
|
|
171
|
+
tabs: z.array(DashboardTabWrite).nullable().optional()
|
|
152
172
|
}).loose();
|
|
153
173
|
const DashcardPatchInput = z.object({
|
|
154
174
|
row: z.number().int().nonnegative().optional(),
|
|
@@ -156,10 +176,10 @@ const DashcardPatchInput = z.object({
|
|
|
156
176
|
size_x: z.number().int().positive().optional(),
|
|
157
177
|
size_y: z.number().int().positive().optional(),
|
|
158
178
|
dashboard_tab_id: z.number().int().nullable().optional(),
|
|
159
|
-
parameter_mappings: z.array(ParameterMapping).optional(),
|
|
160
|
-
inline_parameters: z.array(z.string()).optional(),
|
|
179
|
+
parameter_mappings: z.array(ParameterMapping).nullable().optional(),
|
|
180
|
+
inline_parameters: z.array(z.string().min(1)).nullable().optional(),
|
|
161
181
|
visualization_settings: z.unknown().optional(),
|
|
162
|
-
series: z.array(z.unknown()).optional()
|
|
182
|
+
series: z.array(z.record(z.string(), z.unknown())).nullable().optional()
|
|
163
183
|
}).strict().refine((value) => Object.keys(value).length > 0, { message: "patch must contain at least one field" });
|
|
164
184
|
|
|
165
185
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Table } from "./table-
|
|
1
|
+
import { Table, TableCompact } from "./table-3onHpwcb.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/domain/database.ts
|
|
@@ -15,7 +15,7 @@ const DatabaseCompact = Database.pick({
|
|
|
15
15
|
name: true,
|
|
16
16
|
engine: true,
|
|
17
17
|
is_saved_questions: true
|
|
18
|
-
}).strip();
|
|
18
|
+
}).strip().extend({ tables: z.array(TableCompact).optional() });
|
|
19
19
|
const databaseView = {
|
|
20
20
|
compactPick: DatabaseCompact,
|
|
21
21
|
tableColumns: [
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
2
|
+
import { defineCommandGroup } from "./group-CILtQqCL.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/commands/db/index.ts
|
|
5
|
+
var db_default = defineCommandGroup({
|
|
6
|
+
name: "db",
|
|
7
|
+
description: "Inspect and sync Metabase databases",
|
|
8
|
+
alias: "database",
|
|
9
|
+
skills: [{
|
|
10
|
+
skill: "core",
|
|
11
|
+
purpose: "the database traversal ladder and schema sync"
|
|
12
|
+
}, {
|
|
13
|
+
skill: "data-workflow",
|
|
14
|
+
purpose: "model a raw database into clean tables"
|
|
15
|
+
}],
|
|
16
|
+
subCommands: {
|
|
17
|
+
list: () => import("./list-Bct00qku.mjs").then((m) => m.default),
|
|
18
|
+
get: () => import("./get-3O7hv4zv.mjs").then((m) => m.default),
|
|
19
|
+
schemas: () => import("./schemas-LtVrNECH.mjs").then((m) => m.default),
|
|
20
|
+
"schema-tables": () => import("./schema-tables-CCOKb715.mjs").then((m) => m.default),
|
|
21
|
+
"sync-schema": () => import("./sync-schema-CDIWNCGI.mjs").then((m) => m.default),
|
|
22
|
+
"rescan-values": () => import("./rescan-values-DZSnEFA0.mjs").then((m) => m.default)
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
//#endregion
|
|
27
|
+
export { db_default as default };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import { parseId } from "./parse-id-DlXnOcmP.mjs";
|
|
8
|
-
import { DeleteResult, confirmAndDelete } from "./delete-runtime-B0ha5QR4.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./prompt-jQnNKtlx.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
6
|
+
import { DeleteResult, confirmAndDelete } from "./delete-runtime-DdBn6poA.mjs";
|
|
9
7
|
|
|
10
8
|
//#region src/commands/transform-tag/delete.ts
|
|
11
9
|
var delete_default = defineMetabaseCommand({
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import { parseId } from "./parse-id-DlXnOcmP.mjs";
|
|
8
|
-
import { DeleteResult, confirmAndDelete } from "./delete-runtime-B0ha5QR4.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./prompt-jQnNKtlx.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
6
|
+
import { DeleteResult, confirmAndDelete } from "./delete-runtime-DdBn6poA.mjs";
|
|
9
7
|
|
|
10
8
|
//#region src/commands/transform/delete.ts
|
|
11
9
|
var delete_default = defineMetabaseCommand({
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./prompt-jQnNKtlx.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
6
|
+
import { DeleteResult, confirmAndDelete } from "./delete-runtime-DdBn6poA.mjs";
|
|
7
|
+
|
|
8
|
+
//#region src/commands/timeline/delete.ts
|
|
9
|
+
var delete_default = defineMetabaseCommand({
|
|
10
|
+
meta: {
|
|
11
|
+
name: "delete",
|
|
12
|
+
description: "Permanently delete a timeline and all its events by id"
|
|
13
|
+
},
|
|
14
|
+
capabilities: { minVersion: 58 },
|
|
15
|
+
args: {
|
|
16
|
+
...outputFlags,
|
|
17
|
+
...profileFlag,
|
|
18
|
+
...connectionFlags,
|
|
19
|
+
yes: {
|
|
20
|
+
type: "boolean",
|
|
21
|
+
description: "Skip confirmation",
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
id: {
|
|
25
|
+
type: "positional",
|
|
26
|
+
description: "Timeline id",
|
|
27
|
+
required: true
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
outputSchema: DeleteResult,
|
|
31
|
+
examples: ["mb timeline delete 1 --yes", "mb timeline delete 1"],
|
|
32
|
+
async run({ args, ctx, getClient }) {
|
|
33
|
+
const id = parseId(args.id);
|
|
34
|
+
const client = await getClient();
|
|
35
|
+
await confirmAndDelete({
|
|
36
|
+
id,
|
|
37
|
+
path: `/api/timeline/${id}`,
|
|
38
|
+
yes: args.yes,
|
|
39
|
+
promptMessage: `Delete timeline ${id} and all its events?`,
|
|
40
|
+
successMessage: `Deleted timeline ${id}.`,
|
|
41
|
+
abortMessage: `Aborted; timeline ${id} was not deleted.`,
|
|
42
|
+
client,
|
|
43
|
+
ctx
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { delete_default as default };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./prompt-jQnNKtlx.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
6
|
+
import { DeleteResult, confirmAndDelete } from "./delete-runtime-DdBn6poA.mjs";
|
|
7
|
+
|
|
8
|
+
//#region src/commands/timeline-event/delete.ts
|
|
9
|
+
var delete_default = defineMetabaseCommand({
|
|
10
|
+
meta: {
|
|
11
|
+
name: "delete",
|
|
12
|
+
description: "Permanently delete a timeline event by id"
|
|
13
|
+
},
|
|
14
|
+
capabilities: { minVersion: 58 },
|
|
15
|
+
args: {
|
|
16
|
+
...outputFlags,
|
|
17
|
+
...profileFlag,
|
|
18
|
+
...connectionFlags,
|
|
19
|
+
yes: {
|
|
20
|
+
type: "boolean",
|
|
21
|
+
description: "Skip confirmation",
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
id: {
|
|
25
|
+
type: "positional",
|
|
26
|
+
description: "Timeline event id",
|
|
27
|
+
required: true
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
outputSchema: DeleteResult,
|
|
31
|
+
examples: ["mb timeline-event delete 1 --yes", "mb timeline-event delete 1"],
|
|
32
|
+
async run({ args, ctx, getClient }) {
|
|
33
|
+
const id = parseId(args.id);
|
|
34
|
+
const client = await getClient();
|
|
35
|
+
await confirmAndDelete({
|
|
36
|
+
id,
|
|
37
|
+
path: `/api/timeline-event/${id}`,
|
|
38
|
+
yes: args.yes,
|
|
39
|
+
promptMessage: `Delete timeline event ${id}?`,
|
|
40
|
+
successMessage: `Deleted timeline event ${id}.`,
|
|
41
|
+
abortMessage: `Aborted; timeline event ${id} was not deleted.`,
|
|
42
|
+
client,
|
|
43
|
+
ctx
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { delete_default as default };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import { parseId } from "./parse-id-DlXnOcmP.mjs";
|
|
8
|
-
import { DeleteResult, confirmAndDelete } from "./delete-runtime-B0ha5QR4.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./prompt-jQnNKtlx.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
6
|
+
import { DeleteResult, confirmAndDelete } from "./delete-runtime-DdBn6poA.mjs";
|
|
9
7
|
|
|
10
8
|
//#region src/commands/transform-job/delete.ts
|
|
11
9
|
var delete_default = defineMetabaseCommand({
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ConfigError } from "./
|
|
2
|
-
import {
|
|
3
|
-
import { promptConfirm } from "./prompt-C85xd9HR.mjs";
|
|
1
|
+
import { ConfigError, renderSummary } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import { promptConfirm } from "./prompt-jQnNKtlx.mjs";
|
|
4
3
|
import { z } from "zod";
|
|
5
4
|
|
|
6
5
|
//#region src/commands/delete-runtime.ts
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import { parseId } from "./parse-id-DlXnOcmP.mjs";
|
|
8
|
-
import { DeleteResult, confirmAndDelete } from "./delete-runtime-B0ha5QR4.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./prompt-jQnNKtlx.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
6
|
+
import { DeleteResult, confirmAndDelete } from "./delete-runtime-DdBn6poA.mjs";
|
|
9
7
|
|
|
10
8
|
//#region src/commands/transform/delete-table.ts
|
|
11
9
|
var delete_table_default = defineMetabaseCommand({
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { parseId } from "./parse-id-DlXnOcmP.mjs";
|
|
7
|
-
import { Transform, TransformCompact, transformView } from "./transform-DEF38FWe.mjs";
|
|
1
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList, wrapList } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
5
|
+
import { Transform, TransformCompact, transformView } from "./transform-DP6J2ber.mjs";
|
|
8
6
|
import { z } from "zod";
|
|
9
7
|
|
|
10
8
|
//#region src/commands/transform/dependencies.ts
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { ConfigError, connectionFlags, errorMessage, outputFlags, profileFlag, renderSummary, warn } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { clearProfile, createClient, defineMetabaseCommand, readProfileCredential } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import { promptConfirm } from "./prompt-jQnNKtlx.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
6
|
+
import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-CuTlWBwI.mjs";
|
|
7
|
+
import "./wait-flags-BpzyrpAL.mjs";
|
|
8
|
+
import { REMOTE_SYNC_PATHS, pollSyncTask, throwIfFailedTask } from "./poll-task-DhsYs8Hx.mjs";
|
|
9
|
+
import { SyncExportKickoff } from "./export-CippuWZJ.mjs";
|
|
10
|
+
import { IsDirtyResult } from "./is-dirty-BPluqPPP.mjs";
|
|
11
|
+
import { workspaceProfileName } from "./profile-name-CZ1-Vtrh.mjs";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
|
|
14
|
+
//#region src/commands/workspace/destroy.ts
|
|
15
|
+
const WorkspaceOrphanedResource = z.object({
|
|
16
|
+
workspace_database_id: z.number().int(),
|
|
17
|
+
database_id: z.number().int(),
|
|
18
|
+
driver: z.string(),
|
|
19
|
+
schema: z.string(),
|
|
20
|
+
user: z.string(),
|
|
21
|
+
reason: z.string().nullable().optional()
|
|
22
|
+
}).loose();
|
|
23
|
+
const WorkspaceDeleteResponse = z.object({
|
|
24
|
+
id: z.number().int(),
|
|
25
|
+
deleted: z.boolean(),
|
|
26
|
+
message: z.string().optional(),
|
|
27
|
+
orphaned_resources: z.array(WorkspaceOrphanedResource).optional()
|
|
28
|
+
}).loose();
|
|
29
|
+
const WorkspaceDestroyResult = WorkspaceDeleteResponse.extend({ aborted: z.boolean() });
|
|
30
|
+
const workspaceDestroyView = {
|
|
31
|
+
compactPick: WorkspaceDestroyResult,
|
|
32
|
+
tableColumns: [
|
|
33
|
+
{
|
|
34
|
+
key: "id",
|
|
35
|
+
label: "ID"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: "deleted",
|
|
39
|
+
label: "Destroyed"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "aborted",
|
|
43
|
+
label: "Aborted"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: "message",
|
|
47
|
+
label: "Message"
|
|
48
|
+
}
|
|
49
|
+
]
|
|
50
|
+
};
|
|
51
|
+
var destroy_default = defineMetabaseCommand({
|
|
52
|
+
meta: {
|
|
53
|
+
name: "destroy",
|
|
54
|
+
description: "Destroy a workspace and its warehouse isolation"
|
|
55
|
+
},
|
|
56
|
+
details: "Destroy is the only irreversible moment, so it closes the work-loss window first: when a local profile named ws-<id> exists, the child is checked for unsynced work and a dirty workspace is auto-exported to its target branch before anything is torn down (--discard skips the check and the export). Then each provisioned database's warehouse isolation (temporary schema + user) is dropped and the workspace removed; the matching local profile is dropped on success. Refuses with a 409 while any database is still provisioning/deprovisioning unless --ignore-pending is passed, which removes the workspace records and leaves those warehouse objects behind. If the warehouse was unreachable, the result lists the leftover schema/user objects under orphaned_resources.",
|
|
57
|
+
capabilities: {
|
|
58
|
+
minVersion: 62,
|
|
59
|
+
tokenFeature: "workspaces"
|
|
60
|
+
},
|
|
61
|
+
args: {
|
|
62
|
+
...outputFlags,
|
|
63
|
+
...profileFlag,
|
|
64
|
+
...connectionFlags,
|
|
65
|
+
yes: {
|
|
66
|
+
type: "boolean",
|
|
67
|
+
description: "Skip confirmation",
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
discard: {
|
|
71
|
+
type: "boolean",
|
|
72
|
+
description: "Destroy without exporting unsynced work (skips the is-dirty check)",
|
|
73
|
+
default: false
|
|
74
|
+
},
|
|
75
|
+
"ignore-pending": {
|
|
76
|
+
type: "boolean",
|
|
77
|
+
description: "Remove workspace records even while databases are provisioning/deprovisioning",
|
|
78
|
+
default: false
|
|
79
|
+
},
|
|
80
|
+
id: {
|
|
81
|
+
type: "positional",
|
|
82
|
+
description: "Workspace id",
|
|
83
|
+
required: true
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
outputSchema: WorkspaceDestroyResult,
|
|
87
|
+
examples: [
|
|
88
|
+
"mb workspace destroy 1 --yes",
|
|
89
|
+
"mb workspace destroy 1 --yes --discard",
|
|
90
|
+
"mb workspace destroy 1 --yes --ignore-pending"
|
|
91
|
+
],
|
|
92
|
+
async run({ args, ctx, getClient }) {
|
|
93
|
+
const id = parseId(args.id);
|
|
94
|
+
if (!args.yes) {
|
|
95
|
+
if (process.stdin.isTTY !== true) throw new ConfigError(`refusing to destroy workspace ${id} without confirmation — pass --yes to proceed non-interactively`);
|
|
96
|
+
const ok = await promptConfirm({
|
|
97
|
+
message: `Destroy workspace ${id}? Its warehouse isolation (schema + user) is dropped.`,
|
|
98
|
+
initialValue: false
|
|
99
|
+
});
|
|
100
|
+
if (!ok) {
|
|
101
|
+
renderSummary({
|
|
102
|
+
id,
|
|
103
|
+
deleted: false,
|
|
104
|
+
aborted: true
|
|
105
|
+
}, workspaceDestroyView, `Aborted; workspace ${id} was not destroyed.`, ctx);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const client = await getClient();
|
|
110
|
+
const profileName = workspaceProfileName(id);
|
|
111
|
+
const hasProfile = await guardUnsyncedWork(profileName, args.discard);
|
|
112
|
+
const response = await client.requestParsed(WorkspaceDeleteResponse, `/api/ee/workspace-manager/${id}`, {
|
|
113
|
+
method: "DELETE",
|
|
114
|
+
query: { "ignore-pending": args["ignore-pending"] ? true : void 0 }
|
|
115
|
+
});
|
|
116
|
+
if (response.deleted && hasProfile) {
|
|
117
|
+
await clearProfile(profileName);
|
|
118
|
+
warn(`dropped profile "${profileName}"`);
|
|
119
|
+
}
|
|
120
|
+
renderSummary({
|
|
121
|
+
...response,
|
|
122
|
+
aborted: false
|
|
123
|
+
}, workspaceDestroyView, response.message ?? `Destroyed workspace ${id}.`, ctx);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
async function guardUnsyncedWork(profileName, discard) {
|
|
127
|
+
const resolved = await readProfileCredential(profileName);
|
|
128
|
+
if (resolved === null) {
|
|
129
|
+
warn(`no local profile "${profileName}" for this workspace — skipping the unsynced-work check`);
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
if (discard) {
|
|
133
|
+
warn("--discard given — skipping the unsynced-work check");
|
|
134
|
+
return true;
|
|
135
|
+
}
|
|
136
|
+
const child = createClient({
|
|
137
|
+
url: resolved.url,
|
|
138
|
+
credential: resolved.credential
|
|
139
|
+
});
|
|
140
|
+
const dirty = await checkIsDirty(child, profileName);
|
|
141
|
+
if (!dirty) return true;
|
|
142
|
+
warn("workspace has unsynced work — exporting to the target branch before destroy");
|
|
143
|
+
await exportUnsyncedWork(child);
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
async function checkIsDirty(child, profileName) {
|
|
147
|
+
try {
|
|
148
|
+
const result = await child.requestParsed(IsDirtyResult, REMOTE_SYNC_PATHS.isDirty);
|
|
149
|
+
return result.is_dirty;
|
|
150
|
+
} catch (error) {
|
|
151
|
+
throw new ConfigError(`could not check workspace profile "${profileName}" for unsynced work: ${errorMessage(error)} — pass --discard to destroy anyway`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
async function exportUnsyncedWork(child) {
|
|
155
|
+
const kickoff = await child.requestParsed(SyncExportKickoff, REMOTE_SYNC_PATHS.export, {
|
|
156
|
+
method: "POST",
|
|
157
|
+
body: {}
|
|
158
|
+
});
|
|
159
|
+
const final = await pollSyncTask(child, {
|
|
160
|
+
intervalMs: DEFAULT_INTERVAL_MS,
|
|
161
|
+
timeoutMs: DEFAULT_TIMEOUT_MS
|
|
162
|
+
});
|
|
163
|
+
throwIfFailedTask(final, "export");
|
|
164
|
+
warn(`export task #${kickoff.task_id} completed; unsynced work is saved`);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
//#endregion
|
|
168
|
+
export { destroy_default as default };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./poll-hgnrHBoh.mjs";
|
|
7
|
-
import { REMOTE_SYNC_PATHS, SyncDirtyItem, SyncDirtyItemCompact, syncDirtyItemView } from "./poll-task-NQNLT_aA.mjs";
|
|
1
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList, wrapList } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./poll-CuTlWBwI.mjs";
|
|
5
|
+
import { REMOTE_SYNC_PATHS, SyncDirtyItem, SyncDirtyItemCompact, syncDirtyItemView } from "./poll-task-DhsYs8Hx.mjs";
|
|
8
6
|
import { z } from "zod";
|
|
9
7
|
|
|
10
8
|
//#region src/commands/git-sync/dirty.ts
|
|
@@ -82,18 +82,34 @@ const documentView = {
|
|
|
82
82
|
}
|
|
83
83
|
]
|
|
84
84
|
};
|
|
85
|
-
const
|
|
85
|
+
const DocumentName = z.string().min(1).max(254);
|
|
86
|
+
const DocumentCardInput = z.object({
|
|
86
87
|
name: z.string().min(1),
|
|
88
|
+
dataset_query: z.record(z.string(), z.unknown()),
|
|
89
|
+
display: z.string().min(1),
|
|
90
|
+
visualization_settings: z.record(z.string(), z.unknown()),
|
|
91
|
+
entity_id: z.string().min(1).nullable().optional(),
|
|
92
|
+
parameters: z.array(z.record(z.string(), z.unknown())).nullable().optional(),
|
|
93
|
+
parameter_mappings: z.array(z.record(z.string(), z.unknown())).nullable().optional(),
|
|
94
|
+
description: z.string().min(1).nullable().optional(),
|
|
95
|
+
result_metadata: z.array(z.record(z.string(), z.unknown())).nullable().optional(),
|
|
96
|
+
cache_ttl: z.number().int().positive().nullable().optional()
|
|
97
|
+
}).loose();
|
|
98
|
+
const NEW_CARD_KEY_DESCRIPTION = "cards to create inline, keyed by the negative placeholder id referenced from cardEmbed nodes";
|
|
99
|
+
const DocumentCreateInput = z.object({
|
|
100
|
+
name: DocumentName,
|
|
87
101
|
document: TipTapNodeInput,
|
|
88
102
|
collection_id: z.number().int().positive().nullable().optional(),
|
|
89
|
-
collection_position: z.number().int().positive().nullable().optional()
|
|
103
|
+
collection_position: z.number().int().positive().nullable().optional(),
|
|
104
|
+
cards: z.record(z.string().regex(/^-\d+$/), DocumentCardInput).nullable().optional().describe(NEW_CARD_KEY_DESCRIPTION)
|
|
90
105
|
}).loose();
|
|
91
106
|
const DocumentUpdateInput = z.object({
|
|
92
|
-
name:
|
|
107
|
+
name: DocumentName.optional(),
|
|
93
108
|
document: TipTapNodeInput.optional(),
|
|
94
109
|
collection_id: z.number().int().positive().nullable().optional(),
|
|
95
110
|
collection_position: z.number().int().positive().nullable().optional(),
|
|
96
|
-
archived: z.boolean().nullable().optional()
|
|
111
|
+
archived: z.boolean().nullable().optional(),
|
|
112
|
+
cards: z.record(z.string().regex(/^-?\d+$/), DocumentCardInput).nullable().optional().describe("cards keyed by card id; negative ids create new cards")
|
|
97
113
|
}).loose();
|
|
98
114
|
|
|
99
115
|
//#endregion
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
2
|
+
import { defineCommandGroup } from "./group-CILtQqCL.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/commands/document/index.ts
|
|
5
|
+
var document_default = defineCommandGroup({
|
|
6
|
+
name: "document",
|
|
7
|
+
description: "Manage Metabase documents",
|
|
8
|
+
skills: [{
|
|
9
|
+
skill: "document",
|
|
10
|
+
purpose: "author the ProseMirror document body"
|
|
11
|
+
}],
|
|
12
|
+
subCommands: {
|
|
13
|
+
list: () => import("./list-DmopauvJ.mjs").then((mod) => mod.default),
|
|
14
|
+
get: () => import("./get-D5crrFSf.mjs").then((mod) => mod.default),
|
|
15
|
+
create: () => import("./create-CBKT7SE_.mjs").then((mod) => mod.default),
|
|
16
|
+
update: () => import("./update-DKQjMsuE.mjs").then((mod) => mod.default),
|
|
17
|
+
archive: () => import("./archive-BwIZzWGe.mjs").then((mod) => mod.default)
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { document_default as default };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { ConfigError } from "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import { readBody } from "./body-BS2s2zDl.mjs";
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-DWTTxJpP.mjs";
|
|
1
|
+
import { ConfigError, connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand, parseCsv } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./input-BGyHn0Kr.mjs";
|
|
5
|
+
import { readBody } from "./body-5snfmiwR.mjs";
|
|
6
|
+
import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
|
|
9
7
|
import { z } from "zod";
|
|
10
8
|
|
|
11
9
|
//#region src/domain/eid-translation.ts
|
|
@@ -32,7 +30,7 @@ const EID_MODELS = [
|
|
|
32
30
|
"user"
|
|
33
31
|
];
|
|
34
32
|
const EidModel = z.enum(EID_MODELS);
|
|
35
|
-
const EidTranslateInput = z.object({ entity_ids: z.partialRecord(EidModel, z.array(z.string().
|
|
33
|
+
const EidTranslateInput = z.object({ entity_ids: z.partialRecord(EidModel, z.array(z.string().length(21))) }).loose();
|
|
36
34
|
const EidTranslateEntry = z.object({
|
|
37
35
|
status: z.string(),
|
|
38
36
|
type: EidModel,
|
|
@@ -90,11 +88,12 @@ var eid_default = defineMetabaseCommand({
|
|
|
90
88
|
description: "Comma-separated EIDs to translate (used with --model)"
|
|
91
89
|
}
|
|
92
90
|
},
|
|
91
|
+
inputSchema: EidTranslateInput,
|
|
93
92
|
outputSchema: EidTranslateResult,
|
|
94
93
|
examples: [
|
|
95
|
-
"mb eid --model card
|
|
94
|
+
"mb eid --model card Ss3mHTaWs8T-VLPYEeraG,5oQpn8LO4qXBRZ1Wq3jIp",
|
|
96
95
|
"mb eid --file translate.json",
|
|
97
|
-
"mb eid --body '{\"entity_ids\":{\"card\":[\"
|
|
96
|
+
"mb eid --body '{\"entity_ids\":{\"card\":[\"Ss3mHTaWs8T-VLPYEeraG\"]}}'"
|
|
98
97
|
],
|
|
99
98
|
async run({ args, ctx, getClient }) {
|
|
100
99
|
const pair = requireBothOrNeither({
|