@base44-preview/cli 0.1.4-pr.567.1086443 → 0.1.4-pr.567.1d0df8b
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/dist/cli/index.js +13 -46
- package/dist/cli/index.js.map +6 -7
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -251572,10 +251572,6 @@ async function listWorkspaces() {
|
|
|
251572
251572
|
isPersonal: index === 0
|
|
251573
251573
|
}));
|
|
251574
251574
|
}
|
|
251575
|
-
async function getWorkspace(id) {
|
|
251576
|
-
const workspaces = await listWorkspaces();
|
|
251577
|
-
return workspaces.find((w) => w.id === id);
|
|
251578
|
-
}
|
|
251579
251575
|
async function moveAppToWorkspace(appId, targetWorkspaceId, options = {}) {
|
|
251580
251576
|
let response;
|
|
251581
251577
|
try {
|
|
@@ -254785,47 +254781,16 @@ function workspaceTag(workspace2) {
|
|
|
254785
254781
|
return workspace2.isPersonal ? `personal, ${role}` : role;
|
|
254786
254782
|
}
|
|
254787
254783
|
|
|
254788
|
-
// src/cli/commands/workspace/get.ts
|
|
254789
|
-
async function getWorkspaceAction({ runTask: runTask2, log, jsonMode }, workspaceId) {
|
|
254790
|
-
const workspace2 = await runTask2("Fetching workspace...", () => getWorkspace(workspaceId), { errorMessage: "Failed to fetch workspace" });
|
|
254791
|
-
if (!workspace2) {
|
|
254792
|
-
throw new InvalidInputError(`Workspace "${workspaceId}" not found, or you are not a member of it.`, {
|
|
254793
|
-
hints: [
|
|
254794
|
-
{ message: "Run 'base44 workspace list' to see your workspaces" }
|
|
254795
|
-
]
|
|
254796
|
-
});
|
|
254797
|
-
}
|
|
254798
|
-
if (jsonMode) {
|
|
254799
|
-
return {
|
|
254800
|
-
outroMessage: workspace2.name,
|
|
254801
|
-
stdout: toJsonStdout2(workspace2)
|
|
254802
|
-
};
|
|
254803
|
-
}
|
|
254804
|
-
log.message(` ${theme.styles.bold(workspace2.name)} ${theme.styles.dim(`[${workspaceTag(workspace2)}]`)}
|
|
254805
|
-
${theme.styles.dim(workspace2.id)}${workspace2.subscriptionTier ? theme.styles.dim(`
|
|
254806
|
-
tier: ${workspace2.subscriptionTier}`) : ""}`);
|
|
254807
|
-
return { outroMessage: workspace2.name };
|
|
254808
|
-
}
|
|
254809
|
-
function getWorkspaceGetCommand() {
|
|
254810
|
-
return new Base44Command("get", { requireAppContext: false }).description("Show details for a single workspace by ID").argument("<workspace-id>", "Workspace (organization) ID").action(getWorkspaceAction);
|
|
254811
|
-
}
|
|
254812
|
-
|
|
254813
254784
|
// src/cli/commands/workspace/list.ts
|
|
254814
|
-
function
|
|
254815
|
-
|
|
254816
|
-
|
|
254817
|
-
|
|
254818
|
-
|
|
254819
|
-
|
|
254820
|
-
workspaces = workspaces.filter((w8) => canCreateAppsInWorkspace(w8.userRole));
|
|
254821
|
-
}
|
|
254822
|
-
if (options8.role) {
|
|
254823
|
-
const role = options8.role.toLowerCase();
|
|
254824
|
-
workspaces = workspaces.filter((w8) => w8.userRole?.toLowerCase() === role);
|
|
254825
|
-
}
|
|
254785
|
+
async function listWorkspacesAction({
|
|
254786
|
+
log,
|
|
254787
|
+
runTask: runTask2,
|
|
254788
|
+
jsonMode
|
|
254789
|
+
}) {
|
|
254790
|
+
const workspaces = await runTask2("Fetching workspaces...", () => listWorkspaces(), { errorMessage: "Failed to fetch workspaces" });
|
|
254826
254791
|
if (jsonMode) {
|
|
254827
254792
|
return {
|
|
254828
|
-
outroMessage:
|
|
254793
|
+
outroMessage: `${workspaces.length} workspace${workspaces.length !== 1 ? "s" : ""}`,
|
|
254829
254794
|
stdout: toJsonStdout2(workspaces)
|
|
254830
254795
|
};
|
|
254831
254796
|
}
|
|
@@ -254833,10 +254798,12 @@ async function listWorkspacesAction({ log, runTask: runTask2, jsonMode }, option
|
|
|
254833
254798
|
log.message(` ${theme.styles.bold(workspace2.name)} ${theme.styles.dim(`[${workspaceTag(workspace2)}]`)}
|
|
254834
254799
|
${theme.styles.dim(workspace2.id)}`);
|
|
254835
254800
|
}
|
|
254836
|
-
return {
|
|
254801
|
+
return {
|
|
254802
|
+
outroMessage: `${workspaces.length} workspace${workspaces.length !== 1 ? "s" : ""}`
|
|
254803
|
+
};
|
|
254837
254804
|
}
|
|
254838
254805
|
function getWorkspaceListCommand() {
|
|
254839
|
-
return new Base44Command("list", { requireAppContext: false }).description("List the workspaces you belong to").
|
|
254806
|
+
return new Base44Command("list", { requireAppContext: false }).description("List the workspaces you belong to").action(listWorkspacesAction);
|
|
254840
254807
|
}
|
|
254841
254808
|
|
|
254842
254809
|
// src/cli/commands/workspace/move.ts
|
|
@@ -254932,7 +254899,7 @@ Examples:
|
|
|
254932
254899
|
|
|
254933
254900
|
// src/cli/commands/workspace/index.ts
|
|
254934
254901
|
function getWorkspaceCommand() {
|
|
254935
|
-
return new Command("workspace").description("List workspaces
|
|
254902
|
+
return new Command("workspace").description("List workspaces and move apps between them").addCommand(getWorkspaceListCommand()).addCommand(getWorkspaceMoveCommand());
|
|
254936
254903
|
}
|
|
254937
254904
|
|
|
254938
254905
|
// src/cli/dev/dev-server/main.ts
|
|
@@ -262965,4 +262932,4 @@ export {
|
|
|
262965
262932
|
CLIExitError
|
|
262966
262933
|
};
|
|
262967
262934
|
|
|
262968
|
-
//# debugId=
|
|
262935
|
+
//# debugId=411CA34C835D36D464756E2164756E21
|