@metabase/cli 0.2.0 → 0.2.1-alpha.trust-system-ca.541e4e0
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 +153 -2
- package/dist/{add-collection-BTSGp4f9.mjs → add-collection-BZAVH5Wk.mjs} +4 -4
- package/dist/add-collection-DByJYvGO.mjs +9 -0
- package/dist/{append-DY1-O789.mjs → append-Cak5jykn.mjs} +5 -5
- package/dist/{archive-DOa1u1aJ.mjs → archive-BIEnBoE8.mjs} +4 -4
- package/dist/{archive-DCPw3df6.mjs → archive-BMbx6lt8.mjs} +4 -4
- package/dist/{archive-BOEEMrYL.mjs → archive-BVY_jD_g.mjs} +5 -5
- package/dist/archive-CPgWNCG3.mjs +38 -0
- package/dist/{archive-w6TX-zEk.mjs → archive-CaKhG58H.mjs} +4 -4
- package/dist/{archive-CJ9rElKn.mjs → archive-CjnCAM61.mjs} +5 -5
- package/dist/archive-CytCvQpn.mjs +38 -0
- package/dist/{archive-pHsa4dL0.mjs → archive-DfbI8DRB.mjs} +3 -3
- package/dist/{archive-CWtUzlHO.mjs → archive-op9pJRpg.mjs} +4 -4
- package/dist/{auth-BrQtY0pO.mjs → auth-XfuGXI2K.mjs} +4 -4
- package/dist/{body-C1_AaTS4.mjs → body-BW_CiL1d.mjs} +3 -3
- package/dist/{branches-BsBzaGIf.mjs → branches-gVRwKne4.mjs} +4 -4
- package/dist/{cancel-BNM0yyx-.mjs → cancel-CBOJSslz.mjs} +3 -3
- package/dist/{cancel-task-Bggzn4JL.mjs → cancel-task-Djancczz.mjs} +4 -4
- package/dist/{capabilities-DrDJo_ng.mjs → capabilities-CSjeWyLV.mjs} +1 -1
- package/dist/{card-DHCcmpgr.mjs → card-B_kiDDil.mjs} +6 -6
- package/dist/{cards-D0hvA13L.mjs → cards-23FtfL4S.mjs} +4 -4
- package/dist/cli.mjs +41 -26
- package/dist/{collection-CFoLPrY5.mjs → collection-C52Ndi_O.mjs} +4 -2
- package/dist/{collection-D0O9gp3S.mjs → collection-DNzM3u7n.mjs} +6 -6
- package/dist/{collection-namespace-DqPNrCdQ.mjs → collection-namespace-w1y5D0Uh.mjs} +2 -2
- package/dist/{create-Cii_utzV.mjs → create-BRK8TBzp.mjs} +5 -4
- package/dist/{create-DKuixGJ2.mjs → create-BkvdOecg.mjs} +5 -5
- package/dist/{create-E6L3WMqV.mjs → create-CGsTL5aE.mjs} +5 -5
- package/dist/{create-C17Fh1_X.mjs → create-C_fyIHZU.mjs} +8 -7
- package/dist/{create-05rX4oL-.mjs → create-CnT-L03B.mjs} +7 -7
- package/dist/{create-CZ9KFnbi.mjs → create-CnqGhtuF.mjs} +5 -5
- package/dist/{create-C8ndg3g4.mjs → create-CvptjYVb.mjs} +6 -6
- package/dist/create-DZBtbGqj.mjs +45 -0
- package/dist/{create-BR7x66KW.mjs → create-D_eiLBqR.mjs} +8 -8
- package/dist/create-DbHIjWio.mjs +45 -0
- package/dist/{create-Cyv7vHV_.mjs → create-VA58AF6A.mjs} +5 -5
- package/dist/{create-branch-Dxn6UnV_.mjs → create-branch-BtqOfSRb.mjs} +4 -4
- package/dist/{create-oLb0E-ZP.mjs → create-ldvT5L0W.mjs} +7 -7
- package/dist/{create-a3s1S2Dw.mjs → create-q2QqkwEN.mjs} +7 -7
- package/dist/{csv-T6_vlLJS.mjs → csv-C3O1wTQ8.mjs} +5 -5
- package/dist/{current-task-DxWbw-bU.mjs → current-task-CZsZPe0o.mjs} +4 -4
- package/dist/{dashboard-BpSPoeAn.mjs → dashboard-kb1oz7Z3.mjs} +8 -8
- package/dist/{database-CIbVSfua.mjs → database-BOqzcexD.mjs} +1 -1
- package/dist/{db-DBRijnh4.mjs → db-CHnqeJCo.mjs} +6 -6
- package/dist/{delete--P1xFX37.mjs → delete-BmT5C6eK.mjs} +5 -5
- package/dist/delete-DgI03U43.mjs +49 -0
- package/dist/delete-Dkfu4e5K.mjs +49 -0
- package/dist/{delete-Ce2EBQYA.mjs → delete-JeRzVISE.mjs} +5 -5
- package/dist/{delete-BBOIUl0D.mjs → delete-cF97pfFX.mjs} +5 -5
- package/dist/{delete-runtime-B-8I9V1g.mjs → delete-runtime-DiqKOEqi.mjs} +2 -2
- package/dist/{delete-table-Bj32NsXn.mjs → delete-table-dnQs_Twm.mjs} +5 -5
- package/dist/{dependencies-ixzjVjUz.mjs → dependencies-BsMwFSxP.mjs} +4 -4
- package/dist/{dirty-CH70h5m5.mjs → dirty-CN6sGKX3.mjs} +4 -4
- package/dist/{document-dZpuFu3I.mjs → document-Y_DZNi4D.mjs} +5 -5
- package/dist/{eid-XjkBbyb_.mjs → eid-60sCZhQV.mjs} +4 -4
- package/dist/events-CSZEAgs0.mjs +44 -0
- package/dist/{export-CChMg-mL.mjs → export-CAxUJer6.mjs} +6 -6
- package/dist/{field-B1heFeCz.mjs → field-DAB2gImv.mjs} +4 -4
- package/dist/{fields-C7h2QwUp.mjs → fields-CLWtUlpR.mjs} +4 -4
- package/dist/{get-AvGH_oph.mjs → get-B22wjDxr.mjs} +3 -3
- package/dist/{get-BWHJDa0B.mjs → get-BIHtWl2x.mjs} +4 -4
- package/dist/{get-BsyccuCH.mjs → get-BNBRMNtC.mjs} +5 -4
- package/dist/{get-Cj90oyxG.mjs → get-B_EinsrO.mjs} +4 -4
- package/dist/{get-cyR67Lmq.mjs → get-B_QKP1vR.mjs} +4 -4
- package/dist/{get-B6ZJCJ8H.mjs → get-CKnHNxak.mjs} +4 -4
- package/dist/{get-D9r2znrn.mjs → get-CRXEqpar.mjs} +4 -4
- package/dist/{get-DRZENkCj.mjs → get-Ca30K5_W.mjs} +4 -4
- package/dist/{get-C98IFgFi.mjs → get-CaosV7j8.mjs} +3 -3
- package/dist/{get-kqY2lwhO.mjs → get-Csa7Dz36.mjs} +4 -4
- package/dist/{get-DWWmpQ87.mjs → get-Ct5TnofS.mjs} +4 -4
- package/dist/{get-Dg1J0wxb.mjs → get-DTjeTNGb.mjs} +4 -4
- package/dist/get-DU8V-7S2.mjs +35 -0
- package/dist/get-DxAx-2C0.mjs +35 -0
- package/dist/{get-DrWYvefc.mjs → get-H3X5e5-Y.mjs} +4 -4
- package/dist/{get-KVN9ANVh.mjs → get-L8c_h5EP.mjs} +3 -3
- package/dist/{get-RlP_xiUd.mjs → get-fGOQA0GF.mjs} +5 -5
- package/dist/{get-run-C4C_QQqO.mjs → get-run-DqwPQRMJ.mjs} +4 -4
- package/dist/git-sync-BhhdNjq5.mjs +31 -0
- package/dist/{has-remote-changes-dLUGr0MD.mjs → has-remote-changes-D0ZIBHSk.mjs} +4 -4
- package/dist/{import-Byull6jF.mjs → import-BcIcDPl9.mjs} +6 -6
- package/dist/{input-m9ctfLxZ.mjs → input-D2-H-QKX.mjs} +1 -1
- package/dist/{is-dirty-CU3ovgdG.mjs → is-dirty-B87YMLV2.mjs} +3 -3
- package/dist/is-dirty-CXTS25Tk.mjs +8 -0
- package/dist/{items-CEGDYWuF.mjs → items-DrP1b4Qj.mjs} +6 -6
- package/dist/{key-Ge4VwWvS.mjs → key-GP1gxZZD.mjs} +1 -1
- package/dist/{library-DHWWa4Tt.mjs → library-bUBWlweP.mjs} +4 -4
- package/dist/{list-Cur_72xZ.mjs → list-B-_PTqKw.mjs} +6 -5
- package/dist/{list-th_Ym6Cv.mjs → list-B8212eUr.mjs} +4 -4
- package/dist/{list-D9FY30xH.mjs → list-B8zgT05M.mjs} +3 -3
- package/dist/{list-CmCJwaGT.mjs → list-BhCahBEO.mjs} +3 -3
- package/dist/{list-3z1ZChTG.mjs → list-CWQYaCp8.mjs} +3 -3
- package/dist/{list-BtcpNl4-.mjs → list-Cbhx7N_t.mjs} +3 -3
- package/dist/{list-BuyRG3GB.mjs → list-CoXeBm66.mjs} +4 -4
- package/dist/{list-O2w5xd1q.mjs → list-D1pHJX7w.mjs} +3 -3
- package/dist/{list-Bpv06V24.mjs → list-DCl7zHCp.mjs} +4 -4
- package/dist/{list-Br48kL09.mjs → list-DhT42e0q.mjs} +3 -3
- package/dist/{list-CMb03cv3.mjs → list-F_hMRbsa.mjs} +3 -3
- package/dist/{list-B9TyELob.mjs → list-GeqRHx8g.mjs} +3 -3
- package/dist/{list-BFm4iEBt.mjs → list-MPePXEWe.mjs} +3 -3
- package/dist/{list-BliCJAjt.mjs → list-TJjExx6e.mjs} +3 -3
- package/dist/list-TQghfc-u.mjs +39 -0
- package/dist/{list-DEkPxVZu.mjs → list-TibX1b8i.mjs} +3 -3
- package/dist/listing-wFZuS5li.mjs +10 -0
- package/dist/{login-hKlYsAa1.mjs → login-C5Ug3BVC.mjs} +6 -6
- package/dist/{logout-DO8GVC6b.mjs → logout-B_N1N2DV.mjs} +3 -3
- package/dist/{measure-R3T20wnB.mjs → measure-D9rKeA6Z.mjs} +5 -5
- package/dist/{parameter-values-BJb2GuLz.mjs → parameter-values-ZXKECrJk.mjs} +3 -3
- package/dist/{parse-enum-Cfne2suT.mjs → parse-enum-D5h-JePs.mjs} +1 -1
- package/dist/{parse-id-DfY0Lugw.mjs → parse-id-ySsF4nA3.mjs} +1 -1
- package/dist/{parse-ref-C_MsXYI6.mjs → parse-ref-Ds8VxdKb.mjs} +1 -1
- package/dist/{path-DzhQVCH8.mjs → path-C6ucgeYs.mjs} +3 -3
- package/dist/{poll-D1Yg78c3.mjs → poll-CgzD9_RH.mjs} +2 -2
- package/dist/{poll-task-DLUZaglY.mjs → poll-task-DF9xJl13.mjs} +2 -2
- package/dist/{preflight-Cy2jUSca.mjs → preflight-Co2grgX_.mjs} +2 -2
- package/dist/{process-D5HN1wpT.mjs → process-jjR_DX5G.mjs} +1 -1
- package/dist/{prompt-ZG9Drin_.mjs → prompt-BSqji7Fo.mjs} +1 -1
- package/dist/{publish-3hmHoaX-.mjs → publish-F-QbufXr.mjs} +12 -7
- package/dist/{query-DkZViD_3.mjs → query-DGBzATpV.mjs} +7 -7
- package/dist/{query-DTASj9Zu.mjs → query-DX4r0-uz.mjs} +4 -4
- package/dist/{query-result-CbTFdlSf.mjs → query-result-D5J3Dlpn.mjs} +1 -1
- package/dist/{remove-collection-D3wH9H6R.mjs → remove-collection-C-msSyas.mjs} +6 -6
- package/dist/{replace-CFzqkZXs.mjs → replace-xlQv9yl_.mjs} +5 -5
- package/dist/{requests-KBiY9UYy.mjs → requests-COuEPJxE.mjs} +2 -2
- package/dist/{rescan-values-B1WycObS.mjs → rescan-values-BC2SVtY6.mjs} +5 -5
- package/dist/{resolve-Ct084wx3.mjs → resolve-8iT-dXgX.mjs} +22 -15
- package/dist/{run-cw0qTEQ7.mjs → run-Cg6k3kHo.mjs} +6 -6
- package/dist/{run-B8qEEdC8.mjs → run-opQkYIaT.mjs} +3 -3
- package/dist/{runs-BOA4kK_X.mjs → runs-Cbqm1HYG.mjs} +5 -5
- package/dist/{runtime-B-c-Fc2i.mjs → runtime-MGH96fhp.mjs} +2 -2
- package/dist/{schema-tables-DRYzSVcW.mjs → schema-tables-8FjtkFIt.mjs} +4 -4
- package/dist/{schemas-BiMjD25L.mjs → schemas-L9kMsEJL.mjs} +3 -3
- package/dist/{search-DjKxRXO5.mjs → search-Csbb-u-_.mjs} +3 -3
- package/dist/{segment-CZkk0g79.mjs → segment-DCeafJwX.mjs} +5 -5
- package/dist/{selectors-B7MJUn3I.mjs → selectors-D34gXjQa.mjs} +3 -3
- package/dist/{set-kyoORFG3.mjs → set-CfwncOI_.mjs} +6 -6
- package/dist/{set-active-CF868qdW.mjs → set-active-gP4mjVDY.mjs} +3 -3
- package/dist/{setting-BZgjURQ_.mjs → setting-D5Y9sJha.mjs} +3 -3
- package/dist/{setup-D9joJYPb.mjs → setup-D9HNfS7W.mjs} +4 -4
- package/dist/{skills-D8NrJxjp.mjs → skills-DvSQOPWg.mjs} +3 -3
- package/dist/{skills-BqI05u72.mjs → skills-aRQfUvCq.mjs} +1 -1
- package/dist/{snippet-y_FzKxaQ.mjs → snippet-CwRiMCfE.mjs} +5 -5
- package/dist/{stash-BVMerTaF.mjs → stash-C_k1uZlf.mjs} +6 -6
- package/dist/{status-x8bDOa1i.mjs → status-BsEPyknG.mjs} +26 -10
- package/dist/{status-C-0jFjFn.mjs → status-D1vtL5eW.mjs} +2 -2
- package/dist/{summary-B-R9SdMF.mjs → summary-h20AjhcO.mjs} +3 -3
- package/dist/{sync-schema-wne2KXIW.mjs → sync-schema-D67cYLhd.mjs} +7 -7
- package/dist/sync-scope-CKx6xeF6.mjs +55 -0
- package/dist/{table-CS2-2INi.mjs → table-CmKFWPvJ.mjs} +4 -4
- package/dist/timeline-1ZphX3zj.mjs +24 -0
- package/dist/timeline-2ShuGr4f.mjs +157 -0
- package/dist/timeline-event-C6aKZ4EO.mjs +22 -0
- package/dist/transform-CvsBOTqB.mjs +31 -0
- package/dist/transform-job-D_8Kp772.mjs +25 -0
- package/dist/{transform-tag-DaNKreDj.mjs → transform-tag-DhDnvbmq.mjs} +4 -4
- package/dist/{transforms-DB2WNP2R.mjs → transforms-BQkmsPUR.mjs} +4 -4
- package/dist/{tree-BIOphGVs.mjs → tree-CtufTBZY.mjs} +3 -3
- package/dist/{unpublish-BWM36ZTg.mjs → unpublish-CnLXPYR8.mjs} +4 -4
- package/dist/{update-CTZg2Lia.mjs → update-BC-MLtiG.mjs} +9 -9
- package/dist/{update-BCbv880u.mjs → update-BZxLyBVm.mjs} +8 -8
- package/dist/{update-Sz0QRGWB.mjs → update-C4P_YtGW.mjs} +6 -6
- package/dist/{update-BlzcZwRQ.mjs → update-CE-Z6E8V.mjs} +8 -8
- package/dist/update-CqQj32ol.mjs +52 -0
- package/dist/update-D6blsNGY.mjs +52 -0
- package/dist/{update-BchtHlbH.mjs → update-DcYwxb-R.mjs} +6 -6
- package/dist/{update-zfLbmC-H.mjs → update-DmQJqGvX.mjs} +6 -6
- package/dist/{update-BiUeEGU-.mjs → update-DshCe-bl.mjs} +8 -8
- package/dist/{update-6umfSz5t.mjs → update-Dt9-3Tqf.mjs} +5 -5
- package/dist/{update-7Ts7KrB8.mjs → update-QNuvGuS3.mjs} +6 -6
- package/dist/{update-HxYcvpSq.mjs → update-bz-FKwuR.mjs} +7 -7
- package/dist/{update-DJDuIhYG.mjs → update-dJ2mlCXm.mjs} +6 -6
- package/dist/{update-dashcard-CfDpy7Lz.mjs → update-dashcard-CQP-qd6a.mjs} +6 -6
- package/dist/{upgrade-BWl0VjMK.mjs → upgrade--_g3bacj.mjs} +4 -4
- package/dist/{upload-CPzOhGeX.mjs → upload-BOFc_eZD.mjs} +3 -3
- package/dist/{uuid-D_YeqDui.mjs → uuid-DBKkosBq.mjs} +2 -2
- package/dist/{validate-clAWO3X-.mjs → validate-Bpqt3ntH.mjs} +1 -1
- package/dist/{validate-query-CsK2_2_u.mjs → validate-query-tECK019A.mjs} +2 -2
- package/dist/{values-DSk8ZJ3B.mjs → values-BAhMnVh6.mjs} +3 -3
- package/dist/{verify-DkQdLjf3.mjs → verify-RLb2DoOX.mjs} +2 -2
- package/dist/{wait-DvSsMjea.mjs → wait-BJ_87Yz0.mjs} +5 -5
- package/dist/{wait-flags-dXGThljd.mjs → wait-flags-DEn-3mjb.mjs} +2 -2
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +5 -3
- package/skill-data/git-sync/SKILL.md +20 -5
- package/skill-data/visualization/SKILL.md +1 -0
- package/dist/add-collection-DlAwt2Z3.mjs +0 -9
- package/dist/git-sync-JHa7bIyY.mjs +0 -31
- package/dist/is-dirty-Bb2dfEYs.mjs +0 -8
- package/dist/transform-6hqM1DXA.mjs +0 -31
- package/dist/transform-job-DuERhLaj.mjs +0 -25
- /package/dist/{dashboard-B-MTpfeS.mjs → dashboard-BLihjDXg.mjs} +0 -0
- /package/dist/{document-CL4ML5FN.mjs → document-D4zB-5a0.mjs} +0 -0
- /package/dist/{measure-S9WszHre.mjs → measure-ByY4U3ZK.mjs} +0 -0
- /package/dist/{paginate-CMqbqhMC.mjs → paginate-FVZUxL4J.mjs} +0 -0
- /package/dist/{revision-message-flag-CHzX0cqV.mjs → revision-message-flag-vt_V8ACy.mjs} +0 -0
- /package/dist/{segment-BPb1H6DW.mjs → segment-eeGhLo7_.mjs} +0 -0
- /package/dist/{setting-Cko6bE_w.mjs → setting-DADuiF5W.mjs} +0 -0
- /package/dist/{snippet-DWiXNy4T.mjs → snippet-CdjEhVCT.mjs} +0 -0
- /package/dist/{table-C3RIKiYM.mjs → table-3onHpwcb.mjs} +0 -0
- /package/dist/{transform-JQel7e5H.mjs → transform-DNSMm1dV.mjs} +0 -0
- /package/dist/{transform-job-CtVziW85.mjs → transform-job-CvE0MBBo.mjs} +0 -0
- /package/dist/{transform-tag-wFiWmiyO.mjs → transform-tag-xdxjlDcD.mjs} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Collection } from "./collection-
|
|
1
|
+
import { Collection } from "./collection-C52Ndi_O.mjs";
|
|
2
|
+
import { fetchCollectionsWithLibrary } from "./listing-wFZuS5li.mjs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
|
|
4
5
|
//#region src/domain/library.ts
|
|
@@ -6,7 +7,8 @@ const LibraryChild = Collection.pick({
|
|
|
6
7
|
id: true,
|
|
7
8
|
name: true,
|
|
8
9
|
type: true,
|
|
9
|
-
description: true
|
|
10
|
+
description: true,
|
|
11
|
+
is_remote_synced: true
|
|
10
12
|
}).strip();
|
|
11
13
|
const Library = Collection.extend({ effective_children: z.array(LibraryChild) }).loose();
|
|
12
14
|
const LibraryCompact = Library.pick({
|
|
@@ -36,33 +38,38 @@ const libraryView = {
|
|
|
36
38
|
//#endregion
|
|
37
39
|
//#region src/commands/library/resolve.ts
|
|
38
40
|
const LIBRARY_ROOT_PATH = "/api/ee/library/";
|
|
39
|
-
const COLLECTION_LIST_PATH = "/api/collection";
|
|
40
41
|
const LIBRARY_DATA_TYPE = "library-data";
|
|
41
42
|
const AbsentLibrary = z.object({ data: z.null() });
|
|
42
43
|
const LibraryOrAbsent = z.union([Library, AbsentLibrary]);
|
|
43
44
|
const LibraryCollectionEntry = Collection.pick({
|
|
44
45
|
id: true,
|
|
45
|
-
type: true
|
|
46
|
+
type: true,
|
|
47
|
+
is_remote_synced: true
|
|
46
48
|
}).strip();
|
|
47
|
-
const LibraryCollections = z.array(LibraryCollectionEntry);
|
|
48
49
|
async function fetchLibrary(client) {
|
|
49
50
|
const result = await client.requestParsed(LibraryOrAbsent, LIBRARY_ROOT_PATH);
|
|
50
51
|
if (!("effective_children" in result)) return null;
|
|
51
|
-
const
|
|
52
|
-
const effective_children = result.effective_children.map((child) =>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
const infoById = await fetchLibraryCollectionInfo(client);
|
|
53
|
+
const effective_children = result.effective_children.map((child) => {
|
|
54
|
+
if (typeof child.id !== "number") return child;
|
|
55
|
+
const info = infoById.get(child.id);
|
|
56
|
+
if (info === void 0) return child;
|
|
57
|
+
return {
|
|
58
|
+
...child,
|
|
59
|
+
type: info.type ?? child.type,
|
|
60
|
+
is_remote_synced: info.is_remote_synced ?? child.is_remote_synced
|
|
61
|
+
};
|
|
62
|
+
});
|
|
56
63
|
return {
|
|
57
64
|
...result,
|
|
58
65
|
effective_children
|
|
59
66
|
};
|
|
60
67
|
}
|
|
61
|
-
async function
|
|
62
|
-
const collections = await client
|
|
63
|
-
const
|
|
64
|
-
for (const collection of collections) if (typeof collection.id === "number"
|
|
65
|
-
return
|
|
68
|
+
async function fetchLibraryCollectionInfo(client) {
|
|
69
|
+
const collections = await fetchCollectionsWithLibrary(client, LibraryCollectionEntry);
|
|
70
|
+
const infoById = new Map();
|
|
71
|
+
for (const collection of collections) if (typeof collection.id === "number") infoById.set(collection.id, collection);
|
|
72
|
+
return infoById;
|
|
66
73
|
}
|
|
67
74
|
async function createLibrary(client) {
|
|
68
75
|
const existing = await fetchLibrary(client);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { TimeoutError, connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-
|
|
1
|
+
import { TimeoutError, connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { parseId } from "./parse-id-
|
|
5
|
-
import { pollUntil } from "./poll-
|
|
6
|
-
import { parseWaitFlags, waitFlags } from "./wait-flags-
|
|
7
|
-
import { Transform, TransformRun } from "./transform-
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-ySsF4nA3.mjs";
|
|
5
|
+
import { pollUntil } from "./poll-CgzD9_RH.mjs";
|
|
6
|
+
import { parseWaitFlags, waitFlags } from "./wait-flags-DEn-3mjb.mjs";
|
|
7
|
+
import { Transform, TransformRun } from "./transform-DNSMm1dV.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
10
10
|
//#region src/commands/transform/run.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { parseId } from "./parse-id-
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-ySsF4nA3.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/commands/transform-job/run.ts
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList } from "./capabilities-
|
|
1
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { parseId } from "./parse-id-
|
|
5
|
-
import { collectPaginated } from "./paginate-
|
|
6
|
-
import { TransformRun, TransformRunCompact, transformRunView } from "./transform-
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-ySsF4nA3.mjs";
|
|
5
|
+
import { collectPaginated } from "./paginate-FVZUxL4J.mjs";
|
|
6
|
+
import { TransformRun, TransformRunCompact, transformRunView } from "./transform-DNSMm1dV.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/commands/transform/runs.ts
|
|
9
9
|
const TransformRunListEnvelope = listEnvelopeSchema(TransformRunCompact);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AbortError, BASELINE_CAPABILITIES, ConfigError, DEFAULT_MAX_BYTES, ENV_API_KEY, ENV_DISABLE_KEYRING, ENV_PROFILE, ENV_SKIP_PREFLIGHT, ENV_URL, MetabaseError, NetworkError, ResponseShapeError, TimeoutError, ValidationError, consumeLegacyEnvWarnings, errorMessage, flagConsumesValue, isNotFoundError, isPlainObject, normalizeFlag, package_default, readEnv, reportError, toAliasArray, warn } from "./capabilities-
|
|
1
|
+
import { AbortError, BASELINE_CAPABILITIES, ConfigError, DEFAULT_MAX_BYTES, ENV_API_KEY, ENV_DISABLE_KEYRING, ENV_PROFILE, ENV_SKIP_PREFLIGHT, ENV_URL, MetabaseError, NetworkError, ResponseShapeError, TimeoutError, ValidationError, consumeLegacyEnvWarnings, errorMessage, flagConsumesValue, isNotFoundError, isPlainObject, normalizeFlag, package_default, readEnv, reportError, toAliasArray, warn } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import { setMetabaseAugment } from "./command-augment-D9pI9Vbh.mjs";
|
|
3
3
|
import { defineCommand } from "citty";
|
|
4
4
|
import { z } from "zod";
|
|
@@ -744,7 +744,7 @@ function buildNetworkError(error, method, url) {
|
|
|
744
744
|
}
|
|
745
745
|
function networkMessage(code, target, fallback) {
|
|
746
746
|
if (code === null) return `Could not reach Metabase: ${fallback}`;
|
|
747
|
-
if (TLS_ERROR_CODES.has(code)) return `Could not reach Metabase: TLS error contacting ${target.host} (${code}) — the certificate could not be verified, or https:// was used against a plain-HTTP server.`;
|
|
747
|
+
if (TLS_ERROR_CODES.has(code)) return `Could not reach Metabase: TLS error contacting ${target.host} (${code}) — the certificate could not be verified, or https:// was used against a plain-HTTP server. For a certificate the OS does not trust either, set NODE_EXTRA_CA_CERTS to its CA bundle.`;
|
|
748
748
|
const hint = NETWORK_HINTS[code];
|
|
749
749
|
if (hint === void 0) return `Could not reach Metabase: ${fallback} (${code})`;
|
|
750
750
|
return `Could not reach Metabase: ${hint(target)}`;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList, wrapList } from "./capabilities-
|
|
1
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList, wrapList } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
4
|
import "./field-DsXTeqBy.mjs";
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
6
|
-
import { Table, TableCompact, tableView } from "./table-
|
|
5
|
+
import { parseId } from "./parse-id-ySsF4nA3.mjs";
|
|
6
|
+
import { Table, TableCompact, tableView } from "./table-3onHpwcb.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
|
|
9
9
|
//#region src/commands/db/schema-tables.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList, wrapList } from "./capabilities-
|
|
1
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList, wrapList } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { parseId } from "./parse-id-
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-ySsF4nA3.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/commands/db/schemas.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList } from "./capabilities-
|
|
1
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand, parseEnumCsv } from "./runtime-
|
|
4
|
-
import { parseId } from "./parse-id-
|
|
3
|
+
import { defineMetabaseCommand, parseEnumCsv } from "./runtime-MGH96fhp.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-ySsF4nA3.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/domain/search.ts
|
|
@@ -13,11 +13,11 @@ var segment_default = defineCommandGroup({
|
|
|
13
13
|
purpose: "define reusable segments"
|
|
14
14
|
}],
|
|
15
15
|
subCommands: {
|
|
16
|
-
list: () => import("./list-
|
|
17
|
-
get: () => import("./get-
|
|
18
|
-
create: () => import("./create-
|
|
19
|
-
update: () => import("./update-
|
|
20
|
-
archive: () => import("./archive-
|
|
16
|
+
list: () => import("./list-TJjExx6e.mjs").then((mod) => mod.default),
|
|
17
|
+
get: () => import("./get-Ca30K5_W.mjs").then((mod) => mod.default),
|
|
18
|
+
create: () => import("./create-CnT-L03B.mjs").then((mod) => mod.default),
|
|
19
|
+
update: () => import("./update-BZxLyBVm.mjs").then((mod) => mod.default),
|
|
20
|
+
archive: () => import("./archive-CjnCAM61.mjs").then((mod) => mod.default)
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ConfigError } from "./capabilities-
|
|
2
|
-
import { parseCsv } from "./runtime-
|
|
3
|
-
import { parseId } from "./parse-id-
|
|
1
|
+
import { ConfigError } from "./capabilities-CSjeWyLV.mjs";
|
|
2
|
+
import { parseCsv } from "./runtime-MGH96fhp.mjs";
|
|
3
|
+
import { parseId } from "./parse-id-ySsF4nA3.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/commands/library/selectors.ts
|
|
6
6
|
const tableSelectorFlags = {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { connectionFlags, formatScalar, outputFlags, profileFlag, renderSummary } from "./capabilities-
|
|
1
|
+
import { connectionFlags, formatScalar, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./input-
|
|
5
|
-
import { readBody } from "./body-
|
|
6
|
-
import { SettingValue, settingValueView } from "./setting-
|
|
7
|
-
import { parseSettingKey, rethrowSettingError } from "./key-
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
|
+
import "./input-D2-H-QKX.mjs";
|
|
5
|
+
import { readBody } from "./body-BW_CiL1d.mjs";
|
|
6
|
+
import { SettingValue, settingValueView } from "./setting-DADuiF5W.mjs";
|
|
7
|
+
import { parseSettingKey, rethrowSettingError } from "./key-GP1gxZZD.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
10
10
|
//#region src/commands/setting/set.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { parseEnumFlag } from "./parse-enum-
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
|
+
import { parseEnumFlag } from "./parse-enum-D5h-JePs.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/commands/transform-job/set-active.ts
|
|
@@ -10,9 +10,9 @@ var setting_default = defineCommandGroup({
|
|
|
10
10
|
purpose: "setting get/set JSON value quoting"
|
|
11
11
|
}],
|
|
12
12
|
subCommands: {
|
|
13
|
-
list: () => import("./list-
|
|
14
|
-
get: () => import("./get-
|
|
15
|
-
set: () => import("./set-
|
|
13
|
+
list: () => import("./list-D1pHJX7w.mjs").then((m) => m.default),
|
|
14
|
+
get: () => import("./get-DTjeTNGb.mjs").then((m) => m.default),
|
|
15
|
+
set: () => import("./set-CfwncOI_.mjs").then((m) => m.default)
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./input-
|
|
5
|
-
import { readBody } from "./body-
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
|
+
import "./input-D2-H-QKX.mjs";
|
|
5
|
+
import { readBody } from "./body-BW_CiL1d.mjs";
|
|
6
6
|
import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
|
|
@@ -8,9 +8,9 @@ var skills_default = defineCommand({
|
|
|
8
8
|
},
|
|
9
9
|
default: "list",
|
|
10
10
|
subCommands: {
|
|
11
|
-
list: () => import("./list-
|
|
12
|
-
get: () => import("./get-
|
|
13
|
-
path: () => import("./path-
|
|
11
|
+
list: () => import("./list-TibX1b8i.mjs").then((m) => m.default),
|
|
12
|
+
get: () => import("./get-L8c_h5EP.mjs").then((m) => m.default),
|
|
13
|
+
path: () => import("./path-C6ucgeYs.mjs").then((m) => m.default)
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigError, ValidationError, errorMessage, isNotFoundError } from "./capabilities-
|
|
1
|
+
import { ConfigError, ValidationError, errorMessage, isNotFoundError } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { closeSync, openSync, readFileSync, readSync, readdirSync, statSync } from "node:fs";
|
|
4
4
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -10,11 +10,11 @@ var snippet_default = defineCommandGroup({
|
|
|
10
10
|
purpose: "native-SQL snippets and body input"
|
|
11
11
|
}],
|
|
12
12
|
subCommands: {
|
|
13
|
-
list: () => import("./list-
|
|
14
|
-
get: () => import("./get-
|
|
15
|
-
create: () => import("./create-
|
|
16
|
-
update: () => import("./update-
|
|
17
|
-
archive: () => import("./archive-
|
|
13
|
+
list: () => import("./list-BhCahBEO.mjs").then((mod) => mod.default),
|
|
14
|
+
get: () => import("./get-BIHtWl2x.mjs").then((mod) => mod.default),
|
|
15
|
+
create: () => import("./create-VA58AF6A.mjs").then((mod) => mod.default),
|
|
16
|
+
update: () => import("./update-C4P_YtGW.mjs").then((mod) => mod.default),
|
|
17
|
+
archive: () => import("./archive-BIEnBoE8.mjs").then((mod) => mod.default)
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ConfigError, connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-
|
|
1
|
+
import { ConfigError, connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./parse-id-
|
|
5
|
-
import "./poll-
|
|
6
|
-
import { gitSyncWaitFlags, parseWaitFlags } from "./wait-flags-
|
|
7
|
-
import { REMOTE_SYNC_PATHS, SyncTask, formatSyncTask, pollSyncTask, throwIfFailedTask } from "./poll-task-
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
|
+
import "./parse-id-ySsF4nA3.mjs";
|
|
5
|
+
import "./poll-CgzD9_RH.mjs";
|
|
6
|
+
import { gitSyncWaitFlags, parseWaitFlags } from "./wait-flags-DEn-3mjb.mjs";
|
|
7
|
+
import { REMOTE_SYNC_PATHS, SyncTask, formatSyncTask, pollSyncTask, throwIfFailedTask } from "./poll-task-DF9xJl13.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
10
10
|
//#region src/commands/git-sync/stash.ts
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
|
+
import "./collection-C52Ndi_O.mjs";
|
|
5
|
+
import "./listing-wFZuS5li.mjs";
|
|
6
|
+
import "./poll-CgzD9_RH.mjs";
|
|
7
|
+
import { REMOTE_SYNC_PATHS, SyncTask, fetchCurrentTask, fetchOptionalParsed, formatSyncTask } from "./poll-task-DF9xJl13.mjs";
|
|
8
|
+
import { IsDirtyResult } from "./is-dirty-B87YMLV2.mjs";
|
|
9
|
+
import { SyncedCollection, fetchSyncedCollections } from "./sync-scope-CKx6xeF6.mjs";
|
|
7
10
|
import { z } from "zod";
|
|
8
11
|
|
|
9
12
|
//#region src/commands/git-sync/status.ts
|
|
@@ -11,7 +14,8 @@ const RemoteSyncBranch = z.string().nullable();
|
|
|
11
14
|
const SyncStatus = z.object({
|
|
12
15
|
branch: z.string().nullable(),
|
|
13
16
|
is_dirty: z.boolean(),
|
|
14
|
-
current_task: SyncTask.nullable()
|
|
17
|
+
current_task: SyncTask.nullable(),
|
|
18
|
+
synced_collections: z.array(SyncedCollection)
|
|
15
19
|
});
|
|
16
20
|
const syncStatusView = {
|
|
17
21
|
compactPick: SyncStatus,
|
|
@@ -27,6 +31,10 @@ const syncStatusView = {
|
|
|
27
31
|
{
|
|
28
32
|
key: "current_task",
|
|
29
33
|
label: "Current task"
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
key: "synced_collections",
|
|
37
|
+
label: "Synced collections"
|
|
30
38
|
}
|
|
31
39
|
]
|
|
32
40
|
};
|
|
@@ -48,22 +56,30 @@ var status_default = defineMetabaseCommand({
|
|
|
48
56
|
examples: ["mb git-sync status", "mb git-sync status --json"],
|
|
49
57
|
async run({ ctx, getClient }) {
|
|
50
58
|
const client = await getClient();
|
|
51
|
-
const [branch, isDirty, currentTask] = await Promise.all([
|
|
59
|
+
const [branch, isDirty, currentTask, syncedCollections] = await Promise.all([
|
|
52
60
|
fetchOptionalParsed(client, "/api/setting/remote-sync-branch", RemoteSyncBranch),
|
|
53
61
|
client.requestParsed(IsDirtyResult, REMOTE_SYNC_PATHS.isDirty),
|
|
54
|
-
fetchCurrentTask(client)
|
|
62
|
+
fetchCurrentTask(client),
|
|
63
|
+
fetchSyncedCollections(client)
|
|
55
64
|
]);
|
|
56
65
|
const summary = {
|
|
57
66
|
branch,
|
|
58
67
|
is_dirty: isDirty.is_dirty,
|
|
59
|
-
current_task: currentTask
|
|
68
|
+
current_task: currentTask,
|
|
69
|
+
synced_collections: syncedCollections
|
|
60
70
|
};
|
|
61
71
|
const branchPart = branch === null ? "git-sync branch not set" : `Branch ${branch}`;
|
|
62
72
|
const dirtyPart = isDirty.is_dirty ? "Metabase has unsynced local changes" : "in sync with the remote";
|
|
63
73
|
const taskPart = currentTask === null ? "No task running." : formatSyncTask(currentTask);
|
|
64
|
-
|
|
74
|
+
const scopePart = formatSyncedCollections(syncedCollections);
|
|
75
|
+
renderSummary(summary, syncStatusView, `${branchPart} — ${dirtyPart}. ${taskPart} ${scopePart}`, ctx);
|
|
65
76
|
}
|
|
66
77
|
});
|
|
78
|
+
function formatSyncedCollections(collections) {
|
|
79
|
+
if (collections.length === 0) return "No collections are marked for sync.";
|
|
80
|
+
const names = collections.map((collection) => `${collection.name} (${collection.id})`);
|
|
81
|
+
return `Synced collections: ${names.join(", ")}.`;
|
|
82
|
+
}
|
|
67
83
|
|
|
68
84
|
//#endregion
|
|
69
85
|
export { status_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { outputFlags, profileFlag, renderItem } from "./capabilities-
|
|
1
|
+
import { outputFlags, profileFlag, renderItem } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { ParsedVersionSchema, ProbedUser, ProfileAuthMethod, ProfileLastFailure, TokenFeatures, defineMetabaseCommand, displayUrl, profileAuthMethod, readProfileRecord, resolveProfileName } from "./runtime-
|
|
3
|
+
import { ParsedVersionSchema, ProbedUser, ProfileAuthMethod, ProfileLastFailure, TokenFeatures, defineMetabaseCommand, displayUrl, profileAuthMethod, readProfileRecord, resolveProfileName } from "./runtime-MGH96fhp.mjs";
|
|
4
4
|
import { renderAuthMethod, renderTimestamp, renderUserName, renderUserRole, renderVersionTag } from "./render-CkuFkWlQ.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { connectionFlags, outputFlags, profileFlag, renderItem } from "./capabilities-
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderItem } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
4
|
import { FieldSummary, FieldSummaryRaw, fieldSummaryView } from "./field-DsXTeqBy.mjs";
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
5
|
+
import { parseId } from "./parse-id-ySsF4nA3.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/commands/field/summary.ts
|
|
8
8
|
var summary_default = defineMetabaseCommand({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
|
|
4
4
|
import "./field-DsXTeqBy.mjs";
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
6
|
-
import "./table-
|
|
7
|
-
import { Database, DatabaseSyncResult, DatabaseTaskAck, databaseSyncResultView } from "./database-
|
|
8
|
-
import { pollUntil } from "./poll-
|
|
9
|
-
import { parseWaitFlags, waitFlags } from "./wait-flags-
|
|
5
|
+
import { parseId } from "./parse-id-ySsF4nA3.mjs";
|
|
6
|
+
import "./table-3onHpwcb.mjs";
|
|
7
|
+
import { Database, DatabaseSyncResult, DatabaseTaskAck, databaseSyncResultView } from "./database-BOqzcexD.mjs";
|
|
8
|
+
import { pollUntil } from "./poll-CgzD9_RH.mjs";
|
|
9
|
+
import { parseWaitFlags, waitFlags } from "./wait-flags-DEn-3mjb.mjs";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/db/sync-schema.ts
|
|
12
12
|
var sync_schema_default = defineMetabaseCommand({
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { errorMessage, warn } from "./capabilities-CSjeWyLV.mjs";
|
|
2
|
+
import { HttpError } from "./runtime-MGH96fhp.mjs";
|
|
3
|
+
import { Collection } from "./collection-C52Ndi_O.mjs";
|
|
4
|
+
import { fetchCollectionsWithLibrary } from "./listing-wFZuS5li.mjs";
|
|
5
|
+
import { fetchOptionalParsed } from "./poll-task-DF9xJl13.mjs";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
|
|
8
|
+
//#region src/commands/git-sync/sync-scope.ts
|
|
9
|
+
const REMOTE_SYNC_URL_SETTING_PATH = "/api/setting/remote-sync-url";
|
|
10
|
+
const RemoteSyncUrl = z.string().nullable();
|
|
11
|
+
const SyncedCollection = Collection.pick({
|
|
12
|
+
id: true,
|
|
13
|
+
name: true
|
|
14
|
+
}).strip();
|
|
15
|
+
const SyncScopeCollection = Collection.pick({
|
|
16
|
+
id: true,
|
|
17
|
+
name: true,
|
|
18
|
+
is_remote_synced: true
|
|
19
|
+
}).strip();
|
|
20
|
+
async function fetchSyncedCollections(client) {
|
|
21
|
+
const collections = await fetchCollectionsWithLibrary(client, SyncScopeCollection);
|
|
22
|
+
return collections.filter((collection) => collection.is_remote_synced === true).map((collection) => ({
|
|
23
|
+
id: collection.id,
|
|
24
|
+
name: collection.name
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
async function fetchRemoteSyncUrlIfReadable(client) {
|
|
28
|
+
try {
|
|
29
|
+
const url = await fetchOptionalParsed(client, REMOTE_SYNC_URL_SETTING_PATH, RemoteSyncUrl);
|
|
30
|
+
return url === "" ? null : url;
|
|
31
|
+
} catch (error) {
|
|
32
|
+
if (error instanceof HttpError && (error.status === 403 || error.status === 404)) return null;
|
|
33
|
+
throw error;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function isOutsideSyncScope(collection) {
|
|
37
|
+
return collection !== null && collection.is_remote_synced === false;
|
|
38
|
+
}
|
|
39
|
+
function syncScopeHint(collection, remoteSyncUrl) {
|
|
40
|
+
if (!isOutsideSyncScope(collection) || remoteSyncUrl === null) return null;
|
|
41
|
+
return `Note: collection ${collection.id} "${collection.name}" is not marked for git-sync, so \`mb git-sync export\` will not carry it (or its published tables' metadata) to ${remoteSyncUrl}. Add it with: mb git-sync add-collection ${collection.id}`;
|
|
42
|
+
}
|
|
43
|
+
async function warnIfOutsideSyncScope(client, collection) {
|
|
44
|
+
if (!isOutsideSyncScope(collection)) return;
|
|
45
|
+
try {
|
|
46
|
+
const remoteSyncUrl = await fetchRemoteSyncUrlIfReadable(client);
|
|
47
|
+
const hint = syncScopeHint(collection, remoteSyncUrl);
|
|
48
|
+
if (hint !== null) warn(hint);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
warn(`Could not check git-sync scope for collection ${collection.id}: ${errorMessage(error)}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//#endregion
|
|
55
|
+
export { SyncedCollection, fetchSyncedCollections, warnIfOutsideSyncScope };
|
|
@@ -10,10 +10,10 @@ var table_default = defineCommandGroup({
|
|
|
10
10
|
purpose: "table and column metadata, semantic types, visibility"
|
|
11
11
|
}],
|
|
12
12
|
subCommands: {
|
|
13
|
-
list: () => import("./list-
|
|
14
|
-
get: () => import("./get-
|
|
15
|
-
fields: () => import("./fields-
|
|
16
|
-
update: () => import("./update-
|
|
13
|
+
list: () => import("./list-B8212eUr.mjs").then((m) => m.default),
|
|
14
|
+
get: () => import("./get-Csa7Dz36.mjs").then((m) => m.default),
|
|
15
|
+
fields: () => import("./fields-CLWtUlpR.mjs").then((m) => m.default),
|
|
16
|
+
update: () => import("./update-DcYwxb-R.mjs").then((m) => m.default)
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
2
|
+
import { defineCommandGroup } from "./group-CILtQqCL.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/commands/timeline/index.ts
|
|
5
|
+
var timeline_default = defineCommandGroup({
|
|
6
|
+
name: "timeline",
|
|
7
|
+
description: "Manage Metabase timelines (event annotations for time-series charts)",
|
|
8
|
+
skills: [{
|
|
9
|
+
skill: "core",
|
|
10
|
+
purpose: "collection scoping — events render only on questions in the timeline's collection"
|
|
11
|
+
}],
|
|
12
|
+
subCommands: {
|
|
13
|
+
list: () => import("./list-TQghfc-u.mjs").then((mod) => mod.default),
|
|
14
|
+
get: () => import("./get-DU8V-7S2.mjs").then((mod) => mod.default),
|
|
15
|
+
events: () => import("./events-CSZEAgs0.mjs").then((mod) => mod.default),
|
|
16
|
+
create: () => import("./create-DbHIjWio.mjs").then((mod) => mod.default),
|
|
17
|
+
update: () => import("./update-D6blsNGY.mjs").then((mod) => mod.default),
|
|
18
|
+
archive: () => import("./archive-CPgWNCG3.mjs").then((mod) => mod.default),
|
|
19
|
+
delete: () => import("./delete-DgI03U43.mjs").then((mod) => mod.default)
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
export { timeline_default as default };
|