id: rocketchat
name: Rocket.Chat
version: 1.0.0
description: "Rocket.Chat (REST API v1) — SOC ChatOps: post messages, get channel info, list channels, create channels, and look up users. Auth-token authentication; stdlib-only, no extra Python dependencies."
changelog: "1.0.0 — Initial release: post message, get channel info, list channels, create channel, get user."
category: notification

# Per-instance configuration. Auth uses the 'X-Auth-Token' and 'X-User-Id' headers.
config_schema:
  properties:
    base_url:
      type: string
      description: "Rocket.Chat server URL (e.g. https://chat.example.com)"
    user_id:
      type: string
      description: "User ID (X-User-Id)"
    auth_token:
      type: string
      description: "Personal access token (X-Auth-Token)"
      x-soar-sensitive: true
  required:
    - base_url
    - user_id
    - auth_token

commands:
  - id: post_message
    name: rocketchat-post-message
    description: "Post a message to a channel or user."
    inputs_schema:
      properties:
        channel: { type: string, description: "Channel (#name) or user (@name) or room ID" }
        text: { type: string, description: "Message text" }
      required: [channel, text]
    outputs_schema: { properties: {} }
  - id: get_channel_info
    name: rocketchat-get-channel-info
    description: "Get information about a channel by name."
    risk: read
    inputs_schema:
      properties:
        channel_name: { type: string, description: "Channel name (without #)" }
      required: [channel_name]
    outputs_schema: { properties: {} }
  - id: list_channels
    name: rocketchat-list-channels
    description: "List channels."
    risk: read
    inputs_schema:
      properties:
        count: { type: number, description: "Max channels (default 50)" }
      required: []
    outputs_schema: { properties: {} }
  - id: create_channel
    name: rocketchat-create-channel
    description: "Create a channel."
    inputs_schema:
      properties:
        name: { type: string, description: "Channel name" }
        members: { type: string, description: "Comma-separated usernames to add (optional)" }
      required: [name]
    outputs_schema: { properties: {} }
  - id: get_user
    name: rocketchat-get-user
    description: "Look up a user by username."
    risk: read
    inputs_schema:
      properties:
        username: { type: string, description: "Username" }
      required: [username]
    outputs_schema: { properties: {} }

  - id: test_connection
    name: rocketchat-test-connection
    description: "Verify connectivity and the auth token (used by the Test button)."
    risk: read
    inputs_schema:
      properties: {}
      required: []
    outputs_schema: { properties: {} }
