@metabase/cli 0.1.0-alpha.workspaces-commands.818a8f1 → 0.1.0-alpha.workspaces-commands.9af92d7
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 +129 -0
- package/dist/{api-key-D9XxErQn.mjs → api-key-U35bYysN.mjs} +1 -1
- package/dist/{archive-BPG5c88Y.mjs → archive-t98qQCTg.mjs} +6 -5
- package/dist/{auth--Hpjwlaf.mjs → auth-Pmzzbl9X.mjs} +3 -3
- package/dist/{body-DwU2s6Pg.mjs → body-qjVMvNjF.mjs} +3 -2
- package/dist/{branches-BbcoJXfp.mjs → branches-GR_uFakd.mjs} +6 -5
- package/dist/{cancel-task-BDas45YO.mjs → cancel-task-Bx4unmzB.mjs} +6 -5
- package/dist/card-CY60jlXc.mjs +19 -0
- package/dist/cards-CvXNClLR.mjs +37 -0
- package/dist/cli.mjs +19 -17
- package/dist/create-78zUdOrE.mjs +48 -0
- package/dist/{create-DpnjQvPw.mjs → create-A8ixnCEp.mjs} +8 -7
- package/dist/create-CT8GaHhd.mjs +44 -0
- package/dist/create-DOsPeHvv.mjs +47 -0
- package/dist/{create-CCzsCZMm.mjs → create-DRSgnSTg.mjs} +8 -7
- package/dist/{create-branch-sDttBORB.mjs → create-branch-95PKGg4J.mjs} +6 -5
- package/dist/{create-Bd_U1zWU.mjs → create-klUmZ4qb.mjs} +9 -8
- package/dist/{credentials-C0xKke5D.mjs → credentials-h6gwy6KC.mjs} +8 -7
- package/dist/{current-task-BGt1mqaX.mjs → current-task-CKTHTDJ-.mjs} +6 -5
- package/dist/dashboard-BVEiysxL.mjs +20 -0
- package/dist/dashboard-DVCLGg3X.mjs +152 -0
- package/dist/{database-4V1iiPEx.mjs → database-VBWFKoFw.mjs} +3 -3
- package/dist/{db-Dm2u2ISJ.mjs → db-BNIiulL8.mjs} +2 -2
- package/dist/{delete-DRBTgyus.mjs → delete-Dgw7tuwF.mjs} +7 -6
- package/dist/{delete-DUC_stoL.mjs → delete-SpvnjwpH.mjs} +7 -6
- package/dist/{delete-runtime-inOVw3IX.mjs → delete-runtime-ZDxlvZa6.mjs} +3 -3
- package/dist/{delete-table-9Is631O_.mjs → delete-table-BXmFReAx.mjs} +7 -6
- package/dist/{deprovision-BAMzZc6f.mjs → deprovision-Cay-ixJs.mjs} +11 -10
- package/dist/{dirty-CLjHbz6J.mjs → dirty-CNjg0YSW.mjs} +6 -5
- package/dist/{docker-QWVMG2gl.mjs → docker-D2GAMpHR.mjs} +3 -2
- package/dist/{eid-BNhutC1U.mjs → eid-CLOyMi0C.mjs} +1 -1
- package/dist/errors-C6w1eZ1F.mjs +101 -0
- package/dist/{export-D2Anfu3p.mjs → export-D2PP3RlE.mjs} +7 -6
- package/dist/{field-Dhs2AND3.mjs → field-D9nztsQP.mjs} +1 -1
- package/dist/{flag-pair-CWvvzDJ_.mjs → flag-pair-Dz-mbq0z.mjs} +1 -1
- package/dist/{get-CAPLfawI.mjs → get-B32KbqqV.mjs} +6 -5
- package/dist/{get-2po1uv9i.mjs → get-B6PHgITW.mjs} +6 -5
- package/dist/{get-BHJA78zg.mjs → get-Bc0yqaS1.mjs} +6 -5
- package/dist/{get-CAVVmdMX.mjs → get-BzfjbJ1f.mjs} +6 -5
- package/dist/{get-DhIoNeOp.mjs → get-CW0uHmFb.mjs} +6 -5
- package/dist/{get-qPOsuTPw.mjs → get-DtsLPlhf.mjs} +6 -5
- package/dist/{get-DDWpubE8.mjs → get-gZ5sQoS9.mjs} +7 -6
- package/dist/get-qXYTmiCW.mjs +40 -0
- package/dist/{has-remote-changes-DAL5jetW.mjs → has-remote-changes-BjdywTVP.mjs} +6 -5
- package/dist/{import-CUMxUfSF.mjs → import-CVOFq6HN.mjs} +7 -6
- package/dist/{input-BNqSFl38.mjs → input-DkgCMNA9.mjs} +1 -1
- package/dist/is-dirty-79hBpoVR.mjs +10 -0
- package/dist/{is-dirty-B10S6MG0.mjs → is-dirty-DgxNJz79.mjs} +3 -3
- package/dist/{key-CyhOpgWt.mjs → key-CpWh7W8M.mjs} +1 -1
- package/dist/{license-DtsGJi3l.mjs → license-B2eNHmdg.mjs} +3 -3
- package/dist/list-AcUuhDxS.mjs +47 -0
- package/dist/{list-DeFGwhhJ.mjs → list-B0durHcU.mjs} +5 -4
- package/dist/{list-qetY9OIN.mjs → list-B6LmdzL6.mjs} +5 -4
- package/dist/{list-Y7iGsOfE.mjs → list-B9ppD-U5.mjs} +5 -4
- package/dist/{list-evtQS7jl.mjs → list-CW20Zfq-.mjs} +5 -4
- package/dist/{list-C5MGydGU.mjs → list-Cw0Geehz.mjs} +5 -4
- package/dist/{list-B8s7Qnzk.mjs → list-DEW7ZHzy.mjs} +5 -4
- package/dist/{list-OBx5B3gd.mjs → list-bSb_Y5k9.mjs} +7 -6
- package/dist/{login-Dqw9ZtCx.mjs → login-ChQ9J6Ne.mjs} +6 -5
- package/dist/{logout-DwYJ5OUi.mjs → logout-Cit2O74l.mjs} +5 -4
- package/dist/{logs-B_lrY7Js.mjs → logs-Ca_YA7A6.mjs} +6 -5
- package/dist/{manifest-wzEFG0JB.mjs → manifest-IMg51yb7.mjs} +3 -7
- package/dist/{package-t8dKf4m_.mjs → package-CVNZnqz9.mjs} +6 -1
- package/dist/{parse-id-C1prc9US.mjs → parse-id-YyyUbzvS.mjs} +1 -1
- package/dist/{poll-D2sXM5rc.mjs → poll-CxWRi3iY.mjs} +2 -1
- package/dist/{poll-task-Byiunmaj.mjs → poll-task-DdXgrDJf.mjs} +2 -2
- package/dist/{prompt-fXeNtj0M.mjs → prompt-D8p00XDp.mjs} +1 -1
- package/dist/{provision-DC4_HWZD.mjs → provision-CV30W4mk.mjs} +12 -11
- package/dist/ps-B9-TFn7r.mjs +10 -0
- package/dist/{ps-BiOrecEe.mjs → ps-BR36xoRT.mjs} +3 -3
- package/dist/query-DmeLeLlh.mjs +93 -0
- package/dist/{query-BnGVGeM3.mjs → query-Dnlo_5UK.mjs} +6 -5
- package/dist/{remove-Bx48o-0S.mjs → remove-ChoQTtcC.mjs} +5 -4
- package/dist/{remove-DecoZzNd.mjs → remove-DfVVf1N9.mjs} +8 -7
- package/dist/{render-DlBijc5i.mjs → render-CZNR2MNK.mjs} +5 -2
- package/dist/{run-D4NgvaRh.mjs → run-BiXybcsl.mjs} +8 -7
- package/dist/{runtime-DUgFfYkN.mjs → runtime-DR8NwmQU.mjs} +7 -104
- package/dist/{search-4wKx5ug2.mjs → search-0cjOmsQu.mjs} +5 -4
- package/dist/{set-DCjrmTFm.mjs → set-BeVw7OX5.mjs} +8 -7
- package/dist/{set-BZnCRL4c.mjs → set-CLsmPD8_.mjs} +6 -5
- package/dist/{setting-C4vQSqer.mjs → setting-DEhllKkK.mjs} +3 -3
- package/dist/{setup-Dqh9hN6l.mjs → setup-BYL5Yagu.mjs} +7 -6
- package/dist/{start-xXQypG5L.mjs → start-BdAhhZYt.mjs} +9 -8
- package/dist/{stash-ZZkmW_V7.mjs → stash-Ca63-mCs.mjs} +7 -6
- package/dist/{status-9KAPIpX8.mjs → status-Bt6rZDLa.mjs} +4 -3
- package/dist/{status-JH6BZppo.mjs → status-D7Ihw-lN.mjs} +4 -3
- package/dist/{status-DezF-PIM.mjs → status-cZiC8-t_.mjs} +7 -6
- package/dist/{stop-br-ZOnve.mjs → stop-BDeCLqh0.mjs} +8 -7
- package/dist/sync-BZPts11d.mjs +26 -0
- package/dist/{table-BvAr2ixC.mjs → table-BbNgtqbd.mjs} +1 -1
- package/dist/{table-D-Mb5Nvw.mjs → table-CjnruP5H.mjs} +2 -2
- package/dist/transform-BXF9B-hF.mjs +21 -0
- package/dist/transform-job-DDsjt-4N.mjs +19 -0
- package/dist/{translate-DJxDVAE4.mjs → translate-oHz4-5o0.mjs} +8 -7
- package/dist/{update-DYVeVjk2.mjs → update-BqI8hYNO.mjs} +12 -11
- package/dist/update-CLXVmkyr.mjs +52 -0
- package/dist/{update-DxKlQ0hP.mjs → update-Dtu0CHTJ.mjs} +9 -8
- package/dist/update-WFBs9Nfq.mjs +55 -0
- package/dist/update-dashcard-BSf1-SfK.mjs +67 -0
- package/dist/{url-DP88YHNo.mjs → url-B0Bc70KV.mjs} +7 -6
- package/dist/validate-query-DE4UouY3.mjs +1521 -0
- package/dist/{wait-DwZN3ZwR.mjs → wait-DFI3pf6P.mjs} +2 -2
- package/dist/{wait-Cj_8wu4y.mjs → wait-Dkbfo1eS.mjs} +7 -6
- package/dist/{wait-flags-CjW4ogUJ.mjs → wait-flags-BIVgwvUI.mjs} +2 -2
- package/dist/workspace-Bv7qoaJi.mjs +24 -0
- package/dist/{workspace-credentials-q5RRFMT8.mjs → workspace-credentials-BxrU2xZb.mjs} +1 -1
- package/package.json +6 -1
- package/dist/card-D4zZSPUb.mjs +0 -19
- package/dist/create-CwVcoq0O.mjs +0 -43
- package/dist/create-_UOeEXAj.mjs +0 -39
- package/dist/is-dirty-CUuq-aB6.mjs +0 -9
- package/dist/ps-1bZKIwWh.mjs +0 -9
- package/dist/sync-C7VOWD00.mjs +0 -26
- package/dist/transform-CqxZwhGs.mjs +0 -21
- package/dist/transform-job-HjbqjEoP.mjs +0 -19
- package/dist/update-CDtm71m2.mjs +0 -50
- package/dist/workspace-CbwR0vX_.mjs +0 -24
- /package/dist/{body-flags-7oqLhu5j.mjs → body-flags-BK7J6Daz.mjs} +0 -0
- /package/dist/{card-C31pGtBZ.mjs → card-2XdaHHSS.mjs} +0 -0
- /package/dist/{database-BTX5qbSv.mjs → database-B9-7QAXE.mjs} +0 -0
- /package/dist/{field-QwBMAWsq.mjs → field-D_g4xvH9.mjs} +0 -0
- /package/dist/{setting-DM7pm7yh.mjs → setting-Bm84ixxW.mjs} +0 -0
- /package/dist/{transform-DfVkUttP.mjs → transform-CRRW0mFp.mjs} +0 -0
- /package/dist/{transform-job-DuB_OjhO.mjs → transform-job-BtCoVYsb.mjs} +0 -0
- /package/dist/{workspace-Dr9lWU3D.mjs → workspace-C3tGVQ6_.mjs} +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/domain/dashboard.ts
|
|
4
|
+
const DashboardWidth = z.enum(["fixed", "full"]);
|
|
5
|
+
const Dashcard = z.object({
|
|
6
|
+
id: z.number().int(),
|
|
7
|
+
dashboard_id: z.number().int(),
|
|
8
|
+
card_id: z.number().int().nullable(),
|
|
9
|
+
dashboard_tab_id: z.number().int().nullable(),
|
|
10
|
+
row: z.number().int(),
|
|
11
|
+
col: z.number().int(),
|
|
12
|
+
size_x: z.number().int(),
|
|
13
|
+
size_y: z.number().int(),
|
|
14
|
+
entity_id: z.string().nullable(),
|
|
15
|
+
visualization_settings: z.unknown(),
|
|
16
|
+
parameter_mappings: z.array(z.unknown()).nullable(),
|
|
17
|
+
inline_parameters: z.array(z.string()).nullable()
|
|
18
|
+
}).loose();
|
|
19
|
+
const DashcardCompact = Dashcard.pick({
|
|
20
|
+
id: true,
|
|
21
|
+
dashboard_id: true,
|
|
22
|
+
card_id: true,
|
|
23
|
+
dashboard_tab_id: true,
|
|
24
|
+
row: true,
|
|
25
|
+
col: true,
|
|
26
|
+
size_x: true,
|
|
27
|
+
size_y: true
|
|
28
|
+
}).strip();
|
|
29
|
+
const dashcardView = {
|
|
30
|
+
compactPick: DashcardCompact,
|
|
31
|
+
tableColumns: [
|
|
32
|
+
{
|
|
33
|
+
key: "id",
|
|
34
|
+
label: "ID"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
key: "card_id",
|
|
38
|
+
label: "Card"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
key: "dashboard_tab_id",
|
|
42
|
+
label: "Tab"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: "row",
|
|
46
|
+
label: "Row"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: "col",
|
|
50
|
+
label: "Col"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
key: "size_x",
|
|
54
|
+
label: "W"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
key: "size_y",
|
|
58
|
+
label: "H"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
};
|
|
62
|
+
const DashboardTab = z.object({
|
|
63
|
+
id: z.number().int(),
|
|
64
|
+
dashboard_id: z.number().int(),
|
|
65
|
+
name: z.string(),
|
|
66
|
+
position: z.number().int().optional(),
|
|
67
|
+
entity_id: z.string().nullable().optional()
|
|
68
|
+
}).loose();
|
|
69
|
+
const Dashboard = z.object({
|
|
70
|
+
id: z.number().int(),
|
|
71
|
+
name: z.string(),
|
|
72
|
+
description: z.string().nullable(),
|
|
73
|
+
archived: z.boolean(),
|
|
74
|
+
collection_id: z.number().int().nullable(),
|
|
75
|
+
creator_id: z.number().int(),
|
|
76
|
+
entity_id: z.string().nullable(),
|
|
77
|
+
width: DashboardWidth,
|
|
78
|
+
auto_apply_filters: z.boolean(),
|
|
79
|
+
enable_embedding: z.boolean(),
|
|
80
|
+
public_uuid: z.string().nullable(),
|
|
81
|
+
cache_ttl: z.number().int().nullable(),
|
|
82
|
+
parameters: z.array(z.unknown()).nullable(),
|
|
83
|
+
dashcards: z.array(Dashcard).optional(),
|
|
84
|
+
tabs: z.array(DashboardTab).optional()
|
|
85
|
+
}).loose();
|
|
86
|
+
const DashboardDetail = Dashboard.extend({
|
|
87
|
+
dashcards: z.array(Dashcard),
|
|
88
|
+
tabs: z.array(DashboardTab)
|
|
89
|
+
});
|
|
90
|
+
const DashboardCompact = Dashboard.pick({
|
|
91
|
+
id: true,
|
|
92
|
+
name: true,
|
|
93
|
+
description: true,
|
|
94
|
+
archived: true,
|
|
95
|
+
collection_id: true
|
|
96
|
+
}).strip();
|
|
97
|
+
const dashboardView = {
|
|
98
|
+
compactPick: DashboardCompact,
|
|
99
|
+
tableColumns: [
|
|
100
|
+
{
|
|
101
|
+
key: "id",
|
|
102
|
+
label: "ID"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
key: "name",
|
|
106
|
+
label: "Name"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
key: "collection_id",
|
|
110
|
+
label: "Collection"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
key: "archived",
|
|
114
|
+
label: "Archived"
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
};
|
|
118
|
+
const DashboardCreateInput = z.object({
|
|
119
|
+
name: z.string().min(1),
|
|
120
|
+
description: z.string().nullable().optional(),
|
|
121
|
+
parameters: z.array(z.unknown()).optional(),
|
|
122
|
+
cache_ttl: z.number().int().positive().optional(),
|
|
123
|
+
collection_id: z.number().int().positive().nullable().optional(),
|
|
124
|
+
collection_position: z.number().int().positive().nullable().optional()
|
|
125
|
+
}).loose();
|
|
126
|
+
const DashboardUpdateInput = z.object({
|
|
127
|
+
name: z.string().min(1).optional(),
|
|
128
|
+
description: z.string().nullable().optional(),
|
|
129
|
+
archived: z.boolean().optional(),
|
|
130
|
+
width: DashboardWidth.optional(),
|
|
131
|
+
enable_embedding: z.boolean().optional(),
|
|
132
|
+
embedding_params: z.unknown().optional(),
|
|
133
|
+
parameters: z.array(z.unknown()).optional(),
|
|
134
|
+
cache_ttl: z.number().int().positive().nullable().optional(),
|
|
135
|
+
collection_id: z.number().int().positive().nullable().optional(),
|
|
136
|
+
collection_position: z.number().int().positive().nullable().optional(),
|
|
137
|
+
dashcards: z.array(z.unknown()).optional(),
|
|
138
|
+
tabs: z.array(DashboardTab.partial()).optional()
|
|
139
|
+
}).loose();
|
|
140
|
+
const DashcardPatchInput = z.object({
|
|
141
|
+
row: z.number().int().nonnegative().optional(),
|
|
142
|
+
col: z.number().int().nonnegative().optional(),
|
|
143
|
+
size_x: z.number().int().positive().optional(),
|
|
144
|
+
size_y: z.number().int().positive().optional(),
|
|
145
|
+
dashboard_tab_id: z.number().int().nullable().optional(),
|
|
146
|
+
parameter_mappings: z.array(z.unknown()).optional(),
|
|
147
|
+
inline_parameters: z.array(z.string()).optional(),
|
|
148
|
+
visualization_settings: z.unknown().optional()
|
|
149
|
+
}).strict().refine((value) => Object.keys(value).length > 0, { message: "patch must contain at least one field" });
|
|
150
|
+
|
|
151
|
+
//#endregion
|
|
152
|
+
export { Dashboard, DashboardCompact, DashboardCreateInput, DashboardDetail, DashboardUpdateInput, Dashcard, DashcardCompact, DashcardPatchInput, dashboardView, dashcardView };
|
|
@@ -7,9 +7,9 @@ var database_default = defineCommand({
|
|
|
7
7
|
description: "Manage databases provisioned to a workspace"
|
|
8
8
|
},
|
|
9
9
|
subCommands: {
|
|
10
|
-
provision: () => import("./provision-
|
|
11
|
-
update: () => import("./update-
|
|
12
|
-
deprovision: () => import("./deprovision-
|
|
10
|
+
provision: () => import("./provision-CV30W4mk.mjs").then((mod) => mod.default),
|
|
11
|
+
update: () => import("./update-BqI8hYNO.mjs").then((mod) => mod.default),
|
|
12
|
+
deprovision: () => import("./deprovision-Cay-ixJs.mjs").then((mod) => mod.default)
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -8,8 +8,8 @@ var db_default = defineCommand({
|
|
|
8
8
|
alias: "database"
|
|
9
9
|
},
|
|
10
10
|
subCommands: {
|
|
11
|
-
list: () => import("./list-
|
|
12
|
-
get: () => import("./get-
|
|
11
|
+
list: () => import("./list-CW20Zfq-.mjs").then((m) => m.default),
|
|
12
|
+
get: () => import("./get-B6PHgITW.mjs").then((m) => m.default)
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
3
|
+
import "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import "./prompt-D8p00XDp.mjs";
|
|
8
|
+
import { DeleteResult, confirmAndDelete } from "./delete-runtime-ZDxlvZa6.mjs";
|
|
8
9
|
|
|
9
10
|
//#region src/commands/transform/delete.ts
|
|
10
11
|
var delete_default = defineMetabaseCommand({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
3
|
+
import "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import "./prompt-D8p00XDp.mjs";
|
|
8
|
+
import { DeleteResult, confirmAndDelete } from "./delete-runtime-ZDxlvZa6.mjs";
|
|
8
9
|
|
|
9
10
|
//#region src/commands/transform-job/delete.ts
|
|
10
11
|
var delete_default = defineMetabaseCommand({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { renderItem } from "./render-
|
|
2
|
-
import { ConfigError } from "./
|
|
3
|
-
import { promptConfirm } from "./prompt-
|
|
1
|
+
import { renderItem } from "./render-CZNR2MNK.mjs";
|
|
2
|
+
import { ConfigError } from "./errors-C6w1eZ1F.mjs";
|
|
3
|
+
import { promptConfirm } from "./prompt-D8p00XDp.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/commands/delete-runtime.ts
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
3
|
+
import "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import "./prompt-D8p00XDp.mjs";
|
|
8
|
+
import { DeleteResult, confirmAndDelete } from "./delete-runtime-ZDxlvZa6.mjs";
|
|
8
9
|
|
|
9
10
|
//#region src/commands/transform/delete-table.ts
|
|
10
11
|
var delete_table_default = defineMetabaseCommand({
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import "./
|
|
11
|
-
import
|
|
3
|
+
import "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import "./prompt-D8p00XDp.mjs";
|
|
8
|
+
import "./poll-CxWRi3iY.mjs";
|
|
9
|
+
import { DeleteResult, confirmAndDelete } from "./delete-runtime-ZDxlvZa6.mjs";
|
|
10
|
+
import { parseWaitFlags, waitFlags } from "./wait-flags-BIVgwvUI.mjs";
|
|
11
|
+
import "./workspace-C3tGVQ6_.mjs";
|
|
12
|
+
import { waitForDatabaseGone } from "./wait-DFI3pf6P.mjs";
|
|
12
13
|
|
|
13
14
|
//#region src/commands/workspace/database/deprovision.ts
|
|
14
15
|
var deprovision_default = defineMetabaseCommand({
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderList } from "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./poll-
|
|
3
|
+
import { renderList } from "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { REMOTE_SYNC_PATHS, SyncDirtyItem, SyncDirtyItemCompact, syncDirtyItemView } from "./poll-task-DdXgrDJf.mjs";
|
|
7
|
+
import "./poll-CxWRi3iY.mjs";
|
|
7
8
|
import { z } from "zod";
|
|
8
9
|
|
|
9
10
|
//#region src/commands/sync/dirty.ts
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { ConfigError, errorMessage, isNotFoundError
|
|
2
|
-
import {
|
|
1
|
+
import { ConfigError, errorMessage, isNotFoundError } from "./errors-C6w1eZ1F.mjs";
|
|
2
|
+
import { parseJson } from "./runtime-DR8NwmQU.mjs";
|
|
3
|
+
import { pollUntil } from "./poll-CxWRi3iY.mjs";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { spawn } from "node:child_process";
|
|
5
6
|
|
|
@@ -6,7 +6,7 @@ var eid_default = defineCommand({
|
|
|
6
6
|
name: "eid",
|
|
7
7
|
description: "Translate Metabase entity ids (string EIDs) to numeric ids"
|
|
8
8
|
},
|
|
9
|
-
subCommands: { translate: () => import("./translate-
|
|
9
|
+
subCommands: { translate: () => import("./translate-oHz4-5o0.mjs").then((mod) => mod.default) }
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { ZodError } from "zod";
|
|
2
|
+
import { isCancel } from "@clack/prompts";
|
|
3
|
+
|
|
4
|
+
//#region src/core/errors.ts
|
|
5
|
+
var MetabaseError = class extends Error {
|
|
6
|
+
get userMessage() {
|
|
7
|
+
return this.message;
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var NetworkError = class extends MetabaseError {
|
|
11
|
+
category = "network";
|
|
12
|
+
isRetryable = true;
|
|
13
|
+
exitCode = 1;
|
|
14
|
+
developerDetail;
|
|
15
|
+
constructor(message, developerDetail) {
|
|
16
|
+
super(message);
|
|
17
|
+
this.name = "NetworkError";
|
|
18
|
+
this.developerDetail = developerDetail;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var TimeoutError = class extends MetabaseError {
|
|
22
|
+
category = "timeout";
|
|
23
|
+
isRetryable = true;
|
|
24
|
+
exitCode = 1;
|
|
25
|
+
developerDetail;
|
|
26
|
+
constructor(message, developerDetail) {
|
|
27
|
+
super(message);
|
|
28
|
+
this.name = "TimeoutError";
|
|
29
|
+
this.developerDetail = developerDetail;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
var ValidationError = class extends MetabaseError {
|
|
33
|
+
category = "validation";
|
|
34
|
+
isRetryable = false;
|
|
35
|
+
exitCode = 1;
|
|
36
|
+
developerDetail;
|
|
37
|
+
constructor(message, developerDetail) {
|
|
38
|
+
super(message);
|
|
39
|
+
this.name = "ValidationError";
|
|
40
|
+
this.developerDetail = developerDetail;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
var ConfigError = class extends MetabaseError {
|
|
44
|
+
category = "config";
|
|
45
|
+
isRetryable = false;
|
|
46
|
+
exitCode = 2;
|
|
47
|
+
developerDetail = null;
|
|
48
|
+
constructor(message) {
|
|
49
|
+
super(message);
|
|
50
|
+
this.name = "ConfigError";
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var AbortError = class extends MetabaseError {
|
|
54
|
+
category = "abort";
|
|
55
|
+
isRetryable = false;
|
|
56
|
+
exitCode = 130;
|
|
57
|
+
developerDetail = null;
|
|
58
|
+
constructor(message = "aborted") {
|
|
59
|
+
super(message);
|
|
60
|
+
this.name = "AbortError";
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
var UnknownError = class extends MetabaseError {
|
|
64
|
+
category = "unknown";
|
|
65
|
+
isRetryable = false;
|
|
66
|
+
exitCode = 1;
|
|
67
|
+
developerDetail;
|
|
68
|
+
constructor(input) {
|
|
69
|
+
super(input.originalMessage);
|
|
70
|
+
this.name = "UnknownError";
|
|
71
|
+
this.developerDetail = input;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
function toMetabaseError(error) {
|
|
75
|
+
if (error instanceof MetabaseError) return error;
|
|
76
|
+
if (isCancel(error)) return new AbortError();
|
|
77
|
+
if (error instanceof ZodError) return new ConfigError(formatZodError(error));
|
|
78
|
+
if (error instanceof Error) return new UnknownError({
|
|
79
|
+
originalMessage: error.message,
|
|
80
|
+
stack: error.stack ?? null
|
|
81
|
+
});
|
|
82
|
+
return new UnknownError({
|
|
83
|
+
originalMessage: String(error),
|
|
84
|
+
stack: null
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function formatZodError(error) {
|
|
88
|
+
return error.issues.map((issue) => {
|
|
89
|
+
const path = issue.path.join(".");
|
|
90
|
+
return path ? `${path}: ${issue.message}` : issue.message;
|
|
91
|
+
}).join("; ");
|
|
92
|
+
}
|
|
93
|
+
function isNotFoundError(value) {
|
|
94
|
+
return value instanceof Error && "code" in value && value.code === "ENOENT";
|
|
95
|
+
}
|
|
96
|
+
function errorMessage(value) {
|
|
97
|
+
return value instanceof Error ? value.message : String(value);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
//#endregion
|
|
101
|
+
export { AbortError, ConfigError, MetabaseError, NetworkError, TimeoutError, ValidationError, errorMessage, isNotFoundError, toMetabaseError };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "./poll-
|
|
3
|
+
import { renderItem } from "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import { REMOTE_SYNC_PATHS, SyncTask, pollFlags, pollSyncTask, throwIfFailedTask } from "./poll-task-DdXgrDJf.mjs";
|
|
8
|
+
import "./poll-CxWRi3iY.mjs";
|
|
8
9
|
import { z } from "zod";
|
|
9
10
|
|
|
10
11
|
//#region src/commands/sync/export.ts
|
|
@@ -6,7 +6,7 @@ var field_default = defineCommand({
|
|
|
6
6
|
name: "field",
|
|
7
7
|
description: "Inspect Metabase fields"
|
|
8
8
|
},
|
|
9
|
-
subCommands: { get: () => import("./get-
|
|
9
|
+
subCommands: { get: () => import("./get-Bc0yqaS1.mjs").then((m) => m.default) }
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
//#endregion
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { renderItem } from "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import { Card, cardView } from "./card-2XdaHHSS.mjs";
|
|
7
8
|
|
|
8
9
|
//#region src/commands/card/get.ts
|
|
9
10
|
var get_default = defineMetabaseCommand({
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { renderItem } from "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import { Database, databaseView } from "./database-B9-7QAXE.mjs";
|
|
7
8
|
|
|
8
9
|
//#region src/commands/db/get.ts
|
|
9
10
|
var get_default = defineMetabaseCommand({
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { renderItem } from "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import { Field, fieldView } from "./field-D_g4xvH9.mjs";
|
|
7
8
|
|
|
8
9
|
//#region src/commands/field/get.ts
|
|
9
10
|
var get_default = defineMetabaseCommand({
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { renderItem } from "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, parseJson, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { SettingValue, settingValueView } from "./setting-Bm84ixxW.mjs";
|
|
7
|
+
import { parseSettingKey } from "./key-CpWh7W8M.mjs";
|
|
7
8
|
import { z } from "zod";
|
|
8
9
|
|
|
9
10
|
//#region src/commands/setting/get.ts
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { renderItem } from "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import { TransformJob, transformJobView } from "./transform-job-BtCoVYsb.mjs";
|
|
7
8
|
|
|
8
9
|
//#region src/commands/transform-job/get.ts
|
|
9
10
|
var get_default = defineMetabaseCommand({
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { renderItem } from "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import { Transform, transformView } from "./transform-CRRW0mFp.mjs";
|
|
7
8
|
|
|
8
9
|
//#region src/commands/transform/get.ts
|
|
9
10
|
var get_default = defineMetabaseCommand({
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
3
|
+
import { renderItem } from "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import "./field-D_g4xvH9.mjs";
|
|
8
|
+
import { Table, tableView } from "./table-BbNgtqbd.mjs";
|
|
8
9
|
|
|
9
10
|
//#region src/commands/table/get.ts
|
|
10
11
|
var get_default = defineMetabaseCommand({
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { renderItem } from "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-YyyUbzvS.mjs";
|
|
7
|
+
import { DashboardDetail, dashboardView } from "./dashboard-DVCLGg3X.mjs";
|
|
8
|
+
|
|
9
|
+
//#region src/commands/dashboard/get.ts
|
|
10
|
+
var get_default = defineMetabaseCommand({
|
|
11
|
+
meta: {
|
|
12
|
+
name: "get",
|
|
13
|
+
description: "Get a dashboard by id"
|
|
14
|
+
},
|
|
15
|
+
args: {
|
|
16
|
+
...outputFlags,
|
|
17
|
+
...profileFlag,
|
|
18
|
+
...connectionFlags,
|
|
19
|
+
id: {
|
|
20
|
+
type: "positional",
|
|
21
|
+
description: "Dashboard id",
|
|
22
|
+
required: true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
outputSchema: DashboardDetail,
|
|
26
|
+
examples: [
|
|
27
|
+
"metabase dashboard get 1",
|
|
28
|
+
"metabase dashboard get 1 --json",
|
|
29
|
+
"metabase dashboard get 1 --json --full"
|
|
30
|
+
],
|
|
31
|
+
async run({ args, ctx, getClient }) {
|
|
32
|
+
const id = parseId(args.id);
|
|
33
|
+
const client = await getClient();
|
|
34
|
+
const dashboard = await client.requestParsed(DashboardDetail, `/api/dashboard/${id}`);
|
|
35
|
+
renderItem(dashboard, dashboardView, ctx);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
//#endregion
|
|
40
|
+
export { get_default as default };
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-CVNZnqz9.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./poll-
|
|
3
|
+
import { renderItem } from "./render-CZNR2MNK.mjs";
|
|
4
|
+
import "./errors-C6w1eZ1F.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DR8NwmQU.mjs";
|
|
6
|
+
import { REMOTE_SYNC_PATHS } from "./poll-task-DdXgrDJf.mjs";
|
|
7
|
+
import "./poll-CxWRi3iY.mjs";
|
|
7
8
|
import { z } from "zod";
|
|
8
9
|
|
|
9
10
|
//#region src/commands/sync/has-remote-changes.ts
|