@metabase/cli 0.1.17 → 0.2.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.
- package/README.md +61 -35
- package/dist/{add-collection-C-t9SQBk.mjs → add-collection-BTSGp4f9.mjs} +4 -5
- package/dist/add-collection-DlAwt2Z3.mjs +9 -0
- package/dist/append-DY1-O789.mjs +42 -0
- package/dist/{archive-wNXwIiF0.mjs → archive-BOEEMrYL.mjs} +6 -8
- package/dist/{archive-CaoUUTIb.mjs → archive-CJ9rElKn.mjs} +6 -8
- package/dist/{archive-DS-KEB4a.mjs → archive-CWtUzlHO.mjs} +5 -7
- package/dist/{archive-LG8u7ec5.mjs → archive-DCPw3df6.mjs} +5 -7
- package/dist/{archive-D1FX-sbU.mjs → archive-DOa1u1aJ.mjs} +5 -7
- package/dist/{archive-C7dnyzVY.mjs → archive-pHsa4dL0.mjs} +8 -9
- package/dist/{archive-qSOcACQo.mjs → archive-w6TX-zEk.mjs} +7 -8
- package/dist/auth-BrQtY0pO.mjs +22 -0
- package/dist/{body-IcJ5kFtk.mjs → body-C1_AaTS4.mjs} +3 -3
- package/dist/{branches-BlNCTmFB.mjs → branches-BsBzaGIf.mjs} +5 -7
- package/dist/{cancel-BnveTPNw.mjs → cancel-BNM0yyx-.mjs} +4 -6
- package/dist/{cancel-task-CSVI8Zgl.mjs → cancel-task-Bggzn4JL.mjs} +5 -7
- package/dist/capabilities-DrDJo_ng.mjs +684 -0
- package/dist/{card-DEmcRlNO.mjs → card-B8G5jQQT.mjs} +24 -18
- package/dist/card-DHCcmpgr.mjs +26 -0
- package/dist/{cards-CMgGA8OZ.mjs → cards-D0hvA13L.mjs} +7 -8
- package/dist/cli.mjs +175 -29
- package/dist/{collection-DrLpA1SO.mjs → collection-CFoLPrY5.mjs} +1 -1
- package/dist/collection-D0O9gp3S.mjs +23 -0
- package/dist/{collection-namespace-CsaxEqOb.mjs → collection-namespace-DqPNrCdQ.mjs} +2 -2
- package/dist/{create-I5Cv-MBa.mjs → create-05rX4oL-.mjs} +11 -12
- package/dist/{create-B6LQutd0.mjs → create-BR7x66KW.mjs} +12 -13
- package/dist/{create-B79M8YpX.mjs → create-C17Fh1_X.mjs} +9 -10
- package/dist/{create-FZOrCw5k.mjs → create-C8ndg3g4.mjs} +28 -21
- package/dist/{create-C7u3umLj.mjs → create-CZ9KFnbi.mjs} +8 -9
- package/dist/{create-B1xfaZJB.mjs → create-Cii_utzV.mjs} +5 -7
- package/dist/{create-SHKlj0z3.mjs → create-Cyv7vHV_.mjs} +8 -9
- package/dist/{create-Bg_uMu0p.mjs → create-DKuixGJ2.mjs} +8 -9
- package/dist/{create-AeWNv0v-.mjs → create-E6L3WMqV.mjs} +8 -9
- package/dist/{create-LHqwcVbS.mjs → create-a3s1S2Dw.mjs} +11 -12
- package/dist/{create-branch-CGyT99Ny.mjs → create-branch-Dxn6UnV_.mjs} +5 -7
- package/dist/{create-BpkWlgoR.mjs → create-oLb0E-ZP.mjs} +17 -14
- package/dist/csv-T6_vlLJS.mjs +58 -0
- package/dist/{current-task-C-0hw2Ae.mjs → current-task-DxWbw-bU.mjs} +5 -7
- package/dist/{dashboard-DOplbKyQ.mjs → dashboard-B-MTpfeS.mjs} +35 -15
- package/dist/dashboard-BpSPoeAn.mjs +35 -0
- package/dist/{database-D9fftP-i.mjs → database-CIbVSfua.mjs} +2 -2
- package/dist/db-DBRijnh4.mjs +27 -0
- package/dist/{delete-tCVrYjKD.mjs → delete--P1xFX37.mjs} +6 -8
- package/dist/{delete-Do3nn9sl.mjs → delete-BBOIUl0D.mjs} +6 -8
- package/dist/{delete--NYYN6wv.mjs → delete-Ce2EBQYA.mjs} +6 -8
- package/dist/{delete-runtime-B0ha5QR4.mjs → delete-runtime-B-8I9V1g.mjs} +2 -3
- package/dist/{delete-table-CWSGPw0i.mjs → delete-table-Bj32NsXn.mjs} +6 -8
- package/dist/{dependencies-CyFocD8I.mjs → dependencies-ixzjVjUz.mjs} +5 -7
- package/dist/{dirty-BXM0YJ_a.mjs → dirty-CH70h5m5.mjs} +5 -7
- package/dist/{document-1W7NRaO_.mjs → document-CL4ML5FN.mjs} +20 -4
- package/dist/document-dZpuFu3I.mjs +22 -0
- package/dist/{eid-p-zn_1RJ.mjs → eid-XjkBbyb_.mjs} +10 -11
- package/dist/embedding-CKdw8q7p.mjs +11 -0
- package/dist/{export-B_8wghyo.mjs → export-CChMg-mL.mjs} +7 -9
- package/dist/field-B1heFeCz.mjs +21 -0
- package/dist/{field-CMY_LWUe.mjs → field-DsXTeqBy.mjs} +6 -4
- package/dist/{fields-BsufL9kv.mjs → fields-C7h2QwUp.mjs} +6 -8
- package/dist/{get-Cl5Ak73C.mjs → get-AvGH_oph.mjs} +8 -9
- package/dist/{get-DurjkUKJ.mjs → get-B6ZJCJ8H.mjs} +5 -7
- package/dist/{get-68P-L4ja.mjs → get-BWHJDa0B.mjs} +5 -7
- package/dist/{get-B67pe00Z.mjs → get-BsyccuCH.mjs} +5 -7
- package/dist/{get-C7mq17-2.mjs → get-C98IFgFi.mjs} +5 -7
- package/dist/{get-BTKeO4vE.mjs → get-Cj90oyxG.mjs} +5 -7
- package/dist/{get-BJoZkATD.mjs → get-D9r2znrn.mjs} +5 -7
- package/dist/{get-D3k2JUsa.mjs → get-DRZENkCj.mjs} +5 -7
- package/dist/{get-4lufgahL.mjs → get-DWWmpQ87.mjs} +5 -7
- package/dist/{get-CPw0ROO4.mjs → get-Dg1J0wxb.mjs} +5 -7
- package/dist/{get-B45uYMAs.mjs → get-DrWYvefc.mjs} +7 -8
- package/dist/{get-DTqBuIf3.mjs → get-KVN9ANVh.mjs} +4 -6
- package/dist/get-RlP_xiUd.mjs +67 -0
- package/dist/{get-Df_3LCVC.mjs → get-cyR67Lmq.mjs} +5 -7
- package/dist/{get-DeLnNVQE.mjs → get-kqY2lwhO.mjs} +16 -9
- package/dist/{get-run-Dq4qfGfD.mjs → get-run-C4C_QQqO.mjs} +5 -7
- package/dist/git-sync-JHa7bIyY.mjs +31 -0
- package/dist/{group-BNE_RiH5.mjs → group-CILtQqCL.mjs} +2 -1
- package/dist/{has-remote-changes-E-4N_O_t.mjs → has-remote-changes-dLUGr0MD.mjs} +5 -7
- package/dist/{import-Dg0j3HCP.mjs → import-Byull6jF.mjs} +7 -9
- package/dist/{input-7Sj85_K7.mjs → input-m9ctfLxZ.mjs} +6 -3
- package/dist/is-dirty-Bb2dfEYs.mjs +8 -0
- package/dist/{is-dirty-DWw1yBeR.mjs → is-dirty-CU3ovgdG.mjs} +3 -4
- package/dist/{items-CQtt9X4M.mjs → items-CEGDYWuF.mjs} +7 -9
- package/dist/{key-bltP32Pm.mjs → key-Ge4VwWvS.mjs} +1 -1
- package/dist/{library-B5AvpACG.mjs → library-DHWWa4Tt.mjs} +6 -6
- package/dist/{list-BFVuPodI.mjs → list-3z1ZChTG.mjs} +4 -6
- package/dist/{list-D3TSAqwl.mjs → list-B9TyELob.mjs} +4 -6
- package/dist/{list-BAOTQHst.mjs → list-BFm4iEBt.mjs} +4 -6
- package/dist/{list-BKUvhAs4.mjs → list-BliCJAjt.mjs} +4 -6
- package/dist/{list-BgUWqZa2.mjs → list-Bpv06V24.mjs} +6 -8
- package/dist/{list-DG0FIhTK.mjs → list-Br48kL09.mjs} +4 -6
- package/dist/{list-BHAWYZ1z.mjs → list-BtcpNl4-.mjs} +4 -6
- package/dist/{list-B1uVWy6A.mjs → list-BuyRG3GB.mjs} +7 -8
- package/dist/{list-CvhVYOVl.mjs → list-CMb03cv3.mjs} +5 -7
- package/dist/{list-CfqpDTna.mjs → list-CmCJwaGT.mjs} +4 -6
- package/dist/{list-C4bALfCs.mjs → list-Cur_72xZ.mjs} +5 -7
- package/dist/{list-BF-W4jOZ.mjs → list-D9FY30xH.mjs} +8 -9
- package/dist/{list-D5Gdz8hi.mjs → list-DEkPxVZu.mjs} +4 -6
- package/dist/{list-C9O2RY5u.mjs → list-O2w5xd1q.mjs} +4 -6
- package/dist/{list-KxQNqp4T.mjs → list-th_Ym6Cv.mjs} +6 -8
- package/dist/{login-Bt6j6yBM.mjs → login-hKlYsAa1.mjs} +8 -10
- package/dist/{logout-ANkL02p0.mjs → logout-DO8GVC6b.mjs} +4 -6
- package/dist/measure-R3T20wnB.mjs +25 -0
- package/dist/{measure-DoJvtCaA.mjs → measure-S9WszHre.mjs} +5 -4
- package/dist/{parameter-values-D4J8Ctu0.mjs → parameter-values-BJb2GuLz.mjs} +7 -9
- package/dist/{parse-enum-BL9i_brN.mjs → parse-enum-Cfne2suT.mjs} +1 -1
- package/dist/{parse-id-D4LeTUsP.mjs → parse-id-DfY0Lugw.mjs} +1 -1
- package/dist/{parse-ref-CB_KvF9h.mjs → parse-ref-C_MsXYI6.mjs} +1 -1
- package/dist/{path-5nQgdvrs.mjs → path-DzhQVCH8.mjs} +4 -6
- package/dist/{poll-BpAJpvb-.mjs → poll-D1Yg78c3.mjs} +2 -2
- package/dist/{poll-task-TilgciQn.mjs → poll-task-DLUZaglY.mjs} +2 -2
- package/dist/{preflight-OfHU3Toi.mjs → preflight-Cy2jUSca.mjs} +4 -5
- package/dist/{process-j8UHMHc2.mjs → process-D5HN1wpT.mjs} +1 -1
- package/dist/{prompt-C85xd9HR.mjs → prompt-ZG9Drin_.mjs} +1 -1
- package/dist/{publish-DKiqyDwo.mjs → publish-3hmHoaX-.mjs} +7 -9
- package/dist/{query-CQ3xXa9P.mjs → query-DTASj9Zu.mjs} +9 -10
- package/dist/{query-BWJ5h1g3.mjs → query-DkZViD_3.mjs} +15 -15
- package/dist/{query-result-D6mfoVfQ.mjs → query-result-CbTFdlSf.mjs} +1 -1
- package/dist/{remove-collection-CO-aMzTO.mjs → remove-collection-D3wH9H6R.mjs} +7 -9
- package/dist/replace-CFzqkZXs.mjs +42 -0
- package/dist/requests-KBiY9UYy.mjs +96 -0
- package/dist/{rescan-values-DpL6LGAK.mjs → rescan-values-B1WycObS.mjs} +7 -9
- package/dist/{resolve-Dj2MTBkn.mjs → resolve-Ct084wx3.mjs} +1 -1
- package/dist/{run-DUcdaZs3.mjs → run-B8qEEdC8.mjs} +4 -6
- package/dist/{run-QYJ-mAaG.mjs → run-cw0qTEQ7.mjs} +7 -9
- package/dist/{runs-DgasTnGd.mjs → runs-BOA4kK_X.mjs} +6 -8
- package/dist/{runtime-BJtuxWM8.mjs → runtime-B-c-Fc2i.mjs} +3 -4
- package/dist/{schema-tables-ooYjimrV.mjs → schema-tables-DRYzSVcW.mjs} +6 -8
- package/dist/{schemas-HjFPzsd-.mjs → schemas-BiMjD25L.mjs} +4 -6
- package/dist/{search-vaT5EwhG.mjs → search-DjKxRXO5.mjs} +4 -6
- package/dist/{segment-TXktTCfU.mjs → segment-BPb1H6DW.mjs} +6 -5
- package/dist/segment-CZkk0g79.mjs +25 -0
- package/dist/{selectors-DlmZpo2L.mjs → selectors-B7MJUn3I.mjs} +3 -3
- package/dist/{set-active-oZOUe9V7.mjs → set-active-CF868qdW.mjs} +4 -6
- package/dist/{set-CLHJauzG.mjs → set-kyoORFG3.mjs} +10 -10
- package/dist/setting-BZgjURQ_.mjs +20 -0
- package/dist/{setup-D1de5Sbc.mjs → setup-D9joJYPb.mjs} +11 -12
- package/dist/{skills-B6gfH0iR.mjs → skills-BqI05u72.mjs} +1 -1
- package/dist/{skills-NhgVypJ7.mjs → skills-D8NrJxjp.mjs} +3 -3
- package/dist/{snippet-CtA2Pkoa.mjs → snippet-DWiXNy4T.mjs} +7 -4
- package/dist/snippet-y_FzKxaQ.mjs +22 -0
- package/dist/{stash-DoRwelwY.mjs → stash-BVMerTaF.mjs} +7 -9
- package/dist/{status-CmRgHTrV.mjs → status-C-0jFjFn.mjs} +4 -6
- package/dist/{status-BpMOlfsA.mjs → status-x8bDOa1i.mjs} +6 -8
- package/dist/{summary-BEu7pmpq.mjs → summary-B-R9SdMF.mjs} +5 -7
- package/dist/{sync-schema-DTUXubMg.mjs → sync-schema-wne2KXIW.mjs} +9 -11
- package/dist/{table-DE3i82T_.mjs → table-C3RIKiYM.mjs} +16 -4
- package/dist/table-CS2-2INi.mjs +21 -0
- package/dist/transform-6hqM1DXA.mjs +31 -0
- package/dist/{transform-DEF38FWe.mjs → transform-JQel7e5H.mjs} +31 -5
- package/dist/transform-job-DuERhLaj.mjs +25 -0
- package/dist/transform-tag-DaNKreDj.mjs +21 -0
- package/dist/{transforms-CWvMpLc9.mjs → transforms-DB2WNP2R.mjs} +5 -7
- package/dist/{tree-D18vYSe4.mjs → tree-BIOphGVs.mjs} +4 -6
- package/dist/{unpublish-CJbL4ZsC.mjs → unpublish-BWM36ZTg.mjs} +5 -7
- package/dist/{update-mr9todHq.mjs → update-6umfSz5t.mjs} +9 -10
- package/dist/{update-BjjZIe2W.mjs → update-7Ts7KrB8.mjs} +9 -10
- package/dist/{update-Doia9MP_.mjs → update-BCbv880u.mjs} +12 -13
- package/dist/{update-CSxwZ2us.mjs → update-BchtHlbH.mjs} +10 -11
- package/dist/{update-BvsvyBw9.mjs → update-BiUeEGU-.mjs} +12 -13
- package/dist/{update-DhOfrW1j.mjs → update-BlzcZwRQ.mjs} +18 -15
- package/dist/{update-Bos8nnv0.mjs → update-CTZg2Lia.mjs} +13 -14
- package/dist/{update-DV7IY7IQ.mjs → update-DJDuIhYG.mjs} +9 -10
- package/dist/{update-Dxa_6H2A.mjs → update-HxYcvpSq.mjs} +15 -15
- package/dist/{update-Ck0Kxv8u.mjs → update-Sz0QRGWB.mjs} +9 -10
- package/dist/{update-dashcard-CZUWZhal.mjs → update-dashcard-CfDpy7Lz.mjs} +11 -11
- package/dist/{update-7DacwIvi.mjs → update-zfLbmC-H.mjs} +9 -10
- package/dist/{upgrade-CBW8V9qZ.mjs → upgrade-BWl0VjMK.mjs} +5 -7
- package/dist/upload-CPzOhGeX.mjs +16 -0
- package/dist/{uuid-D6JVJ-R1.mjs → uuid-D_YeqDui.mjs} +3 -5
- package/dist/{validate-BqNW4Sk1.mjs → validate-clAWO3X-.mjs} +1 -2
- package/dist/{validate-query-CcZVKYPV.mjs → validate-query-CsK2_2_u.mjs} +2 -3
- package/dist/{values-DBvuGnnA.mjs → values-DSk8ZJ3B.mjs} +5 -7
- package/dist/{verify-LIShMNZ2.mjs → verify-DkQdLjf3.mjs} +2 -2
- package/dist/{wait-DUHze3_B.mjs → wait-DvSsMjea.mjs} +6 -8
- package/dist/{wait-flags-Ybpt98PK.mjs → wait-flags-dXGThljd.mjs} +2 -2
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +31 -22
- package/skill-data/dashboard/SKILL.md +130 -0
- package/skill-data/data-workflow/SKILL.md +17 -15
- package/skill-data/data-workflow/references/building-clean-tables.md +1 -1
- package/skill-data/document/SKILL.md +3 -3
- package/skill-data/git-sync/SKILL.md +5 -5
- package/skill-data/mbql/SKILL.md +17 -17
- package/skill-data/mbql/references/operators.md +4 -3
- package/skill-data/metadata/SKILL.md +78 -0
- package/skill-data/metadata/references/semantic-types.md +83 -0
- package/skill-data/native-sql/SKILL.md +118 -0
- package/skill-data/native-sql/references/template-tags.md +178 -0
- package/skill-data/transform/SKILL.md +6 -6
- package/skill-data/visualization/SKILL.md +3 -3
- package/skill-data/visualization/references/settings.md +2 -0
- package/dist/add-collection-Dek6kiRI.mjs +0 -11
- package/dist/auth-Kv2MRkRk.mjs +0 -22
- package/dist/capabilities-N0jo5U7S.mjs +0 -239
- package/dist/card-Bp58WEUF.mjs +0 -26
- package/dist/collection-D8TI20Ir.mjs +0 -23
- package/dist/dashboard-C9pQCnX6.mjs +0 -28
- package/dist/db-DWykmBOh.mjs +0 -28
- package/dist/document-DNDm8_Py.mjs +0 -22
- package/dist/error-5H_tcfL8.mjs +0 -227
- package/dist/field-CFt1-KDR.mjs +0 -21
- package/dist/get-CDLa6LiC.mjs +0 -50
- package/dist/git-sync-ByvjqSiy.mjs +0 -31
- package/dist/is-dirty-D7UMN0mt.mjs +0 -10
- package/dist/manifest-BVf8P4bl.mjs +0 -126
- package/dist/measure-CgFwtL1r.mjs +0 -25
- package/dist/metadata-ClehtgZj.mjs +0 -39
- package/dist/metadata-DplshwI3.mjs +0 -38
- package/dist/notice-DyVl5aYB.mjs +0 -206
- package/dist/segment-BPC725mo.mjs +0 -25
- package/dist/setting-DHYO-W5g.mjs +0 -20
- package/dist/snippet-DtLmHr2J.mjs +0 -22
- package/dist/table-B1iBqmNu.mjs +0 -22
- package/dist/transform-BuIooRQh.mjs +0 -31
- package/dist/transform-job-C3yz0krA.mjs +0 -25
- package/dist/transform-tag-CJD6mJUe.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/{paginate-FVZUxL4J.mjs → paginate-CMqbqhMC.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/{revision-message-flag-CHrJgFFx.mjs → revision-message-flag-CHzX0cqV.mjs} +0 -0
- /package/dist/{setting-m46MUtW5.mjs → setting-Cko6bE_w.mjs} +0 -0
- /package/dist/{transform-job-CtixL4An.mjs → transform-job-CtVziW85.mjs} +0 -0
- /package/dist/{transform-tag-rsIrckCM.mjs → transform-tag-wFiWmiyO.mjs} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EmbeddingParams } from "./embedding-CKdw8q7p.mjs";
|
|
2
|
+
import { FieldBaseType, FieldSemanticType } from "./field-DsXTeqBy.mjs";
|
|
3
|
+
import { Parameter, ParameterMapping } from "./parameter-BZ6y-Gfs.mjs";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
|
|
5
6
|
//#region src/domain/card.ts
|
|
@@ -9,7 +10,7 @@ const CardType = z.enum([
|
|
|
9
10
|
"metric"
|
|
10
11
|
]);
|
|
11
12
|
const CardQueryType = z.enum(["native", "query"]);
|
|
12
|
-
const CardDatasetQuery = z.object({}).loose().refine((value) => "lib/type" in value || "type" in value, { message: "dataset_query must include \"lib/type\" (MBQL 5) or \"type\" (legacy MBQL/native); empty `{}` is rejected" });
|
|
13
|
+
const CardDatasetQuery = z.object({}).loose().refine((value) => "lib/type" in value || "type" in value, { message: "dataset_query must include \"lib/type\" (MBQL 5) or \"type\" (legacy MBQL/native); empty `{}` is rejected" }).describe("MBQL 5, legacy MBQL, or native query — full MBQL 5 schema: mb query --print-schema");
|
|
13
14
|
const Card = z.object({
|
|
14
15
|
id: z.number().int(),
|
|
15
16
|
name: z.string(),
|
|
@@ -70,38 +71,43 @@ const cardView = {
|
|
|
70
71
|
}
|
|
71
72
|
]
|
|
72
73
|
};
|
|
74
|
+
const CollectionIdOrEntityId = z.union([z.number().int().positive(), z.string().length(21).describe("collection entity_id (21-char NanoID)")]);
|
|
73
75
|
const CardCreateInput = z.object({
|
|
74
76
|
name: z.string().min(1),
|
|
75
|
-
type: CardType.optional(),
|
|
77
|
+
type: CardType.nullable().optional(),
|
|
76
78
|
dataset_query: CardDatasetQuery,
|
|
77
79
|
display: z.string().min(1),
|
|
78
80
|
visualization_settings: z.record(z.string(), z.unknown()),
|
|
79
81
|
description: z.string().min(1).nullable().optional(),
|
|
80
|
-
|
|
82
|
+
entity_id: z.string().min(1).nullable().optional(),
|
|
83
|
+
collection_id: CollectionIdOrEntityId.nullable().optional(),
|
|
81
84
|
collection_position: z.number().int().positive().nullable().optional(),
|
|
85
|
+
cache_ttl: z.number().int().positive().nullable().optional(),
|
|
82
86
|
dashboard_id: z.number().int().positive().nullable().optional(),
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
dashboard_tab_id: z.number().int().positive().nullable().optional(),
|
|
88
|
+
parameters: z.array(Parameter).nullable().optional(),
|
|
89
|
+
parameter_mappings: z.array(ParameterMapping).nullable().optional(),
|
|
90
|
+
result_metadata: z.array(z.unknown()).nullable().optional()
|
|
85
91
|
}).loose();
|
|
86
92
|
const CardUpdateInput = z.object({
|
|
87
|
-
name: z.string().min(1).optional(),
|
|
88
|
-
type: CardType.optional(),
|
|
93
|
+
name: z.string().min(1).nullable().optional(),
|
|
94
|
+
type: CardType.nullable().optional(),
|
|
89
95
|
dataset_query: CardDatasetQuery.optional(),
|
|
90
|
-
display: z.string().min(1).optional(),
|
|
91
|
-
visualization_settings: z.record(z.string(), z.unknown()).optional(),
|
|
96
|
+
display: z.string().min(1).nullable().optional(),
|
|
97
|
+
visualization_settings: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
92
98
|
description: z.string().nullable().optional(),
|
|
93
|
-
archived: z.boolean().optional(),
|
|
94
|
-
enable_embedding: z.boolean().optional(),
|
|
95
|
-
embedding_type: z.string().optional(),
|
|
96
|
-
embedding_params:
|
|
99
|
+
archived: z.boolean().nullable().optional(),
|
|
100
|
+
enable_embedding: z.boolean().nullable().optional(),
|
|
101
|
+
embedding_type: z.string().nullable().optional(),
|
|
102
|
+
embedding_params: EmbeddingParams.nullable().optional(),
|
|
97
103
|
collection_id: z.number().int().positive().nullable().optional(),
|
|
98
104
|
collection_position: z.number().int().positive().nullable().optional(),
|
|
99
|
-
collection_preview: z.boolean().optional(),
|
|
105
|
+
collection_preview: z.boolean().nullable().optional(),
|
|
100
106
|
cache_ttl: z.number().int().positive().nullable().optional(),
|
|
101
107
|
dashboard_id: z.number().int().positive().nullable().optional(),
|
|
102
108
|
dashboard_tab_id: z.number().int().positive().nullable().optional(),
|
|
103
|
-
parameters: z.array(Parameter).optional(),
|
|
104
|
-
parameter_mappings: z.array(ParameterMapping).optional(),
|
|
109
|
+
parameters: z.array(Parameter).nullable().optional(),
|
|
110
|
+
parameter_mappings: z.array(ParameterMapping).nullable().optional(),
|
|
105
111
|
result_metadata: z.array(z.unknown()).nullable().optional()
|
|
106
112
|
}).loose();
|
|
107
113
|
const QueryColumn = z.object({
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
2
|
+
import { defineCommandGroup } from "./group-CILtQqCL.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/commands/card/index.ts
|
|
5
|
+
var card_default = defineCommandGroup({
|
|
6
|
+
name: "card",
|
|
7
|
+
description: "Manage Metabase cards (questions, models, metrics)",
|
|
8
|
+
skills: [{
|
|
9
|
+
skill: "mbql",
|
|
10
|
+
purpose: "author the dataset_query"
|
|
11
|
+
}, {
|
|
12
|
+
skill: "visualization",
|
|
13
|
+
purpose: "choose display and visualization_settings"
|
|
14
|
+
}],
|
|
15
|
+
subCommands: {
|
|
16
|
+
list: () => import("./list-D9FY30xH.mjs").then((mod) => mod.default),
|
|
17
|
+
get: () => import("./get-AvGH_oph.mjs").then((mod) => mod.default),
|
|
18
|
+
query: () => import("./query-DTASj9Zu.mjs").then((mod) => mod.default),
|
|
19
|
+
create: () => import("./create-C8ndg3g4.mjs").then((mod) => mod.default),
|
|
20
|
+
update: () => import("./update-HxYcvpSq.mjs").then((mod) => mod.default),
|
|
21
|
+
archive: () => import("./archive-pHsa4dL0.mjs").then((mod) => mod.default)
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { card_default as default };
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import { DashboardDetail, DashcardCompact, dashcardView } from "./dashboard-DOplbKyQ.mjs";
|
|
1
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList, wrapList } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./embedding-CKdw8q7p.mjs";
|
|
5
|
+
import "./parameter-BZ6y-Gfs.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
7
|
+
import { DashboardDetail, DashcardCompact, dashcardView } from "./dashboard-B-MTpfeS.mjs";
|
|
9
8
|
|
|
10
9
|
//#region src/commands/dashboard/cards.ts
|
|
11
10
|
const DashcardListEnvelope = listEnvelopeSchema(DashcardCompact);
|
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { ConfigError, flagConsumesValue, normalizeFlag, resolveCitty, toAliasArray } from "./
|
|
3
|
-
import {
|
|
4
|
-
import { getMetabaseAugment, setMetabaseAugment } from "./command-augment-DdZIfx1V.mjs";
|
|
2
|
+
import { Capabilities, ConfigError, connectionFlags, flagConsumesValue, jsonLine, normalizeFlag, outputFlags, package_default, profileFlag, reportError, resolveCitty, toAliasArray } from "./capabilities-DrDJo_ng.mjs";
|
|
3
|
+
import { getMetabaseAugment, setMetabaseAugment } from "./command-augment-D9pI9Vbh.mjs";
|
|
5
4
|
import { defineCommand, renderUsage, runMain } from "citty";
|
|
5
|
+
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/commands/global-flags.ts
|
|
8
8
|
const ARGUMENT_SEPARATOR = "--";
|
|
@@ -59,31 +59,31 @@ const main = defineCommand({
|
|
|
59
59
|
description: package_default.description
|
|
60
60
|
},
|
|
61
61
|
subCommands: {
|
|
62
|
-
auth: () => import("./auth-
|
|
63
|
-
db: () => import("./db-
|
|
64
|
-
table: () => import("./table-
|
|
65
|
-
field: () => import("./field-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
"transform-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
62
|
+
auth: () => import("./auth-BrQtY0pO.mjs").then((mod) => mod.default),
|
|
63
|
+
db: () => import("./db-DBRijnh4.mjs").then((mod) => mod.default),
|
|
64
|
+
table: () => import("./table-CS2-2INi.mjs").then((mod) => mod.default),
|
|
65
|
+
field: () => import("./field-B1heFeCz.mjs").then((mod) => mod.default),
|
|
66
|
+
upload: () => import("./upload-CPzOhGeX.mjs").then((mod) => mod.default),
|
|
67
|
+
card: () => import("./card-DHCcmpgr.mjs").then((mod) => mod.default),
|
|
68
|
+
dashboard: () => import("./dashboard-BpSPoeAn.mjs").then((mod) => mod.default),
|
|
69
|
+
collection: () => import("./collection-D0O9gp3S.mjs").then((mod) => mod.default),
|
|
70
|
+
library: () => import("./library-DHWWa4Tt.mjs").then((mod) => mod.default),
|
|
71
|
+
document: () => import("./document-dZpuFu3I.mjs").then((mod) => mod.default),
|
|
72
|
+
transform: () => import("./transform-6hqM1DXA.mjs").then((mod) => mod.default),
|
|
73
|
+
"transform-job": () => import("./transform-job-DuERhLaj.mjs").then((mod) => mod.default),
|
|
74
|
+
"transform-tag": () => import("./transform-tag-DaNKreDj.mjs").then((mod) => mod.default),
|
|
75
|
+
setting: () => import("./setting-BZgjURQ_.mjs").then((mod) => mod.default),
|
|
76
|
+
search: () => import("./search-DjKxRXO5.mjs").then((mod) => mod.default),
|
|
77
|
+
"git-sync": () => import("./git-sync-JHa7bIyY.mjs").then((mod) => mod.default),
|
|
78
|
+
setup: () => import("./setup-D9joJYPb.mjs").then((mod) => mod.default),
|
|
79
|
+
snippet: () => import("./snippet-y_FzKxaQ.mjs").then((mod) => mod.default),
|
|
80
|
+
segment: () => import("./segment-CZkk0g79.mjs").then((mod) => mod.default),
|
|
81
|
+
measure: () => import("./measure-R3T20wnB.mjs").then((mod) => mod.default),
|
|
82
|
+
eid: () => import("./eid-XjkBbyb_.mjs").then((mod) => mod.default),
|
|
83
|
+
query: () => import("./query-DkZViD_3.mjs").then((mod) => mod.default),
|
|
84
|
+
uuid: () => import("./uuid-D_YeqDui.mjs").then((mod) => mod.default),
|
|
85
|
+
upgrade: () => import("./upgrade-BWl0VjMK.mjs").then((mod) => mod.default),
|
|
86
|
+
skills: () => import("./skills-D8NrJxjp.mjs").then((mod) => mod.default)
|
|
87
87
|
}
|
|
88
88
|
});
|
|
89
89
|
setMetabaseAugment(main, {
|
|
@@ -96,11 +96,128 @@ setMetabaseAugment(main, {
|
|
|
96
96
|
skill: "data-workflow",
|
|
97
97
|
purpose: "guided end-to-end: raw data → clean tables → metrics → answers → dashboards"
|
|
98
98
|
}],
|
|
99
|
+
inputSchema: null,
|
|
99
100
|
outputSchema: null,
|
|
100
101
|
capabilities: null
|
|
101
102
|
});
|
|
102
103
|
var main_default = main;
|
|
103
104
|
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/runtime/command-help.ts
|
|
107
|
+
const CommandHelpArg = z.object({
|
|
108
|
+
name: z.string(),
|
|
109
|
+
type: z.enum([
|
|
110
|
+
"string",
|
|
111
|
+
"boolean",
|
|
112
|
+
"positional",
|
|
113
|
+
"enum"
|
|
114
|
+
]),
|
|
115
|
+
required: z.boolean(),
|
|
116
|
+
description: z.string().optional(),
|
|
117
|
+
default: z.union([
|
|
118
|
+
z.string(),
|
|
119
|
+
z.boolean(),
|
|
120
|
+
z.number()
|
|
121
|
+
]).optional(),
|
|
122
|
+
alias: z.array(z.string()).optional(),
|
|
123
|
+
options: z.array(z.string()).optional()
|
|
124
|
+
});
|
|
125
|
+
const CommandHelpSkill = z.object({
|
|
126
|
+
skill: z.string(),
|
|
127
|
+
purpose: z.string()
|
|
128
|
+
});
|
|
129
|
+
const CommandHelpEntry = z.object({
|
|
130
|
+
command: z.string(),
|
|
131
|
+
description: z.string(),
|
|
132
|
+
details: z.string().optional(),
|
|
133
|
+
skills: z.array(CommandHelpSkill),
|
|
134
|
+
examples: z.array(z.string()),
|
|
135
|
+
args: z.array(CommandHelpArg),
|
|
136
|
+
inputSchema: z.unknown().nullable(),
|
|
137
|
+
outputSchema: z.unknown().nullable(),
|
|
138
|
+
capabilities: Capabilities.nullable()
|
|
139
|
+
});
|
|
140
|
+
const CommandIndexEntry = z.object({
|
|
141
|
+
command: z.string(),
|
|
142
|
+
description: z.string()
|
|
143
|
+
});
|
|
144
|
+
const CommandHelpIndex = z.object({ commands: z.array(CommandIndexEntry) });
|
|
145
|
+
const EMPTY_AUGMENT = {
|
|
146
|
+
examples: [],
|
|
147
|
+
details: null,
|
|
148
|
+
skills: [],
|
|
149
|
+
inputSchema: null,
|
|
150
|
+
outputSchema: null,
|
|
151
|
+
capabilities: null
|
|
152
|
+
};
|
|
153
|
+
async function buildHelpEntry(cmd, path) {
|
|
154
|
+
const meta = await resolveCitty(cmd.meta);
|
|
155
|
+
const args = await resolveCitty(cmd.args) ?? {};
|
|
156
|
+
const augment = getMetabaseAugment(cmd) ?? EMPTY_AUGMENT;
|
|
157
|
+
const entry = {
|
|
158
|
+
command: path.join(" "),
|
|
159
|
+
description: readDescription(meta),
|
|
160
|
+
skills: Array.from(augment.skills),
|
|
161
|
+
examples: Array.from(augment.examples),
|
|
162
|
+
args: convertArgs(args),
|
|
163
|
+
inputSchema: augment.inputSchema ? z.toJSONSchema(augment.inputSchema) : null,
|
|
164
|
+
outputSchema: augment.outputSchema ? z.toJSONSchema(augment.outputSchema) : null,
|
|
165
|
+
capabilities: augment.capabilities
|
|
166
|
+
};
|
|
167
|
+
if (augment.details !== null) entry.details = augment.details;
|
|
168
|
+
return entry;
|
|
169
|
+
}
|
|
170
|
+
async function buildHelpIndex(cmd, path) {
|
|
171
|
+
return { commands: await walk(cmd, path) };
|
|
172
|
+
}
|
|
173
|
+
async function walk(cmd, path) {
|
|
174
|
+
const meta = await resolveCitty(cmd.meta);
|
|
175
|
+
if (meta?.hidden === true) return [];
|
|
176
|
+
const subCommands = await resolveCitty(cmd.subCommands);
|
|
177
|
+
if (subCommands && Object.keys(subCommands).length > 0) {
|
|
178
|
+
const groups = await Promise.all(Object.entries(subCommands).map(async ([name, lazy]) => {
|
|
179
|
+
const sub = await resolveCitty(lazy);
|
|
180
|
+
return sub ? walk(sub, [...path, name]) : [];
|
|
181
|
+
}));
|
|
182
|
+
return groups.flat();
|
|
183
|
+
}
|
|
184
|
+
return [{
|
|
185
|
+
command: path.join(" "),
|
|
186
|
+
description: readDescription(meta)
|
|
187
|
+
}];
|
|
188
|
+
}
|
|
189
|
+
function readDescription(meta) {
|
|
190
|
+
if (meta === void 0) return "";
|
|
191
|
+
return typeof meta.description === "string" ? meta.description : "";
|
|
192
|
+
}
|
|
193
|
+
function convertArgs(args) {
|
|
194
|
+
return Object.entries(args).map(([name, def]) => convertArg(name, def));
|
|
195
|
+
}
|
|
196
|
+
function convertArg(name, def) {
|
|
197
|
+
const arg = {
|
|
198
|
+
name,
|
|
199
|
+
type: def.type ?? "string",
|
|
200
|
+
required: def.required === true && def.default === void 0
|
|
201
|
+
};
|
|
202
|
+
if (def.description) arg.description = def.description;
|
|
203
|
+
if (isPrimitiveDefault(def.default)) arg.default = def.default;
|
|
204
|
+
const alias = readAlias(def);
|
|
205
|
+
if (alias.length > 0) arg.alias = alias;
|
|
206
|
+
const options = readOptions(def);
|
|
207
|
+
if (options.length > 0) arg.options = options;
|
|
208
|
+
return arg;
|
|
209
|
+
}
|
|
210
|
+
function readOptions(def) {
|
|
211
|
+
if (!("options" in def) || !Array.isArray(def.options)) return [];
|
|
212
|
+
return [...def.options];
|
|
213
|
+
}
|
|
214
|
+
function readAlias(def) {
|
|
215
|
+
return "alias" in def ? toAliasArray(def.alias) : [];
|
|
216
|
+
}
|
|
217
|
+
function isPrimitiveDefault(value) {
|
|
218
|
+
return typeof value === "string" || typeof value === "boolean" || typeof value === "number";
|
|
219
|
+
}
|
|
220
|
+
|
|
104
221
|
//#endregion
|
|
105
222
|
//#region src/output/help.ts
|
|
106
223
|
const ANSI_ESC = String.fromCharCode(27);
|
|
@@ -142,7 +259,30 @@ async function showUsage(cmd, parent, breadcrumb) {
|
|
|
142
259
|
if (examples.length > 0) sections.push(renderExamples(examples));
|
|
143
260
|
if (skills.length > 0) sections.push(renderSkillsSection(skills, isRoot));
|
|
144
261
|
if (isRoot) sections.push(GETTING_STARTED_HINT);
|
|
145
|
-
|
|
262
|
+
sections.push(machineHelpHint(breadcrumb ?? cittyName, hasSubCommands));
|
|
263
|
+
await writeUsage(sections.join("\n\n") + "\n");
|
|
264
|
+
}
|
|
265
|
+
async function showUsageJson(cmd, breadcrumb) {
|
|
266
|
+
const path = breadcrumbPath(breadcrumb);
|
|
267
|
+
const subCommands = await resolveCitty(cmd.subCommands);
|
|
268
|
+
const hasSubCommands = subCommands !== void 0 && Object.keys(subCommands).length > 0;
|
|
269
|
+
const payload = hasSubCommands ? await buildHelpIndex(cmd, path) : await buildHelpEntry(cmd, path);
|
|
270
|
+
await writeUsage(jsonLine(payload));
|
|
271
|
+
}
|
|
272
|
+
function writeUsage(text) {
|
|
273
|
+
return new Promise((resolve, reject) => {
|
|
274
|
+
process.stdout.write(text, (error) => error ? reject(error) : resolve());
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
function breadcrumbPath(breadcrumb) {
|
|
278
|
+
const segments = breadcrumb.split(" ").filter((segment) => segment.length > 0);
|
|
279
|
+
return segments[0] === CLI_NAME ? segments.slice(1) : segments;
|
|
280
|
+
}
|
|
281
|
+
const MACHINE_HELP_LEAF_LABEL = "Machine-readable help (flags, output schema):";
|
|
282
|
+
const MACHINE_HELP_INDEX_LABEL = "Machine-readable command index:";
|
|
283
|
+
function machineHelpHint(breadcrumb, hasSubCommands) {
|
|
284
|
+
const label = hasSubCommands ? MACHINE_HELP_INDEX_LABEL : MACHINE_HELP_LEAF_LABEL;
|
|
285
|
+
return `${label} ${breadcrumb} --help --json`;
|
|
146
286
|
}
|
|
147
287
|
function transformBody(lines, rewrite) {
|
|
148
288
|
const mapped = lines.map((line, index) => {
|
|
@@ -290,10 +430,16 @@ async function findSubCommand(subCommands, token) {
|
|
|
290
430
|
//#endregion
|
|
291
431
|
//#region src/cli.ts
|
|
292
432
|
const HELP_FLAGS = new Set(["--help", "-h"]);
|
|
433
|
+
const JSON_HELP_FLAG = "--json";
|
|
293
434
|
async function run() {
|
|
294
435
|
const rawArgs = hoistGlobalFlags(process.argv.slice(2));
|
|
436
|
+
const wantsJsonHelp = rawArgs.includes(JSON_HELP_FLAG);
|
|
295
437
|
const showUsageWithBreadcrumb = async (cmd, parent) => {
|
|
296
438
|
const breadcrumb = await resolveBreadcrumb(main_default, rawArgs);
|
|
439
|
+
if (wantsJsonHelp) {
|
|
440
|
+
await showUsageJson(cmd, breadcrumb);
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
297
443
|
await showUsage(cmd, parent, breadcrumb);
|
|
298
444
|
};
|
|
299
445
|
if (rawArgs.length === 0) {
|
|
@@ -159,7 +159,7 @@ const CollectionTreeNodeBase = z.object({
|
|
|
159
159
|
const CollectionTreeNode = CollectionTreeNodeBase.extend({ children: z.lazy(() => z.array(CollectionTreeNode)) });
|
|
160
160
|
const CollectionCreateInput = z.object({
|
|
161
161
|
name: z.string().min(1),
|
|
162
|
-
description: z.string().nullable().optional(),
|
|
162
|
+
description: z.string().min(1).nullable().optional(),
|
|
163
163
|
parent_id: z.number().int().positive().nullable().optional(),
|
|
164
164
|
namespace: CollectionNamespace.nullable().optional(),
|
|
165
165
|
authority_level: CollectionAuthorityLevel.nullable().optional()
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
2
|
+
import { defineCommandGroup } from "./group-CILtQqCL.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/commands/collection/index.ts
|
|
5
|
+
var collection_default = defineCommandGroup({
|
|
6
|
+
name: "collection",
|
|
7
|
+
description: "Manage Metabase collections",
|
|
8
|
+
skills: [{
|
|
9
|
+
skill: "core",
|
|
10
|
+
purpose: "collection ref forms and the transforms namespace"
|
|
11
|
+
}],
|
|
12
|
+
subCommands: {
|
|
13
|
+
list: () => import("./list-Cur_72xZ.mjs").then((mod) => mod.default),
|
|
14
|
+
get: () => import("./get-DWWmpQ87.mjs").then((mod) => mod.default),
|
|
15
|
+
items: () => import("./items-CEGDYWuF.mjs").then((mod) => mod.default),
|
|
16
|
+
tree: () => import("./tree-BIOphGVs.mjs").then((mod) => mod.default),
|
|
17
|
+
create: () => import("./create-C17Fh1_X.mjs").then((mod) => mod.default),
|
|
18
|
+
archive: () => import("./archive-CWtUzlHO.mjs").then((mod) => mod.default)
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
export { collection_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigError } from "./
|
|
2
|
-
import { HttpError } from "./runtime-
|
|
1
|
+
import { ConfigError } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import { HttpError } from "./runtime-B-c-Fc2i.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/transform/collection-namespace.ts
|
|
5
5
|
const TRANSFORMS_NAMESPACE_HINT = "transforms can only be filed in a :transforms-namespace collection. Create one with `mb collection create --body '{\"name\":\"…\"}' --namespace transforms` and pass its id as collection_id, or omit collection_id to leave the transform uncollected.";
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import "./
|
|
10
|
-
import { SEGMENT_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-CcZVKYPV.mjs";
|
|
11
|
-
import { Segment, SegmentCreateInput, segmentView } from "./segment-TXktTCfU.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./input-m9ctfLxZ.mjs";
|
|
5
|
+
import { readBody } from "./body-C1_AaTS4.mjs";
|
|
6
|
+
import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
|
|
7
|
+
import "./validate-clAWO3X-.mjs";
|
|
8
|
+
import { SEGMENT_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-CsK2_2_u.mjs";
|
|
9
|
+
import { Segment, SegmentCreateInput, segmentView } from "./segment-BPb1H6DW.mjs";
|
|
12
10
|
|
|
13
11
|
//#region src/commands/segment/create.ts
|
|
14
12
|
var create_default = defineMetabaseCommand({
|
|
@@ -16,7 +14,7 @@ var create_default = defineMetabaseCommand({
|
|
|
16
14
|
name: "create",
|
|
17
15
|
description: "Create a segment (saved filter) from JSON"
|
|
18
16
|
},
|
|
19
|
-
details: "A segment is a reusable, saved row filter tied to a table. The JSON body needs `name`, `table_id`, and a `definition` (an MBQL query holding the filter). An MBQL 5 `definition` is checked against a bundled JSON Schema before sending; pass --skip-validate to bypass.",
|
|
17
|
+
details: "A segment is a reusable, saved row filter tied to a table. The JSON body needs `name`, `table_id`, and a `definition` (an MBQL query holding the filter). An MBQL 5 `definition` is checked against a bundled JSON Schema (print it with `mb query --print-schema`) before sending; pass --skip-validate to bypass.",
|
|
20
18
|
skills: [{
|
|
21
19
|
skill: "mbql",
|
|
22
20
|
purpose: "the definition filter clause"
|
|
@@ -29,6 +27,7 @@ var create_default = defineMetabaseCommand({
|
|
|
29
27
|
...bodyInputFlags,
|
|
30
28
|
...skipValidateFlag
|
|
31
29
|
},
|
|
30
|
+
inputSchema: SegmentCreateInput,
|
|
32
31
|
outputSchema: Segment,
|
|
33
32
|
examples: [
|
|
34
33
|
"cat segment.json | mb segment create",
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import "./
|
|
10
|
-
import {
|
|
11
|
-
import { Transform, TransformCreateInput, transformView } from "./transform-DEF38FWe.mjs";
|
|
12
|
-
import { enrichTransformCollectionError } from "./collection-namespace-CsaxEqOb.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./input-m9ctfLxZ.mjs";
|
|
5
|
+
import { readBody } from "./body-C1_AaTS4.mjs";
|
|
6
|
+
import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
|
|
7
|
+
import "./validate-clAWO3X-.mjs";
|
|
8
|
+
import { TRANSFORM_SOURCE_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-CsK2_2_u.mjs";
|
|
9
|
+
import { Transform, TransformCreateInput, transformView } from "./transform-JQel7e5H.mjs";
|
|
10
|
+
import { enrichTransformCollectionError } from "./collection-namespace-DqPNrCdQ.mjs";
|
|
13
11
|
|
|
14
12
|
//#region src/commands/transform/create.ts
|
|
15
13
|
var create_default = defineMetabaseCommand({
|
|
@@ -17,7 +15,7 @@ var create_default = defineMetabaseCommand({
|
|
|
17
15
|
name: "create",
|
|
18
16
|
description: "Create a transform from JSON"
|
|
19
17
|
},
|
|
20
|
-
details: "The JSON body needs a `name`, a `source` (the query to run — native SQL or MBQL — under `source.query`), and a `target` (the warehouse table to write, with `database`/`schema`/`name`). When `source.query` is an MBQL 5 query it is checked against a bundled JSON Schema before sending; pass --skip-validate to bypass.",
|
|
18
|
+
details: "The JSON body needs a `name`, a `source` (the query to run — native SQL or MBQL — under `source.query`), and a `target` (the warehouse table to write, with `database`/`schema`/`name`). When `source.query` is an MBQL 5 query it is checked against a bundled JSON Schema (print it with `mb query --print-schema`) before sending; pass --skip-validate to bypass.",
|
|
21
19
|
skills: [{
|
|
22
20
|
skill: "mbql",
|
|
23
21
|
purpose: "MBQL source.query bodies"
|
|
@@ -30,6 +28,7 @@ var create_default = defineMetabaseCommand({
|
|
|
30
28
|
...bodyInputFlags,
|
|
31
29
|
...skipValidateFlag
|
|
32
30
|
},
|
|
31
|
+
inputSchema: TransformCreateInput,
|
|
33
32
|
outputSchema: Transform,
|
|
34
33
|
examples: [
|
|
35
34
|
"cat transform.json | mb transform create",
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { parseEnumFlag } from "./parse-enum-BL9i_brN.mjs";
|
|
10
|
-
import { Collection, CollectionCreateInput, CollectionNamespace, collectionView } from "./collection-DrLpA1SO.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./input-m9ctfLxZ.mjs";
|
|
5
|
+
import { readBody } from "./body-C1_AaTS4.mjs";
|
|
6
|
+
import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
|
|
7
|
+
import { parseEnumFlag } from "./parse-enum-Cfne2suT.mjs";
|
|
8
|
+
import { Collection, CollectionCreateInput, CollectionNamespace, collectionView } from "./collection-CFoLPrY5.mjs";
|
|
11
9
|
|
|
12
10
|
//#region src/commands/collection/create.ts
|
|
13
11
|
var create_default = defineMetabaseCommand({
|
|
@@ -27,6 +25,7 @@ var create_default = defineMetabaseCommand({
|
|
|
27
25
|
description: `Collection namespace: ${CollectionNamespace.options.join("|")} (omit for a normal collection)`
|
|
28
26
|
}
|
|
29
27
|
},
|
|
28
|
+
inputSchema: CollectionCreateInput,
|
|
30
29
|
outputSchema: Collection,
|
|
31
30
|
examples: [
|
|
32
31
|
"cat collection.json | mb collection create",
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import
|
|
12
|
-
import "./validate-
|
|
13
|
-
import { CARD_DATASET_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-CcZVKYPV.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./input-m9ctfLxZ.mjs";
|
|
5
|
+
import "./embedding-CKdw8q7p.mjs";
|
|
6
|
+
import "./field-DsXTeqBy.mjs";
|
|
7
|
+
import "./parameter-BZ6y-Gfs.mjs";
|
|
8
|
+
import { Card, CardCreateInput, cardView } from "./card-B8G5jQQT.mjs";
|
|
9
|
+
import { readBody } from "./body-C1_AaTS4.mjs";
|
|
10
|
+
import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
|
|
11
|
+
import "./validate-clAWO3X-.mjs";
|
|
12
|
+
import { CARD_DATASET_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-CsK2_2_u.mjs";
|
|
14
13
|
|
|
15
14
|
//#region src/commands/card/create.ts
|
|
16
15
|
var create_default = defineMetabaseCommand({
|
|
@@ -18,14 +17,21 @@ var create_default = defineMetabaseCommand({
|
|
|
18
17
|
name: "create",
|
|
19
18
|
description: "Create a card (question, model, or metric) from JSON"
|
|
20
19
|
},
|
|
21
|
-
details: "The JSON body needs `name`, `display` (the visualization — e.g. table, bar, scalar), `dataset_query` (the query powering the card), and `visualization_settings` (`{}` is fine). When `dataset_query` is an MBQL 5 query it is checked against a bundled JSON Schema before sending — fix the reported errors, or pass --skip-validate to send anyway. Native-SQL and legacy queries are sent unchecked.",
|
|
22
|
-
skills: [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
20
|
+
details: "The JSON body needs `name`, `display` (the visualization — e.g. table, bar, scalar), `dataset_query` (the query powering the card), and `visualization_settings` (`{}` is fine). When `dataset_query` is an MBQL 5 query it is checked against a bundled JSON Schema (print it with `mb query --print-schema`) before sending — fix the reported errors, or pass --skip-validate to send anyway. Native-SQL and legacy queries are sent unchecked.",
|
|
21
|
+
skills: [
|
|
22
|
+
{
|
|
23
|
+
skill: "mbql",
|
|
24
|
+
purpose: "author an MBQL dataset_query"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
skill: "native-sql",
|
|
28
|
+
purpose: "author a native SQL dataset_query with parameters"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
skill: "visualization",
|
|
32
|
+
purpose: "choose display and visualization_settings"
|
|
33
|
+
}
|
|
34
|
+
],
|
|
29
35
|
capabilities: { minVersion: 58 },
|
|
30
36
|
args: {
|
|
31
37
|
...outputFlags,
|
|
@@ -34,6 +40,7 @@ var create_default = defineMetabaseCommand({
|
|
|
34
40
|
...bodyInputFlags,
|
|
35
41
|
...skipValidateFlag
|
|
36
42
|
},
|
|
43
|
+
inputSchema: CardCreateInput,
|
|
37
44
|
outputSchema: Card,
|
|
38
45
|
examples: [
|
|
39
46
|
"cat card.json | mb card create",
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-DWTTxJpP.mjs";
|
|
9
|
-
import { Document, DocumentCreateInput, documentView } from "./document-1W7NRaO_.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./input-m9ctfLxZ.mjs";
|
|
5
|
+
import { readBody } from "./body-C1_AaTS4.mjs";
|
|
6
|
+
import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
|
|
7
|
+
import { Document, DocumentCreateInput, documentView } from "./document-CL4ML5FN.mjs";
|
|
10
8
|
|
|
11
9
|
//#region src/commands/document/create.ts
|
|
12
10
|
var create_default = defineMetabaseCommand({
|
|
@@ -21,6 +19,7 @@ var create_default = defineMetabaseCommand({
|
|
|
21
19
|
...connectionFlags,
|
|
22
20
|
...bodyInputFlags
|
|
23
21
|
},
|
|
22
|
+
inputSchema: DocumentCreateInput,
|
|
24
23
|
outputSchema: Document,
|
|
25
24
|
examples: [
|
|
26
25
|
"cat doc.json | mb document create",
|