@base44-preview/cli 0.1.3-pr.567.b7c491a → 0.1.4-pr.567.1086443
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 +59 -15
- package/dist/cli/index.js.map +9 -8
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -242260,10 +242260,21 @@ async function getAuthConfig() {
|
|
|
242260
242260
|
}
|
|
242261
242261
|
async function pushAuthConfigToApi(config4) {
|
|
242262
242262
|
const { id } = getAppContext();
|
|
242263
|
+
const payload = toAuthConfigPayload(config4);
|
|
242264
|
+
if (hasWorkspaceApiKeyAuth()) {
|
|
242265
|
+
try {
|
|
242266
|
+
await base44Client.put(`api/apps/${id}/deployment/auth-configuration`, {
|
|
242267
|
+
json: payload
|
|
242268
|
+
});
|
|
242269
|
+
} catch (error48) {
|
|
242270
|
+
throw await ApiError.fromHttpError(error48, "updating auth config");
|
|
242271
|
+
}
|
|
242272
|
+
return config4;
|
|
242273
|
+
}
|
|
242263
242274
|
let response;
|
|
242264
242275
|
try {
|
|
242265
242276
|
response = await base44Client.put(`api/apps/${id}`, {
|
|
242266
|
-
json: { auth_config:
|
|
242277
|
+
json: { auth_config: payload }
|
|
242267
242278
|
});
|
|
242268
242279
|
} catch (error48) {
|
|
242269
242280
|
throw await ApiError.fromHttpError(error48, "updating auth config");
|
|
@@ -244000,7 +244011,7 @@ import { join as join11 } from "node:path";
|
|
|
244000
244011
|
// package.json
|
|
244001
244012
|
var package_default = {
|
|
244002
244013
|
name: "base44",
|
|
244003
|
-
version: "0.1.
|
|
244014
|
+
version: "0.1.4",
|
|
244004
244015
|
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
244005
244016
|
type: "module",
|
|
244006
244017
|
bin: {
|
|
@@ -251561,6 +251572,10 @@ async function listWorkspaces() {
|
|
|
251561
251572
|
isPersonal: index === 0
|
|
251562
251573
|
}));
|
|
251563
251574
|
}
|
|
251575
|
+
async function getWorkspace(id) {
|
|
251576
|
+
const workspaces = await listWorkspaces();
|
|
251577
|
+
return workspaces.find((w) => w.id === id);
|
|
251578
|
+
}
|
|
251564
251579
|
async function moveAppToWorkspace(appId, targetWorkspaceId, options = {}) {
|
|
251565
251580
|
let response;
|
|
251566
251581
|
try {
|
|
@@ -254770,16 +254785,47 @@ function workspaceTag(workspace2) {
|
|
|
254770
254785
|
return workspace2.isPersonal ? `personal, ${role}` : role;
|
|
254771
254786
|
}
|
|
254772
254787
|
|
|
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
|
+
|
|
254773
254813
|
// src/cli/commands/workspace/list.ts
|
|
254774
|
-
|
|
254775
|
-
|
|
254776
|
-
|
|
254777
|
-
|
|
254778
|
-
|
|
254779
|
-
|
|
254814
|
+
function pluralize2(n5) {
|
|
254815
|
+
return `${n5} workspace${n5 !== 1 ? "s" : ""}`;
|
|
254816
|
+
}
|
|
254817
|
+
async function listWorkspacesAction({ log, runTask: runTask2, jsonMode }, options8) {
|
|
254818
|
+
let workspaces = await runTask2("Fetching workspaces...", () => listWorkspaces(), { errorMessage: "Failed to fetch workspaces" });
|
|
254819
|
+
if (options8.canCreate) {
|
|
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
|
+
}
|
|
254780
254826
|
if (jsonMode) {
|
|
254781
254827
|
return {
|
|
254782
|
-
outroMessage:
|
|
254828
|
+
outroMessage: pluralize2(workspaces.length),
|
|
254783
254829
|
stdout: toJsonStdout2(workspaces)
|
|
254784
254830
|
};
|
|
254785
254831
|
}
|
|
@@ -254787,12 +254833,10 @@ async function listWorkspacesAction({
|
|
|
254787
254833
|
log.message(` ${theme.styles.bold(workspace2.name)} ${theme.styles.dim(`[${workspaceTag(workspace2)}]`)}
|
|
254788
254834
|
${theme.styles.dim(workspace2.id)}`);
|
|
254789
254835
|
}
|
|
254790
|
-
return {
|
|
254791
|
-
outroMessage: `${workspaces.length} workspace${workspaces.length !== 1 ? "s" : ""}`
|
|
254792
|
-
};
|
|
254836
|
+
return { outroMessage: pluralize2(workspaces.length) };
|
|
254793
254837
|
}
|
|
254794
254838
|
function getWorkspaceListCommand() {
|
|
254795
|
-
return new Base44Command("list", { requireAppContext: false }).description("List the workspaces you belong to").action(listWorkspacesAction);
|
|
254839
|
+
return new Base44Command("list", { requireAppContext: false }).description("List the workspaces you belong to").option("--can-create", "Only workspaces you can create or move apps into (owner/admin/editor)").option("--role <role>", "Only workspaces where your role matches (owner, admin, editor, viewer)").action(listWorkspacesAction);
|
|
254796
254840
|
}
|
|
254797
254841
|
|
|
254798
254842
|
// src/cli/commands/workspace/move.ts
|
|
@@ -254888,7 +254932,7 @@ Examples:
|
|
|
254888
254932
|
|
|
254889
254933
|
// src/cli/commands/workspace/index.ts
|
|
254890
254934
|
function getWorkspaceCommand() {
|
|
254891
|
-
return new Command("workspace").description("List workspaces and move apps between them").addCommand(getWorkspaceListCommand()).addCommand(getWorkspaceMoveCommand());
|
|
254935
|
+
return new Command("workspace").description("List workspaces, inspect one, and move apps between them").addCommand(getWorkspaceListCommand()).addCommand(getWorkspaceGetCommand()).addCommand(getWorkspaceMoveCommand());
|
|
254892
254936
|
}
|
|
254893
254937
|
|
|
254894
254938
|
// src/cli/dev/dev-server/main.ts
|
|
@@ -262921,4 +262965,4 @@ export {
|
|
|
262921
262965
|
CLIExitError
|
|
262922
262966
|
};
|
|
262923
262967
|
|
|
262924
|
-
//# debugId=
|
|
262968
|
+
//# debugId=B9D4F09248278B0364756E2164756E21
|