# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# 	http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
---
- name: package
  title: Package
  group: 2
  short: These fields contain information about an installed software package.
  description: >
    These fields contain information about an installed software package. It contains general information about a
    package, such as name, version or size. It also contains installation details, such as time or location.
  type: group
  fields:

    - name: name
      level: extended
      type: keyword
      description: Package name
      example: go

    - name: version
      level: extended
      type: keyword
      description: Package version
      example: 1.12.9

    - name: build_version
      level: extended
      type: keyword
      short: Build version information
      description: >
        Additional information about the build version of the installed package.

        For example use the commit SHA of a non-released package.
      example: 36f4f7e89dd61b0988b12ee000b98966867710cd

    - name: description
      level: extended
      type: keyword
      description: Description of the package.
      example: Open source programming language to build simple/reliable/efficient software.

    - name: size
      format: string
      level: extended
      type: long
      description: Package size in bytes.
      example: 62231

    - name: installed
      level: extended
      type: date
      description: Time when package was installed.

    - name: path
      level: extended
      type: keyword
      description: Path where the package is installed.
      example: /usr/local/Cellar/go/1.12.9/

    - name: architecture
      level: extended
      type: keyword
      description: Package architecture.
      example: x86_64

    - name: checksum
      level: extended
      type: keyword
      description: Checksum of the installed package for verification.
      example: 68b329da9893e34099c7d8ad5cb9c940

    - name: install_scope
      level: extended
      type: keyword
      description: Indicating how the package was installed, e.g. user-local, global.
      example: global

    - name: license
      level: extended
      type: keyword
      short: Package license
      description: >
        License under which the package was released.

        Use a short name, e.g. the license identifier from SPDX License List where possible (https://spdx.org/licenses/).
      example: Apache License 2.0

    - name: reference
      level: extended
      type: keyword
      short: Package home page or reference URL
      description: >
        Home page or reference URL of the software in this package, if available.
      example: https://golang.org

    - name: type
      level: extended
      type: keyword
      short: Package type
      description: >
        Type of package.

        This should contain the package file type, rather than the package manager name.
        Examples: rpm, dpkg, brew, npm, gem, nupkg, jar.
      example: rpm
