@base44-preview/cli 0.0.15-pr.99.05b68cd → 0.0.15-pr.99.76064e9

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.
Files changed (2) hide show
  1. package/dist/cli/index.js +51 -31
  2. package/package.json +1 -1
package/dist/cli/index.js CHANGED
@@ -38971,19 +38971,6 @@ async function disconnectConnector(integrationType) {
38971
38971
  throw new ConnectorApiError(`Failed to disconnect connector: ${response.status} ${response.statusText}`);
38972
38972
  }
38973
38973
  }
38974
- /**
38975
- * Removes (hard delete) a connector integration.
38976
- * This permanently removes the connector and cannot be undone.
38977
- */
38978
- async function removeConnector(integrationType) {
38979
- const response = await getAppClient().delete(`external-auth/integrations/${integrationType}/remove`, { throwHttpErrors: false });
38980
- if (!response.ok) {
38981
- const json = await response.json();
38982
- const errorResult = ApiErrorSchema.safeParse(json);
38983
- if (errorResult.success) throw new ConnectorApiError(errorResult.data.error);
38984
- throw new ConnectorApiError(`Failed to remove connector: ${response.status} ${response.statusText}`);
38985
- }
38986
- }
38987
38974
 
38988
38975
  //#endregion
38989
38976
  //#region src/core/connectors/constants.ts
@@ -39124,11 +39111,24 @@ const connectorsAddCommand = new Command("connectors:add").argument("[type]", "I
39124
39111
 
39125
39112
  //#endregion
39126
39113
  //#region src/cli/commands/connectors/list.ts
39127
- function formatConnectorLine(connector) {
39128
- const name$1 = getIntegrationDisplayName(connector.integrationType);
39129
- const account = connector.accountInfo?.email || connector.accountInfo?.name;
39130
- const status = connector.status.toLowerCase();
39131
- return `${status === "active" ? theme.colors.success("●") : theme.colors.error("")} ${name$1}${account ? ` - ${account}` : ""}${status !== "active" ? theme.styles.dim(` (${status})`) : ""}`;
39114
+ function formatDate(dateString) {
39115
+ if (!dateString) return "-";
39116
+ try {
39117
+ return new Date(dateString).toLocaleDateString("en-US", {
39118
+ year: "numeric",
39119
+ month: "short",
39120
+ day: "numeric"
39121
+ });
39122
+ } catch {
39123
+ return dateString;
39124
+ }
39125
+ }
39126
+ function formatStatus(status) {
39127
+ const normalized = status.toLowerCase();
39128
+ if (normalized === "active" || normalized === "connected") return theme.colors.success("● active");
39129
+ if (normalized === "expired") return theme.colors.warning("● expired");
39130
+ if (normalized === "failed" || normalized === "disconnected") return theme.colors.error("● disconnected");
39131
+ return status;
39132
39132
  }
39133
39133
  async function listConnectorsCommand() {
39134
39134
  const connectors = await runTask("Fetching connectors...", async () => {
@@ -39143,7 +39143,30 @@ async function listConnectorsCommand() {
39143
39143
  return { outroMessage: "" };
39144
39144
  }
39145
39145
  console.log();
39146
- for (const connector of connectors) console.log(formatConnectorLine(connector));
39146
+ console.log(theme.styles.bold("Connected Integrations:"));
39147
+ console.log();
39148
+ const headers = [
39149
+ "Type",
39150
+ "Account",
39151
+ "Status",
39152
+ "Connected"
39153
+ ];
39154
+ const colWidths = [
39155
+ 20,
39156
+ 30,
39157
+ 15,
39158
+ 15
39159
+ ];
39160
+ const headerRow = headers.map((h$2, i$1) => h$2.padEnd(colWidths[i$1])).join(" ");
39161
+ console.log(theme.styles.dim(headerRow));
39162
+ console.log(theme.styles.dim("─".repeat(headerRow.length)));
39163
+ for (const connector of connectors) {
39164
+ const type = getIntegrationDisplayName(connector.integrationType).padEnd(colWidths[0]);
39165
+ const account = (connector.accountInfo?.email || connector.accountInfo?.name || "-").padEnd(colWidths[1]);
39166
+ const status = formatStatus(connector.status);
39167
+ const connected = formatDate(connector.connectedAt).padEnd(colWidths[3]);
39168
+ console.log(`${type} ${account} ${status.padEnd(colWidths[2] + 10)} ${connected}`);
39169
+ }
39147
39170
  console.log();
39148
39171
  return { outroMessage: `${connectors.length} connector${connectors.length === 1 ? "" : "s"} configured` };
39149
39172
  }
@@ -39167,8 +39190,7 @@ async function promptForConnectorToRemove(connectors) {
39167
39190
  if (pD(selected)) return null;
39168
39191
  return selected;
39169
39192
  }
39170
- async function removeConnectorCommand(integrationType, options = {}) {
39171
- const isHardDelete = options.hard === true;
39193
+ async function removeConnectorCommand(integrationType) {
39172
39194
  const connectors = await runTask("Fetching connectors...", async () => {
39173
39195
  return await listConnectors();
39174
39196
  }, {
@@ -39188,23 +39210,21 @@ async function removeConnectorCommand(integrationType, options = {}) {
39188
39210
  }
39189
39211
  const displayName = getIntegrationDisplayName(selectedType);
39190
39212
  const connector = connectors.find((c$1) => c$1.integrationType === selectedType);
39191
- const accountInfo = connector?.accountInfo?.email ? ` (${connector.accountInfo.email})` : "";
39192
39213
  const shouldRemove = await ye({
39193
- message: `${isHardDelete ? "Permanently remove" : "Disconnect"} ${displayName}${accountInfo}?`,
39214
+ message: `Disconnect ${displayName}${connector?.accountInfo?.email ? ` (${connector.accountInfo.email})` : ""}?`,
39194
39215
  initialValue: false
39195
39216
  });
39196
39217
  if (pD(shouldRemove) || !shouldRemove) return { outroMessage: "Cancelled" };
39197
- await runTask(isHardDelete ? `Removing ${displayName}...` : `Disconnecting ${displayName}...`, async () => {
39198
- if (isHardDelete) await removeConnector(selectedType);
39199
- else await disconnectConnector(selectedType);
39218
+ await runTask(`Disconnecting ${displayName}...`, async () => {
39219
+ await disconnectConnector(selectedType);
39200
39220
  }, {
39201
- successMessage: isHardDelete ? `${displayName} removed` : `${displayName} disconnected`,
39202
- errorMessage: isHardDelete ? `Failed to remove ${displayName}` : `Failed to disconnect ${displayName}`
39221
+ successMessage: `${displayName} disconnected`,
39222
+ errorMessage: `Failed to disconnect ${displayName}`
39203
39223
  });
39204
- return { outroMessage: `Successfully ${isHardDelete ? "removed" : "disconnected"} ${theme.styles.bold(displayName)}` };
39224
+ return { outroMessage: `Successfully disconnected ${theme.styles.bold(displayName)}` };
39205
39225
  }
39206
- const connectorsRemoveCommand = new Command("connectors:remove").argument("[type]", "Integration type to remove (e.g., slack, notion)").option("--hard", "Permanently remove the connector (cannot be undone)").description("Disconnect an OAuth integration").action(async (type, options) => {
39207
- await runCommand(() => removeConnectorCommand(type, options), {
39226
+ const connectorsRemoveCommand = new Command("connectors:remove").argument("[type]", "Integration type to remove (e.g., slack, notion)").description("Disconnect an OAuth integration").action(async (type) => {
39227
+ await runCommand(() => removeConnectorCommand(type), {
39208
39228
  requireAuth: true,
39209
39229
  requireAppConfig: true
39210
39230
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/cli",
3
- "version": "0.0.15-pr.99.05b68cd",
3
+ "version": "0.0.15-pr.99.76064e9",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "main": "./dist/cli/index.js",