go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/llx/llx.proto (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  syntax = "proto3";
     5  
     6  package cnquery.llx;
     7  option go_package = "go.mondoo.com/cnquery/llx";
     8  
     9  message Primitive {
    10    string type = 1;
    11  
    12    // The value of the primitive in case of bool|int|float|string|ref|json
    13    // For array/map it holds the exact datatype as a string,
    14    // e.g. []int or map[string]string
    15    bytes value = 2;
    16  
    17    // In case of an array primitive, holds the data of the array
    18    repeated Primitive array = 3;
    19  
    20    // In case of a map primitive, holds the data of the map
    21    map<string, Primitive> map = 4;
    22  }
    23  
    24  message Function {
    25    string type = 1;
    26    repeated Primitive args = 3;
    27    // FIXME: this is a suggestion to allow function calls to be bound
    28    // to non-local references; Remove this comment or remove the feature
    29    uint64 binding = 4;
    30  }
    31  
    32  message Chunk {
    33    enum Call {
    34      PRIMITIVE = 0;
    35      FUNCTION = 1;
    36      PROPERTY = 2;
    37    }
    38    Call call = 1;
    39    string id = 2;
    40    Primitive primitive = 3;
    41    Function function = 4;
    42  }
    43  
    44  message AssertionMessage {
    45    string template = 1;
    46    repeated uint64 refs = 2;
    47    repeated string checksums = 3;
    48    repeated int32 deprecated_v5_datapoint = 20;
    49    bool decode_block = 21;
    50  }
    51  
    52  message CodeV1 {
    53    string id = 1;
    54    repeated Chunk code = 2;
    55    int32 parameters = 3;
    56    repeated int32 entrypoints = 4;
    57    repeated int32 datapoints = 5;
    58    map<int32,string> checksums = 6;
    59    repeated CodeV1 functions = 7;
    60    bool singleValue = 8;
    61    map<int32,AssertionMessage> assertions = 20;
    62  }
    63  
    64  message Block {
    65    repeated Chunk chunks = 1;
    66    // Identifies if we return multiple or just a single value.
    67    // The difference is that blocks usually return the block type (a kind of map)
    68    // where this flag instructs it to just return the value instead.
    69    bool singleValue = 2;
    70    // Number of parameters that are directly provided to this block
    71    int32 parameters = 3;
    72    repeated uint64 entrypoints = 4;
    73    repeated uint64 datapoints = 5;
    74  }
    75  
    76  message CodeV2 {
    77    string id = 1;
    78    repeated Block blocks = 2;
    79    map<uint64,string> checksums = 5;
    80    map<uint64,AssertionMessage> assertions = 20;
    81  }
    82  
    83  message Labels {
    84    map<string,string> labels = 1;
    85  }
    86  
    87  message Documentation {
    88    string field = 1;
    89    string title = 2;
    90    string desc = 3;
    91  }
    92  
    93  message CodeBundle {
    94    reserved 1, 21;
    95    CodeV2 code_v2 = 6;
    96    repeated Documentation suggestions = 2;
    97    string source = 3;
    98    Labels labels = 4;
    99    map<string,string> props = 5; // name + type
   100    string version = 20;
   101    string min_mondoo_version = 22;
   102    map<string,AssertionMessage> assertions = 23;
   103    map<string,uint64> auto_expand = 24; // name + ref to the block of data
   104    // ref + variable name; only used during label creation and discarded afterwards
   105    map<uint64,string> vars = 25;
   106  }
   107  
   108  message Result {
   109    Primitive data = 1;
   110    string error = 2;
   111    string code_id = 3;
   112  }
   113  
   114  message Rating {
   115    string id = 1; // can either be the collection or the query
   116    string endpoint = 2;
   117    int32 tests = 3;
   118    int32 score = 4;
   119    int32 trend = 5;
   120    string date = 6;
   121  }
   122  
   123  message AssessmentItem {
   124    bool success = 1;
   125    string checksum = 2;
   126    uint64 entrypoint = 3;
   127    uint64 ref = 9;
   128    Primitive expected = 4;
   129    Primitive actual = 5;
   130    string operation = 6;
   131    string error = 7;
   132    bool is_assertion = 8;
   133    string template = 20;
   134    repeated Primitive data = 21;
   135  }
   136  
   137  message Assessment {
   138    string checksum = 1;
   139    bool success = 2;
   140    bool is_assertion = 3;
   141    repeated AssessmentItem results = 4;
   142  }