@metabase/cli 0.1.7 → 0.1.8-alpha.cleanup-workspaces.75fe1d5
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/.claude-plugin/marketplace.json +1 -1
- package/README.md +2 -224
- package/dist/add-collection-BGifL-7Y.mjs +10 -0
- package/dist/{add-collection-DQjTlDNF.mjs → add-collection-C5ijC4e-.mjs} +5 -5
- package/dist/{archive-De8jzzq7.mjs → archive-2GZVq0n2.mjs} +6 -7
- package/dist/{archive-DTN9tLGT.mjs → archive-C5pXDf6a.mjs} +5 -6
- package/dist/{archive-CBGKzEAl.mjs → archive-CTEybKPq.mjs} +5 -6
- package/dist/{archive-BXzghEQX.mjs → archive-DEtOH_jf.mjs} +6 -7
- package/dist/{archive-B3qiL-kK.mjs → archive-DTrn90If.mjs} +5 -6
- package/dist/{archive-CuVk8iwN.mjs → archive-nqKJOyOt.mjs} +6 -7
- package/dist/auth-Divr9vkY.mjs +19 -0
- package/dist/{body-tcURGnGh.mjs → body-BMyDvOjf.mjs} +2 -2
- package/dist/{branches-CIGkjXIk.mjs → branches-B7Zf-nxr.mjs} +5 -6
- package/dist/{cancel-pPsvgJ0Z.mjs → cancel-WwjcCE2R.mjs} +4 -5
- package/dist/{cancel-task-BLGE4UlL.mjs → cancel-task-E4cCeJTc.mjs} +5 -6
- package/dist/{render-0_GsapXa.mjs → capabilities-Dj3NgPHg.mjs} +28 -2
- package/dist/card-BHAcovSB.mjs +20 -0
- package/dist/{card-ezYiriML.mjs → card-BtPiKjbB.mjs} +1 -1
- package/dist/{cards-Dq3nx_9n.mjs → cards-BW0Spirk.mjs} +5 -6
- package/dist/cli.mjs +23 -24
- package/dist/collection-DZx-vWb2.mjs +20 -0
- package/dist/{create-BIphz0kO.mjs → create-BV_VpyyI.mjs} +10 -11
- package/dist/{create-w3mQg9n4.mjs → create-B_Ysb6Ex.mjs} +7 -8
- package/dist/{create-BcgoukG4.mjs → create-BgeD2GMZ.mjs} +9 -10
- package/dist/{create-DHscDhRd.mjs → create-Bxkik5Fs.mjs} +9 -10
- package/dist/{create-aPaUEGdr.mjs → create-CZfHpi_I.mjs} +7 -8
- package/dist/{create-BrUqxreg.mjs → create-CbwFOL9h.mjs} +7 -8
- package/dist/{create-9DBTkbMq.mjs → create-CbyY4xTG.mjs} +11 -12
- package/dist/{create-BdPoSk_7.mjs → create-HCCdsuZR.mjs} +9 -10
- package/dist/{create-branch-DGoc9CUU.mjs → create-branch-BNRq3tO2.mjs} +5 -6
- package/dist/{current-task-DZM28rnr.mjs → current-task-ZvTjL4hP.mjs} +5 -6
- package/dist/dashboard-DCWGcx3e.mjs +21 -0
- package/dist/{database-BXiue1in.mjs → database-_Td7rG4o.mjs} +1 -1
- package/dist/db-bD6fwLwc.mjs +22 -0
- package/dist/{delete-BPaFdHZP.mjs → delete-D5-ITH10.mjs} +6 -7
- package/dist/{delete-BrJOotpW.mjs → delete-DvmHTMwf.mjs} +6 -7
- package/dist/{delete-runtime-uuYbd4k2.mjs → delete-runtime-Bo7v-0au.mjs} +2 -2
- package/dist/{delete-table-CNupWUO0.mjs → delete-table-DjmO5Qe4.mjs} +6 -7
- package/dist/{dirty-BCkNOY8c.mjs → dirty-BJgU1SGQ.mjs} +5 -6
- package/dist/{eid-CLY5X0Uw.mjs → eid-pqSVgO2g.mjs} +6 -7
- package/dist/{error-ZsFeevV2.mjs → error-Br6irjpM.mjs} +1 -1
- package/dist/{export-CgHgWW3I.mjs → export-gVXTOxC2.mjs} +7 -8
- package/dist/field-BFWc8q2W.mjs +18 -0
- package/dist/{fields-RkRWU-u9.mjs → fields-DK2TYRK2.mjs} +6 -7
- package/dist/{get-y17zJMnU.mjs → get-BjArD6Er.mjs} +5 -6
- package/dist/{get-42tJ7BNp.mjs → get-C1RSXOhf.mjs} +5 -6
- package/dist/{get-C9O_aEGo.mjs → get-C3RI_hKG.mjs} +5 -6
- package/dist/{get-DmzgSgrl.mjs → get-C7UEEICF.mjs} +6 -7
- package/dist/{get-B9kwSs6U.mjs → get-D-3tOuWQ.mjs} +5 -6
- package/dist/{get-CvmqPN30.mjs → get-DDF7_apz.mjs} +5 -6
- package/dist/{get-B8l4t4Pz.mjs → get-DYgLtHb8.mjs} +5 -6
- package/dist/{get-sMpa-X4E.mjs → get-DnK3WGDH.mjs} +6 -7
- package/dist/{get-CTDqioaj.mjs → get-DnyZMx-0.mjs} +5 -6
- package/dist/{get-Bo4Cpd_c.mjs → get-DtG5ytvs.mjs} +5 -7
- package/dist/{get-CiZrZJLt.mjs → get-Dy4NedW5.mjs} +7 -8
- package/dist/{get-DsqGHNHN.mjs → get-_JI4GiPa.mjs} +5 -6
- package/dist/{get-run-CBwcRc8E.mjs → get-run-CZwIo5QR.mjs} +5 -6
- package/dist/{get-CRvbChoX.mjs → get-xo5_PD1n.mjs} +5 -6
- package/dist/git-sync-Ch00miSa.mjs +28 -0
- package/dist/{has-remote-changes-CfRidwXT.mjs → has-remote-changes-tuuoPdHV.mjs} +5 -6
- package/dist/{import-BZV0Z2KR.mjs → import-BOzyRPTk.mjs} +7 -8
- package/dist/{is-dirty-hKcB4OH9.mjs → is-dirty-BXN1F9yR.mjs} +4 -4
- package/dist/is-dirty-Bc1UHnBU.mjs +9 -0
- package/dist/{items-C94eW2Yd.mjs → items-CC4sSWv7.mjs} +7 -8
- package/dist/{list-BFlzLGlw.mjs → list-BUpOvQsd.mjs} +4 -5
- package/dist/{list-B0V7FeL2.mjs → list-BlMpI88r.mjs} +4 -6
- package/dist/{list-BJXaGk-z.mjs → list-BqTdYtOW.mjs} +4 -5
- package/dist/{list-CF1pMN4S.mjs → list-BvTuDJZp.mjs} +4 -5
- package/dist/{list-BS_Bxejg.mjs → list-C48ZZLM5.mjs} +6 -7
- package/dist/{list-DfDZr55C.mjs → list-CJe45jFT.mjs} +6 -7
- package/dist/{list-C-oZe1_p.mjs → list-CMoG5_mh.mjs} +5 -6
- package/dist/{list-BmHoYJr7.mjs → list-CkI3hESA.mjs} +4 -5
- package/dist/{list-DuSoEk_J.mjs → list-CybLzPZw.mjs} +6 -7
- package/dist/{list-HS15y_WN.mjs → list-DLhU81LP.mjs} +4 -5
- package/dist/{list-CU6sOfI-.mjs → list-Ddyb5T-7.mjs} +5 -6
- package/dist/{list-CqN4gvCk.mjs → list-tveV3LKh.mjs} +5 -6
- package/dist/{list-DrINpVLM.mjs → list-u7cmunGG.mjs} +4 -5
- package/dist/{login-enh9Yimb.mjs → login-Bfsf6jLq.mjs} +9 -10
- package/dist/{logout-BWLPLDh8.mjs → logout-BCsE_1Yg.mjs} +4 -5
- package/dist/{manifest-BNh0Lw6p.mjs → manifest-B_OfG-Ss.mjs} +1 -2
- package/dist/measure-D_eiCKq9.mjs +19 -0
- package/dist/{metadata-BTTEBWdS.mjs → metadata-Cbqx1-yW.mjs} +7 -8
- package/dist/{metadata-D2TxboMm.mjs → metadata-CzbGy4b-.mjs} +6 -7
- package/dist/{parse-id-0_tOPvfI.mjs → parse-id-DBwNYb4Y.mjs} +1 -1
- package/dist/{path-C8GrBdgT.mjs → path-DJ-DfUGC.mjs} +4 -6
- package/dist/{poll-4eoh5J0r.mjs → poll-DWkVceIk.mjs} +1 -1
- package/dist/{poll-task-51WRdugU.mjs → poll-task-DOvUDrgL.mjs} +2 -2
- package/dist/{preflight-BhsErYz3.mjs → preflight-D-l6sLCX.mjs} +3 -3
- package/dist/{query-DYVBnu9d.mjs → query--05TZxmk.mjs} +7 -8
- package/dist/{query-BBCAF-tG.mjs → query-BbbDpt3u.mjs} +11 -12
- package/dist/{query-result-ABPLz6I4.mjs → query-result-PoQE05Pe.mjs} +1 -1
- package/dist/{remove-collection-CBAHz0Dk.mjs → remove-collection-Dco3yXa-.mjs} +7 -8
- package/dist/{rescan-values-cfTSNQZo.mjs → rescan-values-B1vE6I62.mjs} +7 -8
- package/dist/{run-qgdEJv-I.mjs → run-CWb_yZbK.mjs} +7 -8
- package/dist/{runs-BFIIH4GL.mjs → runs-BLwEO5sW.mjs} +6 -7
- package/dist/{runtime-Duawf5lE.mjs → runtime-DKLBPRhd.mjs} +10 -77
- package/dist/{schema-tables-C2xM3dho.mjs → schema-tables-D1qE25GS.mjs} +6 -7
- package/dist/{schemas-BP7xiktH.mjs → schemas-CFuYnQDg.mjs} +4 -5
- package/dist/{search-DYP3lOlq.mjs → search-CF4A051Z.mjs} +4 -5
- package/dist/segment-BP_vDpYM.mjs +19 -0
- package/dist/{set-DpRQqdo7.mjs → set-BJ8Rs-vI.mjs} +7 -8
- package/dist/{setting-DUa96KF3.mjs → setting-EYI0HqTq.mjs} +3 -3
- package/dist/{setup-BPlllnim.mjs → setup-DI6EGOdH.mjs} +6 -7
- package/dist/{skills-BkregMyb.mjs → skills-BDPVoBWU.mjs} +33 -2
- package/dist/{skills-SqbPo0BI.mjs → skills-CRECMGAo.mjs} +3 -3
- package/dist/snippet-BwK58D1F.mjs +19 -0
- package/dist/{stash-C89zNKxo.mjs → stash-BpPS0uG8.mjs} +7 -8
- package/dist/{status-B1EJ_jv0.mjs → status-BqFA7Tqr.mjs} +6 -7
- package/dist/{status-BNvFPemM.mjs → status-CU5LYX0i.mjs} +4 -5
- package/dist/{summary-Cihbx0Qs.mjs → summary-CraRyIM_.mjs} +5 -6
- package/dist/{sync-schema-C3odu0ZH.mjs → sync-schema-DkfwPESH.mjs} +7 -8
- package/dist/table-CJMN6ql8.mjs +19 -0
- package/dist/{table-qDD2kApF.mjs → table-CkWja2UH.mjs} +1 -1
- package/dist/transform-BqV5ssDN.mjs +24 -0
- package/dist/transform-job-DvdOLV9b.mjs +19 -0
- package/dist/{tree-mvq9gM9w.mjs → tree-Bd1i-Y4U.mjs} +4 -5
- package/dist/{update-CbBnHz42.mjs → update-BLZHmA0X.mjs} +10 -11
- package/dist/{update-Rr4usmCo.mjs → update-BncGqeWt.mjs} +8 -9
- package/dist/{update-DwRxdflw.mjs → update-C4f-8fsU.mjs} +8 -9
- package/dist/{update-VvKMnwsM.mjs → update-CgpgyDjd.mjs} +10 -11
- package/dist/{update-DCrOQ1PW.mjs → update-CsYa--Eb.mjs} +11 -12
- package/dist/{update-BoIiuC70.mjs → update-DA9aPhRr.mjs} +10 -11
- package/dist/{update-CtOo3LsX.mjs → update-DtO-1_tj.mjs} +9 -10
- package/dist/{update-tRparnUs.mjs → update-IPsv9Pj0.mjs} +12 -13
- package/dist/{update-C0jP0AKT.mjs → update-OZoOTnlY.mjs} +8 -9
- package/dist/{update-dashcard-DFvIz8Qj.mjs → update-dashcard-D0VAwfNO.mjs} +8 -9
- package/dist/{upgrade-D-Rl_fH9.mjs → upgrade-Bb_q7hJ7.mjs} +34 -7
- package/dist/{uuid-BSVUk8u2.mjs → uuid-DTdRruiz.mjs} +3 -4
- package/dist/{validate-dPEOnOf8.mjs → validate-CqVB_3_p.mjs} +1 -1
- package/dist/{validate-query-CYvOP8Ld.mjs → validate-query-BUTNK00f.mjs} +2 -2
- package/dist/{values-D1RJE4H6.mjs → values-Bpt6obVW.mjs} +5 -6
- package/dist/{verify-A7BWfBPZ.mjs → verify-COt2q73-.mjs} +1 -1
- package/dist/{wait-DK5QDZ8n.mjs → wait-DoKPlspq.mjs} +6 -7
- package/dist/{wait-flags-DlfbIXHw.mjs → wait-flags-D1jNm0JK.mjs} +2 -2
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +15 -28
- package/skill-data/git-sync/SKILL.md +8 -63
- package/skill-data/mbql/SKILL.md +2 -0
- package/skill-data/transform/SKILL.md +16 -6
- package/skill-data/visualization/SKILL.md +158 -0
- package/skill-data/visualization/references/settings.md +414 -0
- package/skills/metabase-cli/SKILL.md +1 -1
- package/dist/add-collection-C9BdVBs2.mjs +0 -11
- package/dist/auth-D9eAyVoG.mjs +0 -19
- package/dist/capabilities-7e9MgquN.mjs +0 -29
- package/dist/card-DDDrWcDU.mjs +0 -20
- package/dist/collection-DkEvCDar.mjs +0 -20
- package/dist/create-B1dyuL9Y.mjs +0 -54
- package/dist/credentials-qryRLUed.mjs +0 -88
- package/dist/dashboard-BLf1RZlk.mjs +0 -21
- package/dist/database-Ce1gOJF7.mjs +0 -17
- package/dist/db-CWTFe_FZ.mjs +0 -22
- package/dist/delete-FFj1xQWO.mjs +0 -104
- package/dist/deprovision-BNr9fPDY.mjs +0 -67
- package/dist/docker-Ds252Mwc.mjs +0 -515
- package/dist/field-LL6W_c-c.mjs +0 -18
- package/dist/git-sync-CrWTo3YX.mjs +0 -28
- package/dist/is-dirty-CPzOnnH6.mjs +0 -10
- package/dist/license-B37055sr.mjs +0 -17
- package/dist/list-DUXdt0XI.mjs +0 -36
- package/dist/logs-Cu3QtvPs.mjs +0 -60
- package/dist/measure-CDlEPFtB.mjs +0 -19
- package/dist/parse-schemas-D-qVLl4z.mjs +0 -12
- package/dist/process-CM7Uu5q_.mjs +0 -105
- package/dist/provision-Chf86BF0.mjs +0 -83
- package/dist/ps-CEYtsKBj.mjs +0 -80
- package/dist/ps-CIDwaubS.mjs +0 -11
- package/dist/remove-2yInufA6.mjs +0 -64
- package/dist/segment-B6HnNGDs.mjs +0 -19
- package/dist/set-Tt-ioa4L.mjs +0 -68
- package/dist/snippet-dJ68tGsl.mjs +0 -19
- package/dist/start-DJZA67WF.mjs +0 -414
- package/dist/status-D5wSqYV_.mjs +0 -34
- package/dist/stop-5rCLmkCQ.mjs +0 -87
- package/dist/table-J2f0STnB.mjs +0 -19
- package/dist/transform-job-OW4SDhsQ.mjs +0 -19
- package/dist/transform-q1LYWQtW.mjs +0 -24
- package/dist/update-DEZayTb4.mjs +0 -78
- package/dist/url-BB6jeNQj.mjs +0 -56
- package/dist/wait-B17I_pWy.mjs +0 -19
- package/dist/workspace-D8HtUN0y.mjs +0 -72
- package/dist/workspace-credentials-8CBMQJFz.mjs +0 -100
- package/dist/workspace-ri6r3zWo.mjs +0 -25
- package/dist/yaml-Gv6wRFMF.mjs +0 -43
- package/skill-data/viz/SKILL.md +0 -137
- package/skill-data/viz/references/settings.md +0 -312
- package/skill-data/workspace/SKILL.md +0 -390
- /package/dist/{body-flags-D7q87Btw.mjs → body-flags-D78h_-Ua.mjs} +0 -0
- /package/dist/{collection-Bcy8cWYH.mjs → collection-B3sPXRLs.mjs} +0 -0
- /package/dist/{dashboard-B4bn3z6t.mjs → dashboard-FY5UzJ_Z.mjs} +0 -0
- /package/dist/{field-E0IBy4Uw.mjs → field-MGxpNQUH.mjs} +0 -0
- /package/dist/{input-cMSEqISy.mjs → input-xewHccej.mjs} +0 -0
- /package/dist/{key-vkNkH82H.mjs → key-C2XG394c.mjs} +0 -0
- /package/dist/{measure-Bt3InQsA.mjs → measure-ClESGxIb.mjs} +0 -0
- /package/dist/{paginate-BexjkjbY.mjs → paginate-Dfm9eO9A.mjs} +0 -0
- /package/dist/{parse-enum-CrEWOhuY.mjs → parse-enum-Dr7ACrTR.mjs} +0 -0
- /package/dist/{parse-ref-DKag6a6I.mjs → parse-ref-BiETXmvm.mjs} +0 -0
- /package/dist/{prompt-CFKoys7k.mjs → prompt-u4WhE4T5.mjs} +0 -0
- /package/dist/{render-khznBlla.mjs → render-BQHJhSP1.mjs} +0 -0
- /package/dist/{revision-message-flag-DY29-cgz.mjs → revision-message-flag-WmsIzUOM.mjs} +0 -0
- /package/dist/{segment-DhBmcr_E.mjs → segment-Be2v4ilr.mjs} +0 -0
- /package/dist/{setting-BzCng1Ub.mjs → setting-oL97SNeO.mjs} +0 -0
- /package/dist/{snippet-bi_0XbNT.mjs → snippet-xh42tYly.mjs} +0 -0
- /package/dist/{transform-BKahefz_.mjs → transform-DyJb0bV0.mjs} +0 -0
- /package/dist/{transform-job-DjhoJbiV.mjs → transform-job-DpDGoqQt.mjs} +0 -0
package/dist/url-BB6jeNQj.mjs
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { outputFlags } from "./error-ZsFeevV2.mjs";
|
|
3
|
-
import { defineMetabaseCommand, localUrl } from "./runtime-Duawf5lE.mjs";
|
|
4
|
-
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
-
import { renderSummary } from "./render-0_GsapXa.mjs";
|
|
6
|
-
import { parseId } from "./parse-id-0_tOPvfI.mjs";
|
|
7
|
-
import "./poll-4eoh5J0r.mjs";
|
|
8
|
-
import "./process-CM7Uu5q_.mjs";
|
|
9
|
-
import { checkDockerReady, requireWorkspaceContainerLocation } from "./docker-Ds252Mwc.mjs";
|
|
10
|
-
import { z } from "zod";
|
|
11
|
-
|
|
12
|
-
//#region src/commands/workspace/url.ts
|
|
13
|
-
const UrlResult = z.object({
|
|
14
|
-
workspace_id: z.number().int().positive(),
|
|
15
|
-
url: z.string()
|
|
16
|
-
});
|
|
17
|
-
const urlResultView = {
|
|
18
|
-
compactPick: UrlResult,
|
|
19
|
-
tableColumns: [{
|
|
20
|
-
key: "workspace_id",
|
|
21
|
-
label: "ID"
|
|
22
|
-
}, {
|
|
23
|
-
key: "url",
|
|
24
|
-
label: "URL"
|
|
25
|
-
}]
|
|
26
|
-
};
|
|
27
|
-
var url_default = defineMetabaseCommand({
|
|
28
|
-
meta: {
|
|
29
|
-
name: "url",
|
|
30
|
-
description: "Print the local URL the workspace's container is bound to"
|
|
31
|
-
},
|
|
32
|
-
capabilities: null,
|
|
33
|
-
args: {
|
|
34
|
-
...outputFlags,
|
|
35
|
-
id: {
|
|
36
|
-
type: "positional",
|
|
37
|
-
description: "Workspace id",
|
|
38
|
-
required: true
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
outputSchema: UrlResult,
|
|
42
|
-
examples: ["mb workspace url 1", "mb workspace url 1 --json"],
|
|
43
|
-
async run({ args, ctx }) {
|
|
44
|
-
const workspaceId = parseId(args.id);
|
|
45
|
-
await checkDockerReady();
|
|
46
|
-
const { hostPort } = await requireWorkspaceContainerLocation(workspaceId);
|
|
47
|
-
const result = {
|
|
48
|
-
workspace_id: workspaceId,
|
|
49
|
-
url: localUrl(hostPort)
|
|
50
|
-
};
|
|
51
|
-
renderSummary(result, urlResultView, result.url, ctx);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
//#endregion
|
|
56
|
-
export { url_default as default };
|
package/dist/wait-B17I_pWy.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { pollUntil } from "./poll-4eoh5J0r.mjs";
|
|
2
|
-
import { Workspace } from "./workspace-D8HtUN0y.mjs";
|
|
3
|
-
|
|
4
|
-
//#region src/commands/workspace/database/wait.ts
|
|
5
|
-
async function waitForDatabaseProvisioned(client, workspaceId, databaseId, schedule) {
|
|
6
|
-
return pollUntil(() => client.requestParsed(Workspace, `/api/ee/workspace-manager/${workspaceId}`), (workspace) => {
|
|
7
|
-
const entry = workspace.databases?.find((row) => row.database_id === databaseId);
|
|
8
|
-
return entry !== void 0 && entry.status === "provisioned";
|
|
9
|
-
}, schedule);
|
|
10
|
-
}
|
|
11
|
-
async function waitForDatabaseGone(client, workspaceId, databaseId, schedule) {
|
|
12
|
-
await pollUntil(() => client.requestParsed(Workspace, `/api/ee/workspace-manager/${workspaceId}`), (workspace) => {
|
|
13
|
-
const entry = workspace.databases?.find((row) => row.database_id === databaseId);
|
|
14
|
-
return entry === void 0;
|
|
15
|
-
}, schedule);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { waitForDatabaseGone, waitForDatabaseProvisioned };
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
//#region src/domain/workspace.ts
|
|
4
|
-
const WorkspaceDatabaseStatus = z.enum([
|
|
5
|
-
"unprovisioned",
|
|
6
|
-
"provisioning",
|
|
7
|
-
"provisioned",
|
|
8
|
-
"deprovisioning"
|
|
9
|
-
]);
|
|
10
|
-
const WorkspaceDatabase = z.object({
|
|
11
|
-
database_id: z.number().int(),
|
|
12
|
-
output_namespace: z.string(),
|
|
13
|
-
input_schemas: z.array(z.string().min(1)),
|
|
14
|
-
status: WorkspaceDatabaseStatus
|
|
15
|
-
}).loose();
|
|
16
|
-
const WorkspaceCreator = z.object({
|
|
17
|
-
id: z.number().int(),
|
|
18
|
-
first_name: z.string().nullable(),
|
|
19
|
-
last_name: z.string().nullable(),
|
|
20
|
-
email: z.string(),
|
|
21
|
-
common_name: z.string().nullable().optional()
|
|
22
|
-
}).loose();
|
|
23
|
-
const Workspace = z.object({
|
|
24
|
-
id: z.number().int(),
|
|
25
|
-
name: z.string(),
|
|
26
|
-
creator: WorkspaceCreator.nullable(),
|
|
27
|
-
created_at: z.string(),
|
|
28
|
-
updated_at: z.string(),
|
|
29
|
-
databases: z.array(WorkspaceDatabase).optional()
|
|
30
|
-
}).loose();
|
|
31
|
-
const WorkspaceCompact = Workspace.pick({
|
|
32
|
-
id: true,
|
|
33
|
-
name: true,
|
|
34
|
-
databases: true
|
|
35
|
-
}).strip();
|
|
36
|
-
const WorkspaceDatabaseList = z.array(WorkspaceDatabase);
|
|
37
|
-
const workspaceView = {
|
|
38
|
-
compactPick: WorkspaceCompact,
|
|
39
|
-
tableColumns: [
|
|
40
|
-
{
|
|
41
|
-
key: "id",
|
|
42
|
-
label: "ID"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
key: "name",
|
|
46
|
-
label: "Name"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
key: "databases",
|
|
50
|
-
label: "Databases",
|
|
51
|
-
format: (value) => formatDatabases(value)
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
};
|
|
55
|
-
const WorkspaceCreateInput = z.object({ name: z.string().min(1) }).loose();
|
|
56
|
-
const WorkspaceProvisionInput = z.object({
|
|
57
|
-
database_id: z.number().int().positive(),
|
|
58
|
-
input_schemas: z.array(z.string().min(1)).min(1)
|
|
59
|
-
}).loose();
|
|
60
|
-
const WorkspaceUpdateDatabaseInput = z.object({ input_schemas: z.array(z.string().min(1)).min(1) }).loose();
|
|
61
|
-
function formatDatabases(value) {
|
|
62
|
-
if (value === void 0) return "";
|
|
63
|
-
const parsed = WorkspaceDatabaseList.safeParse(value);
|
|
64
|
-
if (!parsed.success || parsed.data.length === 0) return "(none)";
|
|
65
|
-
return parsed.data.map((entry) => {
|
|
66
|
-
const schemas = entry.input_schemas.length === 0 ? "" : ` [${entry.input_schemas.join(", ")}]`;
|
|
67
|
-
return `${entry.database_id} (${entry.status})${schemas}`;
|
|
68
|
-
}).join("; ");
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
//#endregion
|
|
72
|
-
export { Workspace, WorkspaceCompact, WorkspaceCreateInput, WorkspaceProvisionInput, WorkspaceUpdateDatabaseInput, workspaceView };
|
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { parseYaml, stringifyYaml } from "./yaml-Gv6wRFMF.mjs";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { randomBytes } from "node:crypto";
|
|
5
|
-
|
|
6
|
-
//#region src/core/workspace-credentials.ts
|
|
7
|
-
const API_KEY_NAME = "Workspace API Key";
|
|
8
|
-
const API_KEY_GROUP = "admin";
|
|
9
|
-
const PASSWORD_BYTE_LENGTH = 18;
|
|
10
|
-
const API_KEY_BYTE_LENGTH = 32;
|
|
11
|
-
const WorkspaceCredentials = z.object({
|
|
12
|
-
workspace_id: z.number().int().positive(),
|
|
13
|
-
user: z.object({
|
|
14
|
-
first_name: z.string().min(1),
|
|
15
|
-
last_name: z.string().min(1),
|
|
16
|
-
password: z.string().min(1),
|
|
17
|
-
email: z.string().min(1)
|
|
18
|
-
}),
|
|
19
|
-
api_key: z.object({
|
|
20
|
-
name: z.string().min(1),
|
|
21
|
-
group: z.enum(["admin", "all-users"]),
|
|
22
|
-
creator: z.string().min(1),
|
|
23
|
-
key: z.string().regex(/^mb_[A-Za-z0-9+/=]+$/)
|
|
24
|
-
})
|
|
25
|
-
});
|
|
26
|
-
function generateWorkspaceCredentials(workspaceId) {
|
|
27
|
-
const email = `workspace-${workspaceId}@workspace.local`;
|
|
28
|
-
return {
|
|
29
|
-
workspace_id: workspaceId,
|
|
30
|
-
user: {
|
|
31
|
-
first_name: "Workspace",
|
|
32
|
-
last_name: "Admin",
|
|
33
|
-
password: randomBase64Url(PASSWORD_BYTE_LENGTH),
|
|
34
|
-
email
|
|
35
|
-
},
|
|
36
|
-
api_key: {
|
|
37
|
-
name: API_KEY_NAME,
|
|
38
|
-
group: API_KEY_GROUP,
|
|
39
|
-
creator: email,
|
|
40
|
-
key: `mb_${randomBytes(API_KEY_BYTE_LENGTH).toString("base64")}`
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
const credentialsJsonEncoder = new TextEncoder();
|
|
45
|
-
function buildCredentialsJson(credentials) {
|
|
46
|
-
return credentialsJsonEncoder.encode(`${JSON.stringify(credentials, null, 2)}\n`);
|
|
47
|
-
}
|
|
48
|
-
const ConfigEnvelopeShape = z.object({
|
|
49
|
-
version: z.number().int(),
|
|
50
|
-
config: z.looseObject({})
|
|
51
|
-
}).loose();
|
|
52
|
-
function injectCredentialsIntoConfig(yamlInput, credentials) {
|
|
53
|
-
const envelope = parseYaml(yamlInput, ConfigEnvelopeShape, { source: "config.yml" });
|
|
54
|
-
if ("users" in envelope.config || "api-keys" in envelope.config) throw new ConfigError("config.yml already declares users or api-keys — refusing to overwrite parent-supplied credentials");
|
|
55
|
-
const merged = {
|
|
56
|
-
...envelope,
|
|
57
|
-
config: {
|
|
58
|
-
...envelope.config,
|
|
59
|
-
users: [credentials.user],
|
|
60
|
-
"api-keys": [credentials.api_key]
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
return stringifyYaml(merged);
|
|
64
|
-
}
|
|
65
|
-
const REPO_SYNC_MODES = ["read-write", "read-only"];
|
|
66
|
-
const RepoSyncMode = z.enum(REPO_SYNC_MODES);
|
|
67
|
-
const ConfigEnvelopeWithSettingsShape = z.object({
|
|
68
|
-
version: z.number().int(),
|
|
69
|
-
config: z.object({ settings: z.looseObject({}).optional() }).loose()
|
|
70
|
-
}).loose();
|
|
71
|
-
const REMOTE_SYNC_KEYS = [
|
|
72
|
-
"remote-sync-url",
|
|
73
|
-
"remote-sync-branch",
|
|
74
|
-
"remote-sync-type"
|
|
75
|
-
];
|
|
76
|
-
function injectRepoSettingsIntoConfig(yamlInput, repo) {
|
|
77
|
-
const envelope = parseYaml(yamlInput, ConfigEnvelopeWithSettingsShape, { source: "config.yml" });
|
|
78
|
-
const existingSettings = envelope.config.settings ?? {};
|
|
79
|
-
const conflicts = REMOTE_SYNC_KEYS.filter((key) => key in existingSettings);
|
|
80
|
-
if (conflicts.length > 0) throw new ConfigError(`config.yml already declares remote-sync settings (${conflicts.join(", ")}) — refusing to overwrite parent-supplied values`);
|
|
81
|
-
const merged = {
|
|
82
|
-
...envelope,
|
|
83
|
-
config: {
|
|
84
|
-
...envelope.config,
|
|
85
|
-
settings: {
|
|
86
|
-
...existingSettings,
|
|
87
|
-
"remote-sync-url": repo.url,
|
|
88
|
-
"remote-sync-branch": repo.branch,
|
|
89
|
-
"remote-sync-type": repo.mode
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
return stringifyYaml(merged);
|
|
94
|
-
}
|
|
95
|
-
function randomBase64Url(byteLength) {
|
|
96
|
-
return randomBytes(byteLength).toString("base64url");
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
//#endregion
|
|
100
|
-
export { REPO_SYNC_MODES, RepoSyncMode, WorkspaceCredentials, buildCredentialsJson, generateWorkspaceCredentials, injectCredentialsIntoConfig, injectRepoSettingsIntoConfig };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
|
|
3
|
-
//#region src/commands/workspace/index.ts
|
|
4
|
-
var workspace_default = defineCommand({
|
|
5
|
-
meta: {
|
|
6
|
-
name: "workspace",
|
|
7
|
-
description: "Manage Metabase workspaces (workspace-manager)"
|
|
8
|
-
},
|
|
9
|
-
subCommands: {
|
|
10
|
-
list: () => import("./list-DUXdt0XI.mjs").then((mod) => mod.default),
|
|
11
|
-
create: () => import("./create-B1dyuL9Y.mjs").then((mod) => mod.default),
|
|
12
|
-
database: () => import("./database-Ce1gOJF7.mjs").then((mod) => mod.default),
|
|
13
|
-
start: () => import("./start-DJZA67WF.mjs").then((mod) => mod.default),
|
|
14
|
-
stop: () => import("./stop-5rCLmkCQ.mjs").then((mod) => mod.default),
|
|
15
|
-
delete: () => import("./delete-FFj1xQWO.mjs").then((mod) => mod.default),
|
|
16
|
-
logs: () => import("./logs-Cu3QtvPs.mjs").then((mod) => mod.default),
|
|
17
|
-
url: () => import("./url-BB6jeNQj.mjs").then((mod) => mod.default),
|
|
18
|
-
credentials: () => import("./credentials-qryRLUed.mjs").then((mod) => mod.default),
|
|
19
|
-
ps: () => import("./ps-CIDwaubS.mjs").then((mod) => mod.default),
|
|
20
|
-
license: () => import("./license-B37055sr.mjs").then((mod) => mod.default)
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
//#endregion
|
|
25
|
-
export { workspace_default as default };
|
package/dist/yaml-Gv6wRFMF.mjs
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ConfigError, ValidationError, errorMessage } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { YAMLParseError, parse, stringify } from "yaml";
|
|
3
|
-
|
|
4
|
-
//#region src/runtime/yaml.ts
|
|
5
|
-
function parseYaml(input, schema, opts = {}) {
|
|
6
|
-
const result = parseYamlResult(input, schema, opts);
|
|
7
|
-
if (!result.ok) throw result.error;
|
|
8
|
-
return result.value;
|
|
9
|
-
}
|
|
10
|
-
function parseYamlResult(input, schema, opts = {}) {
|
|
11
|
-
const sourcePrefix = opts.source ? `${opts.source}: ` : "";
|
|
12
|
-
let raw;
|
|
13
|
-
try {
|
|
14
|
-
raw = parse(input);
|
|
15
|
-
} catch (error) {
|
|
16
|
-
if (error instanceof YAMLParseError) return {
|
|
17
|
-
ok: false,
|
|
18
|
-
error: new ConfigError(`${sourcePrefix}invalid YAML: ${error.message}`)
|
|
19
|
-
};
|
|
20
|
-
return {
|
|
21
|
-
ok: false,
|
|
22
|
-
error: new ConfigError(`${sourcePrefix}invalid YAML: ${errorMessage(error)}`)
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const parsed = schema.safeParse(raw);
|
|
26
|
-
if (!parsed.success) return {
|
|
27
|
-
ok: false,
|
|
28
|
-
error: new ValidationError(`${sourcePrefix}value did not match expected schema`, {
|
|
29
|
-
source: opts.source ?? "<input>",
|
|
30
|
-
zodIssues: parsed.error.issues
|
|
31
|
-
})
|
|
32
|
-
};
|
|
33
|
-
return {
|
|
34
|
-
ok: true,
|
|
35
|
-
value: parsed.data
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
function stringifyYaml(value) {
|
|
39
|
-
return stringify(value, { lineWidth: 0 });
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
//#endregion
|
|
43
|
-
export { parseYaml, parseYamlResult, stringifyYaml };
|
package/skill-data/viz/SKILL.md
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: viz
|
|
3
|
-
description: Author Metabase `visualization_settings` and pick the right `display` for cards via the `mb` CLI. Covers the display → settings-namespace map (graph.*, pie.*, funnel.*, scalar.*, table.*, …), the column-name-vs-numeric-field-id rule, the `column_settings` JSON-string-key footgun, worked API-form examples per chart family, and the pull-from-UI escape hatch for complex charts. Load whenever shaping how a card renders by hand — "create a bar chart", "make this a line chart", "format this column as currency", "set the pie dimension and metric", "the card renders as a table instead of a chart", "add conditional formatting", or any `visualization_settings` work.
|
|
4
|
-
allowed-tools: Read, Write, Edit, Bash, AskUserQuestion
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Visualization settings
|
|
8
|
-
|
|
9
|
-
A card has two presentation fields alongside its `dataset_query`:
|
|
10
|
-
|
|
11
|
-
- **`display`** — the chart type (`bar`, `line`, `pie`, `scalar`, `table`, …). One closed set of values; pick from the enum below.
|
|
12
|
-
- **`visualization_settings`** — a free-form map whose keys are **namespaced by `display`** (`graph.*` for bar/line, `pie.*` for pie, …). The server stores almost anything and **silently ignores keys that don't apply** to the chosen `display`.
|
|
13
|
-
|
|
14
|
-
The MBQL pre-flight does **not** validate `visualization_settings` — there is no `--skip-validate` to fail past, because nothing checks it. A `display` typo or a misnamed key is accepted by the API and the card just renders as a default table or drops the setting. So **the feedback loop is read-back, not pre-flight**: after `card create`/`update`, confirm with `mb card get <id> --full --json` (or open the card) that it rendered as intended.
|
|
15
|
-
|
|
16
|
-
The general flag conventions and body-input precedence live in the `core` skill (`mb skills get core`); the `dataset_query` body itself is the `mbql` skill's job (`mb skills get mbql`). This skill is only about how the result is displayed.
|
|
17
|
-
|
|
18
|
-
## `display` decides everything
|
|
19
|
-
|
|
20
|
-
`display` selects which setting namespace is read. Pick `display` first, then only the matching namespace's keys matter.
|
|
21
|
-
|
|
22
|
-
| `display` | Settings namespace(s) | Key columns are named by |
|
|
23
|
-
| ------------------------------------------- | --------------------------------------------------------- | ------------------------ |
|
|
24
|
-
| `bar` `line` `area` `combo` `row` `scatter` | `graph.*`, `series_settings`, `column_settings` | output column **name** |
|
|
25
|
-
| `waterfall` | `graph.*` + `waterfall.*` | output column name |
|
|
26
|
-
| `boxplot` | `graph.*` + `boxplot.*` | output column name |
|
|
27
|
-
| `pie` | `pie.*`, `column_settings` | output column name |
|
|
28
|
-
| `scalar` `number` | `scalar.*` | output column name |
|
|
29
|
-
| `smartscalar` | `scalar.comparisons` | output column name |
|
|
30
|
-
| `funnel` | `funnel.*` | output column name |
|
|
31
|
-
| `gauge` | `gauge.*` | — |
|
|
32
|
-
| `map` | `map.*` | output column name |
|
|
33
|
-
| `pivot` | `pivot_table.*`, `table.*` | output column name |
|
|
34
|
-
| `sankey` | `sankey.*` | output column name |
|
|
35
|
-
| `table` | `table.*`, `column_settings` | output column name |
|
|
36
|
-
| `object` `list` | `column_settings` | output column name |
|
|
37
|
-
| `progress` | `progress.goal`, `progress.color` (sparse — pull from UI) | — |
|
|
38
|
-
| `heading` `text` `link` `iframe` `action` | dashcard-only `virtual_card` (see references) | — |
|
|
39
|
-
|
|
40
|
-
Closed `display` enum (card-level): `table`, `bar`, `line`, `area`, `row`, `pie`, `scalar`, `smartscalar`, `number`, `combo`, `pivot`, `funnel`, `map`, `scatter`, `waterfall`, `progress`, `gauge`, `object`, `list`, `sankey`, `boxplot`. (`heading`/`text`/`link`/`iframe`/`action` are dashcard virtuals, not standalone cards.) An unknown value is accepted by the API but renders nothing useful — typos like `bargraph`/`linechart` are the most common cause of a "why is my chart blank" report.
|
|
41
|
-
|
|
42
|
-
## The rule that trips everyone: settings name **output columns**, by name
|
|
43
|
-
|
|
44
|
-
`graph.dimensions`, `graph.metrics`, `pie.dimension`, `pie.metric`, `scalar.field`, `funnel.metric`, `map.latitude_column`, … all take **output column-name strings** — the names the query _produces_, not field ids. A `count` aggregation outputs the column `count`; a breakout on a field outputs that field's name; a named aggregation outputs its `name`. These strings are **identical in the API form and the portable (git-sync) form** — no numeric-vs-name footgun here.
|
|
45
|
-
|
|
46
|
-
So the names you put in `visualization_settings` come from the query's output, not from `mb field`/`mb table`. If you set `name` on an aggregation (see the `mbql` skill, "Naming aggregation output columns"), use that same string here.
|
|
47
|
-
|
|
48
|
-
## Minimum-viable settings per chart family (API form)
|
|
49
|
-
|
|
50
|
-
Each example is the `visualization_settings` block to pair with the given `display` on a `card create`/`update` body. The `dataset_query` is elided — build it per the `mbql` skill. The output columns referenced (`CATEGORY`, `count`) are whatever the query's breakout/aggregation produce.
|
|
51
|
-
|
|
52
|
-
**Bar / line / area** — one dimension on the x-axis, one or more metrics:
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
"display": "bar",
|
|
56
|
-
"visualization_settings": {
|
|
57
|
-
"graph.dimensions": ["CATEGORY"],
|
|
58
|
-
"graph.metrics": ["count"]
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
(Switch `display` to `line` or `area` with the same `graph.*` keys. Multiple metrics: `"graph.metrics": ["count", "sum"]`. Stacked: add `"stackable.stack_type": "stacked"`.)
|
|
63
|
-
|
|
64
|
-
**Pie** — one dimension, one metric:
|
|
65
|
-
|
|
66
|
-
```json
|
|
67
|
-
"display": "pie",
|
|
68
|
-
"visualization_settings": { "pie.dimension": "CATEGORY", "pie.metric": "count" }
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
**Scalar** (single big number) — the field to surface:
|
|
72
|
-
|
|
73
|
-
```json
|
|
74
|
-
"display": "scalar",
|
|
75
|
-
"visualization_settings": { "scalar.field": "count" }
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**Table** — column order/visibility plus per-column formatting:
|
|
79
|
-
|
|
80
|
-
```json
|
|
81
|
-
"display": "table",
|
|
82
|
-
"visualization_settings": {
|
|
83
|
-
"table.columns": [
|
|
84
|
-
{ "name": "CATEGORY", "enabled": true },
|
|
85
|
-
{ "name": "count", "enabled": true }
|
|
86
|
-
],
|
|
87
|
-
"column_settings": {
|
|
88
|
-
"[\"name\",\"count\"]": { "column_title": "Orders" }
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
An **empty** `"visualization_settings": {}` is valid for any `display` — Metabase falls back to sensible defaults (it auto-picks dimensions/metrics for a simple aggregate). Set keys only to override the defaults.
|
|
94
|
-
|
|
95
|
-
## `column_settings`: the JSON-string-key footgun
|
|
96
|
-
|
|
97
|
-
`column_settings` is a map **whose keys are themselves JSON-encoded arrays** — so inside a JSON body the inner quotes must be escaped. The key is a _string_, never an object.
|
|
98
|
-
|
|
99
|
-
- **Prefer the name form:** `["name", "<output column name>"]` → in a JSON body, `"[\"name\",\"count\"]"`. This is the canonical key Metabase writes (`getColumnKey`), and it's **identical in API and portable form**. Use it unless you have a reason not to.
|
|
100
|
-
- **Ref form (legacy order!):** `["ref", ["field", <id>, <opts>]]`. The inner field ref here uses the **legacy MBQL-4 order** `["field", id, options]` (id **second**) — _not_ the MBQL-5 order `["field", {options}, id]` you use in `dataset_query`. In the API form `<id>` is the **numeric** field id; the portable form uses a name path. Because the order differs from MBQL 5, this form is easy to get wrong — reach for the name form instead.
|
|
101
|
-
|
|
102
|
-
```json
|
|
103
|
-
"column_settings": {
|
|
104
|
-
"[\"name\",\"TOTAL\"]": { "number_style": "currency", "currency": "USD", "decimals": 2 },
|
|
105
|
-
"[\"name\",\"CREATED_AT\"]": { "date_style": "MMMM D, YYYY" }
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
The exhaustive per-column key list (number/date/link formatting, `view_as`, click behavior) is in the references file.
|
|
110
|
-
|
|
111
|
-
## Escape hatch: pull a real card instead of authoring from scratch
|
|
112
|
-
|
|
113
|
-
For anything beyond a single dimension + metric — combo charts, conditional formatting, pivot splits, click behavior, series colors — the cheapest **correct** path is to build it once in the Metabase UI and copy the result:
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
mb card get <id> --full --json | jq '.visualization_settings'
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Paste that block into your `card create`/`update` body. The server produced it, so it's guaranteed valid for that `display`. This beats guessing keys from memory, and it's token-cheap (no schema dump).
|
|
120
|
-
|
|
121
|
-
## Full key catalog
|
|
122
|
-
|
|
123
|
-
The body above covers the high-frequency 90%. The complete per-display key tables — every `graph.*`/`pie.*`/`table.*`/… key, series settings, conditional formatting rules, pivot splits, the full `column_settings` formatting vocabulary, virtual-card (heading/text/link/iframe) settings, and click behavior — live in this skill's references file. Load it on demand, not by default:
|
|
124
|
-
|
|
125
|
-
```bash
|
|
126
|
-
mb skills get viz --full # appends references/settings.md to this body
|
|
127
|
-
mb skills path viz # → the skill dir; then Read references/settings.md
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
## Don't
|
|
131
|
-
|
|
132
|
-
- Don't invent `display` values (`bargraph`, `linechart`, `histogram`) — use the closed enum; the API accepts the typo and renders nothing.
|
|
133
|
-
- Don't put numeric field ids in `graph.dimensions`/`pie.metric`/`scalar.field` etc. — they take **output column-name strings**.
|
|
134
|
-
- Don't write a `column_settings` key as an object — it's a JSON **string** (`"[\"name\",\"COL\"]"`), inner quotes escaped.
|
|
135
|
-
- Don't use the MBQL-5 field-ref order inside a `column_settings` `["ref", …]` key — that key uses the **legacy** `["field", id, opts]` order. Prefer the `["name", …]` form and sidestep it.
|
|
136
|
-
- Don't expect a pre-flight to catch viz mistakes — there is none. Verify by reading the card back.
|
|
137
|
-
- Don't hand-author complex charts when you can pull a working `visualization_settings` from a UI-built card.
|