Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 22 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ COMMANDS
ably apps current Show the currently selected app
ably apps delete Delete an app
ably apps list List all apps in the current account
ably apps rules Manage Ably channel rules (namespaces)
ably apps rules Manage Ably rules (namespaces)
ably apps switch Switch to a different Ably app
ably apps update Update an app
```
Expand Down Expand Up @@ -572,14 +572,14 @@ _See code: [src/commands/apps/list.ts](https://github.com/ably/ably-cli/blob/v0.

## `ably apps rules`

Manage Ably channel rules (namespaces)
Manage Ably rules (namespaces)

```
USAGE
$ ably apps rules

DESCRIPTION
Manage Ably channel rules (namespaces)
Manage Ably rules (namespaces)

EXAMPLES
$ ably apps rules list
Expand All @@ -591,24 +591,24 @@ EXAMPLES
$ ably apps rules delete chat

COMMANDS
ably apps rules create Create a channel rule
ably apps rules delete Delete a channel rule
ably apps rules list List channel rules for an app
ably apps rules update Update a channel rule
ably apps rules create Create a rule
ably apps rules delete Delete a rule
ably apps rules list List rules for an app
ably apps rules update Update a rule
```

_See code: [src/commands/apps/rules/index.ts](https://github.com/ably/ably-cli/blob/v0.17.0/src/commands/apps/rules/index.ts)_

## `ably apps rules create`

Create a channel rule
Create a rule

```
USAGE
$ ably apps rules create --name <value> [-v] [--json | --pretty-json] [--app <value>] [--authenticated]
[--batching-enabled] [--batching-interval <value>] [--conflation-enabled] [--conflation-interval <value>]
[--conflation-key <value>] [--expose-time-serial] [--mutable-messages] [--persist-last] [--persisted]
[--populate-channel-registry] [--push-enabled] [--tls-only]
[--conflation-key <value>] [--mutable-messages] [--persist-last] [--persisted] [--populate-channel-registry]
[--push-enabled] [--tls-only]

FLAGS
-v, --verbose Output verbose logs
Expand All @@ -619,11 +619,10 @@ FLAGS
--conflation-enabled Whether to enable conflation for messages on channels matching this rule
--conflation-interval=<value> The conflation interval for messages on channels matching this rule
--conflation-key=<value> The conflation key for messages on channels matching this rule
--expose-time-serial Whether to expose the time serial for messages on channels matching this rule
--json Output in JSON format
--mutable-messages Whether messages on channels matching this rule can be updated or deleted after
publishing. Automatically enables message persistence.
--name=<value> (required) Name of the channel rule
--name=<value> (required) Name of the rule
--persist-last Whether to persist only the last message on channels matching this rule
--persisted Whether messages on channels matching this rule should be persisted
--populate-channel-registry Whether to populate the channel registry for channels matching this rule
Expand All @@ -632,7 +631,7 @@ FLAGS
--tls-only Whether to enforce TLS for channels matching this rule

DESCRIPTION
Create a channel rule
Create a rule

EXAMPLES
$ ably apps rules create --name "chat" --persisted
Expand All @@ -650,14 +649,14 @@ _See code: [src/commands/apps/rules/create.ts](https://github.com/ably/ably-cli/

## `ably apps rules delete NAMEORID`

Delete a channel rule
Delete a rule

```
USAGE
$ ably apps rules delete NAMEORID [-v] [--json | --pretty-json] [--app <value>] [-f]

ARGUMENTS
NAMEORID Name or ID of the channel rule to delete
NAMEORID Name or ID of the rule to delete

FLAGS
-f, --force Force deletion without confirmation
Expand All @@ -667,7 +666,7 @@ FLAGS
--pretty-json Output in colorized JSON format

DESCRIPTION
Delete a channel rule
Delete a rule

EXAMPLES
$ ably apps rules delete chat
Expand All @@ -685,7 +684,7 @@ _See code: [src/commands/apps/rules/delete.ts](https://github.com/ably/ably-cli/

## `ably apps rules list`

List channel rules for an app
List rules for an app

```
USAGE
Expand All @@ -699,7 +698,7 @@ FLAGS
--pretty-json Output in colorized JSON format

DESCRIPTION
List channel rules for an app
List rules for an app

EXAMPLES
$ ably apps rules list
Expand All @@ -715,17 +714,17 @@ _See code: [src/commands/apps/rules/list.ts](https://github.com/ably/ably-cli/bl

## `ably apps rules update NAMEORID`

Update a channel rule
Update a rule

```
USAGE
$ ably apps rules update NAMEORID [-v] [--json | --pretty-json] [--app <value>] [--authenticated]
[--batching-enabled] [--batching-interval <value>] [--conflation-enabled] [--conflation-interval <value>]
[--conflation-key <value>] [--expose-time-serial] [--mutable-messages] [--persist-last] [--persisted]
[--populate-channel-registry] [--push-enabled] [--tls-only]
[--conflation-key <value>] [--mutable-messages] [--persist-last] [--persisted] [--populate-channel-registry]
[--push-enabled] [--tls-only]

ARGUMENTS
NAMEORID Name or ID of the channel rule to update
NAMEORID Name or ID of the rule to update

FLAGS
-v, --verbose Output verbose logs
Expand All @@ -736,7 +735,6 @@ FLAGS
--[no-]conflation-enabled Whether to enable conflation for messages on channels matching this rule
--conflation-interval=<value> The conflation interval for messages on channels matching this rule
--conflation-key=<value> The conflation key for messages on channels matching this rule
--[no-]expose-time-serial Whether to expose the time serial for messages on channels matching this rule
--json Output in JSON format
--[no-]mutable-messages Whether messages on channels matching this rule can be updated or deleted after
publishing. Automatically enables message persistence.
Expand All @@ -748,7 +746,7 @@ FLAGS
--[no-]tls-only Whether to enforce TLS for channels matching this rule

DESCRIPTION
Update a channel rule
Update a rule

EXAMPLES
$ ably apps rules update chat --persisted
Expand Down
4 changes: 1 addition & 3 deletions docs/Project-Structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ This document outlines the directory structure of the Ably CLI project.
│ ├── commands/ # CLI commands (oclif)
│ │ ├── accounts/ # Account management (login, logout, list, switch, current)
│ │ ├── apps/ # App management (create, list, delete, switch, current, etc.)
│ │ │ ├── rules/ # Channel rules / namespaces (primary path)
│ │ │ └── channel-rules/ # Hidden alias → apps/rules/
│ │ │ └── rules/ # Rules / namespaces
│ │ ├── auth/ # Authentication (keys, tokens)
│ │ ├── bench/ # Benchmarking (publisher, subscriber)
│ │ ├── channel-rule/ # Hidden alias → apps/rules/
│ │ ├── channels/ # Pub/Sub channels (publish, subscribe, presence, history, annotations, etc.)
│ │ ├── config/ # CLI config management (show, path)
│ │ ├── connections/ # Client connections (test)
Expand Down
19 changes: 0 additions & 19 deletions src/commands/apps/channel-rules/create.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/commands/apps/channel-rules/delete.ts

This file was deleted.

17 changes: 0 additions & 17 deletions src/commands/apps/channel-rules/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/commands/apps/channel-rules/list.ts

This file was deleted.

19 changes: 0 additions & 19 deletions src/commands/apps/channel-rules/update.ts

This file was deleted.

41 changes: 18 additions & 23 deletions src/commands/apps/rules/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from "../../../utils/output.js";

export default class RulesCreateCommand extends ControlBaseCommand {
static description = "Create a channel rule";
static description = "Create a rule";

static examples = [
'$ ably apps rules create --name "chat" --persisted',
Expand Down Expand Up @@ -56,18 +56,13 @@ export default class RulesCreateCommand extends ControlBaseCommand {
"The conflation key for messages on channels matching this rule",
required: false,
}),
"expose-time-serial": Flags.boolean({
description:
"Whether to expose the time serial for messages on channels matching this rule",
required: false,
}),
"mutable-messages": Flags.boolean({
description:
"Whether messages on channels matching this rule can be updated or deleted after publishing. Automatically enables message persistence.",
required: false,
}),
name: Flags.string({
description: "Name of the channel rule",
description: "Name of the rule",
required: true,
}),
"persist-last": Flags.boolean({
Expand Down Expand Up @@ -129,7 +124,6 @@ export default class RulesCreateCommand extends ControlBaseCommand {
conflationEnabled: flags["conflation-enabled"],
conflationInterval: flags["conflation-interval"],
conflationKey: flags["conflation-key"],
exposeTimeSerial: flags["expose-time-serial"],
mutableMessages,
persistLast: flags["persist-last"],
persisted,
Expand All @@ -148,22 +142,22 @@ export default class RulesCreateCommand extends ControlBaseCommand {
{
appId,
rule: {
authenticated: createdNamespace.authenticated,
batchingEnabled: createdNamespace.batchingEnabled,
batchingInterval: createdNamespace.batchingInterval,
conflationEnabled: createdNamespace.conflationEnabled,
conflationInterval: createdNamespace.conflationInterval,
conflationKey: createdNamespace.conflationKey,
authenticated: createdNamespace.authenticated || false,
batchingEnabled: createdNamespace.batchingEnabled || false,
batchingInterval: createdNamespace.batchingInterval ?? null,
conflationEnabled: createdNamespace.conflationEnabled || false,
conflationInterval: createdNamespace.conflationInterval ?? null,
conflationKey: createdNamespace.conflationKey ?? null,
created: new Date(createdNamespace.created).toISOString(),
exposeTimeSerial: createdNamespace.exposeTimeSerial,
id: createdNamespace.id,
mutableMessages: createdNamespace.mutableMessages,
name: flags.name,
persistLast: createdNamespace.persistLast,
persisted: createdNamespace.persisted,
populateChannelRegistry: createdNamespace.populateChannelRegistry,
pushEnabled: createdNamespace.pushEnabled,
tlsOnly: createdNamespace.tlsOnly,
modified: new Date(createdNamespace.modified).toISOString(),
mutableMessages: createdNamespace.mutableMessages || false,
persistLast: createdNamespace.persistLast || false,
persisted: createdNamespace.persisted || false,
populateChannelRegistry:
createdNamespace.populateChannelRegistry || false,
pushEnabled: createdNamespace.pushEnabled || false,
tlsOnly: createdNamespace.tlsOnly || false,
},
timestamp: new Date().toISOString(),
},
Expand All @@ -172,11 +166,12 @@ export default class RulesCreateCommand extends ControlBaseCommand {
} else {
this.log(
formatSuccess(
"Channel rule " + formatResource(createdNamespace.id) + " created.",
"Rule " + formatResource(createdNamespace.id) + " created.",
),
);
this.log(`${formatLabel("ID")} ${formatResource(createdNamespace.id)}`);
for (const line of formatChannelRuleDetails(createdNamespace, {
bold: true,
formatDate: (t) => this.formatDate(t),
})) {
this.log(line);
Expand Down
Loading
Loading