Base marker interface for all commands in the command bus pattern.

AnyCommand serves as the root interface for the command pattern implementation. All commands must extend this interface (either directly or through LimeObjectCommand or LimeObjectBulkCommand) to be handled by the CommandBus.

Commands represent user actions or operations that can be executed, such as:

  • Exporting data to Excel
  • Sending emails
  • Generating reports
  • Creating or deleting records
  • Custom business logic operations

Important: All properties of a command must be serializable and publicly assignable:

Serialization requirements:

  • Use primitive types (string, number, boolean)
  • Use plain objects and arrays
  • Use serializable custom types (like Expression)
  • Avoid functions, DOM elements, class instances with methods, circular references, etc.

Assignability requirements:

  • All properties must be public (not private or protected)
  • Properties cannot be readonly after instantiation
  • Constructor parameters are optional for command creation

The platform creates commands by instantiating the class without constructor arguments, then directly assigning values to properties. Commands may also be serialized for storage, transmission, or recreation via createCommand.

Example

@Command({ id: 'generate-report' })
export class GenerateReportCommand implements AnyCommand {
public reportType: string;
public startDate: string; // ISO date string, not Date object
public endDate: string;
}

See

Hierarchy