<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">

<!--
Copyright Contributors to the DNF5 project.
Copyright Contributors to the libdnf project.
SPDX-License-Identifier: LGPL-2.1-or-later

This file is part of libdnf: https://github.com/rpm-software-management/libdnf/

Libdnf is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 2.1 of the License, or
(at your option) any later version.

Libdnf is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License
along with libdnf.  If not, see <https://www.gnu.org/licenses/>.
-->

<node>
<!-- org.rpm.dnf.v0.History:
   @short_description: Interface to transactions history database
-->
<interface name="org.rpm.dnf.v0.History">
    <!--
        recent_changes:
        @options: an array of key/value pairs
        @changeset: a dictionary {"<type_of_change>":[<package>,<package>,...]}

        Get a list of packages that have been recently changed. The result
        represents the difference between the currently installed package set
        and the set at a given point in time.

        The "type_of_change" key in the output dictionary can be one of the
        following: "installed", "removed", "upgraded", or "downgraded". The
        packages in the output are represented as dictionaries containing the
        requested set of attributes for the changed packages.

        For installed, upgraded, and downgraded packages, the currently
        installed version is returned.

        For upgraded and downgraded packages, the "original_evr" and
        "original_arch" attributes are also included, containing the
        package EVR and architecture before the change.

        If requested, upgraded packages may also include an "advisories" list
        field, indicating the name of the updates that contain the upgraded
        (i.e., currently installed) version of the package. If the "all_advisories"
        option is set, advisories for all versions between the original and currently
        installed versions are also included.

        For removed packages, only the name, arch, and evr of the removed
        version are provided.

        All packages in the output include a "transaction_time" attribute
        (uint64, unix timestamp) indicating when the transaction that caused
        the change was completed.

        Following options and filters are supported:

            - upgraded_packages: boolean, default "true"
                Whether to include upgraded packages in the output.
            - downgraded_packages: boolean, default "true"
                Whether to include downgraded packages in the output.
            - installed_packages: boolean, default "true"
                Whether to include installed packages in the output.
            - removed_packages: boolean, default "true"
                Whether to include removed packages in the output.
            - include_advisory: boolean, default "true"
                Whether to include "advisories" to upgraded packages attributes.
            - all_advisories: boolean, default "false"
                Only make sense with include_advisory=true. Include also advisories
                for all versions between the original and currently installed.
            - package_attrs: list of strings, default ["name", "summary", "evr", "arch"]
                List of package attributes that are returned for each changed
                package. Supported attributes are the same as in list() method of
                the Rpm interface.
            - since: int64, unix timestamp
                Get changes since a given point in time.
            - interactive: boolean, default false
                Set to "true", when the operation is done by a user, thus user interaction like password prompts can be done.

        Unknown options are ignored.
    -->
    <method name="recent_changes">
        <arg name="options" type="a{sv}" direction="in" />
        <arg name="changeset" type="a{saa{sv}}" direction="out" />
    </method>

    <!--
        list:
        @options: an array of key/value pairs
        @transactions: array of transactions with their packages

        Get a list of transactions from the history database. Each transaction
        includes metadata and categorized package changes.

        The packages in each category are represented as dictionaries containing
        the requested set of attributes. For upgraded and downgraded packages,
        an "original_evr" attribute is included with the original package EVR.

        Following options are supported:

            - limit: int64
                Maximum number of transactions to return.
            - since: int64, unix timestamp
                Only return transactions completed after this time.
            - reverse: boolean, default "false"
                If true, return oldest transactions first. Default is newest first.
            - contains_pkgs: list of strings
                Filter to transactions containing packages with these names.
            - transaction_attrs: list of strings, default ["id", "start", "end", "user_id", "description", "status"]
                List of transaction attributes to include. Supported: id, start, end,
                user_id, description, status, releasever, comment.
            - package_attrs: list of strings, default ["name", "arch", "evr"]
                List of package attributes to include. Supported: name, epoch,
                version, release, arch, evr, repo_id, action, reason.
            - include_packages: boolean, default "true"
                Whether to include package lists (installed, removed, upgraded, downgraded).

        Unknown options are ignored.
    -->
    <method name="list">
        <arg name="options" type="a{sv}" direction="in" />
        <arg name="transactions" type="aa{sv}" direction="out" />
    </method>
</interface>

</node>
