Skip to content
615 changes: 311 additions & 304 deletions README.md

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion src/base-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import isWebCliMode from "./utils/web-mode.js";
// List of commands not allowed in web CLI mode - EXPORTED
export const WEB_CLI_RESTRICTED_COMMANDS = [
// All account login/management commands are not valid in a web env where auth is handled by the website
// note accounts:stats is supported
// note stats:account and stats:app are restricted via WEB_CLI_ANONYMOUS_RESTRICTED_COMMANDS
"accounts:current",
"accounts:list",
"accounts:login",
Expand Down Expand Up @@ -64,6 +64,9 @@ export const WEB_CLI_ANONYMOUS_RESTRICTED_COMMANDS = [
// Integrations and queues are not available to anonymous users
"integrations*",
"queues*",

// Stats commands expose account/app usage data
"stats*",
];

/* Commands not suitable for interactive mode */
Expand Down Expand Up @@ -308,6 +311,8 @@ export abstract class AblyBaseCommand extends InteractiveBaseCommand {
errorMessage = `Integration management requires you to be logged in. Please log in at https://ably.com/login.`;
} else if (commandId.startsWith("queues")) {
errorMessage = `Queue management requires you to be logged in. Please log in at https://ably.com/login.`;
} else if (commandId.startsWith("stats")) {
errorMessage = `Stats commands are only available when logged in. Please log in at https://ably.com/login.`;
} else {
errorMessage = `This command is not available in anonymous mode. Please log in at https://ably.com/login.`;
}
Expand Down
1 change: 0 additions & 1 deletion src/commands/accounts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@ export default class AccountsCommand extends BaseTopicCommand {
"$ ably accounts current",
"$ ably accounts logout",
"$ ably accounts switch my-account",
"$ ably accounts stats",
];
}
77 changes: 0 additions & 77 deletions src/commands/accounts/stats/README.md

This file was deleted.

1 change: 0 additions & 1 deletion src/commands/apps/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export default class AppsCommand extends BaseTopicCommand {
"$ ably apps update",
"$ ably apps delete",
"$ ably apps set-apns-p12",
"$ ably apps stats",
"$ ably apps channel-rules list",
"$ ably apps switch my-app",
];
Expand Down
1 change: 0 additions & 1 deletion src/commands/connections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export default class Connections extends BaseTopicCommand {
static override description = "Interact with Ably Pub/Sub connections";

static override examples = [
"<%= config.bin %> <%= command.id %> stats",
"<%= config.bin %> <%= command.id %> logs connections-lifecycle",
"<%= config.bin %> <%= command.id %> test",
];
Expand Down
Loading
Loading