Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions api/schema/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,27 @@
}
}
},
"PackageInfoDisplay": {
"title": "PackageInfoDisplay",
"description": "this is the each item output of ll-cli list --json",
"allOf": [
{
"$ref": "#/$defs/PackageInfoV2"
},
{
"type": "object",
"requested": [
"info"
],
"properties": {
"install_time": {
"type": "integer",
"description": "package install time"
}
}
}
]
},
"PackageInfoV2": {
"title": "PackageInfoV2",
"description": "this is the each item output of ll-cli list --json",
Expand Down Expand Up @@ -1417,6 +1438,9 @@
"PackageManager1Package": {
"$ref": "#/$defs/PackageManager1Package"
},
"PackageInfoDisplay": {
"$ref": "#/$defs/PackageInfoDisplay"
},
"PackageInfoV2": {
"$ref": "#/$defs/PackageInfoV2"
},
Expand Down
12 changes: 12 additions & 0 deletions api/schema/v1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,18 @@ $defs:
module:
type: string
description: module of package manager
PackageInfoDisplay:
title: PackageInfoDisplay
description: this is the each item output of ll-cli list --json
allOf:
- $ref: '#/$defs/PackageInfoV2'
- type: object
requested:
- info
properties:
install_time:
type: integer
description: package install time
PackageInfoV2:
title: PackageInfoV2
description: this is the each item output of ll-cli list --json
Expand Down
71 changes: 71 additions & 0 deletions libs/api/src/linglong/api/types/v1/Generators.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#include "linglong/api/types/v1/PackageManager1GetRepoInfoResult.hpp"
#include "linglong/api/types/v1/PackageManager1GetRepoInfoResultRepoInfo.hpp"
#include "linglong/api/types/v1/PackageInfoV2.hpp"
#include "linglong/api/types/v1/PackageInfoDisplay.hpp"
#include "linglong/api/types/v1/PackageInfo.hpp"
#include "linglong/api/types/v1/OciConfigurationPatch.hpp"
#include "linglong/api/types/v1/LayerInfo.hpp"
Expand Down Expand Up @@ -164,6 +165,9 @@ void to_json(json & j, const OciConfigurationPatch & x);
void from_json(const json & j, PackageInfo & x);
void to_json(json & j, const PackageInfo & x);

void from_json(const json & j, PackageInfoDisplay & x);
void to_json(json & j, const PackageInfoDisplay & x);

void from_json(const json & j, PackageInfoV2 & x);
void to_json(json & j, const PackageInfoV2 & x);

Expand Down Expand Up @@ -730,6 +734,69 @@ j["size"] = x.size;
j["version"] = x.version;
}

inline void from_json(const json & j, PackageInfoDisplay& x) {
x.arch = j.at("arch").get<std::vector<std::string>>();
x.base = j.at("base").get<std::string>();
x.channel = j.at("channel").get<std::string>();
x.command = get_stack_optional<std::vector<std::string>>(j, "command");
x.compatibleVersion = get_stack_optional<std::string>(j, "compatible_version");
x.description = get_stack_optional<std::string>(j, "description");
x.extImpl = get_stack_optional<ExtensionImpl>(j, "ext_impl");
x.extensions = get_stack_optional<std::vector<ExtensionDefine>>(j, "extensions");
x.id = j.at("id").get<std::string>();
x.kind = j.at("kind").get<std::string>();
x.packageInfoDisplayModule = j.at("module").get<std::string>();
x.name = j.at("name").get<std::string>();
x.permissions = get_stack_optional<ApplicationConfigurationPermissions>(j, "permissions");
x.runtime = get_stack_optional<std::string>(j, "runtime");
x.schemaVersion = j.at("schema_version").get<std::string>();
x.size = j.at("size").get<int64_t>();
x.uuid = get_stack_optional<std::string>(j, "uuid");
x.version = j.at("version").get<std::string>();
x.installTime = get_stack_optional<int64_t>(j, "install_time");
}

inline void to_json(json & j, const PackageInfoDisplay & x) {
j = json::object();
j["arch"] = x.arch;
j["base"] = x.base;
j["channel"] = x.channel;
if (x.command) {
j["command"] = x.command;
}
if (x.compatibleVersion) {
j["compatible_version"] = x.compatibleVersion;
}
if (x.description) {
j["description"] = x.description;
}
if (x.extImpl) {
j["ext_impl"] = x.extImpl;
}
if (x.extensions) {
j["extensions"] = x.extensions;
}
j["id"] = x.id;
j["kind"] = x.kind;
j["module"] = x.packageInfoDisplayModule;
j["name"] = x.name;
if (x.permissions) {
j["permissions"] = x.permissions;
}
if (x.runtime) {
j["runtime"] = x.runtime;
}
j["schema_version"] = x.schemaVersion;
j["size"] = x.size;
if (x.uuid) {
j["uuid"] = x.uuid;
}
j["version"] = x.version;
if (x.installTime) {
j["install_time"] = x.installTime;
}
}

inline void from_json(const json & j, PackageInfoV2& x) {
x.arch = j.at("arch").get<std::vector<std::string>>();
x.base = j.at("base").get<std::string>();
Expand Down Expand Up @@ -1169,6 +1236,7 @@ x.interactionRequest = get_stack_optional<InteractionRequest>(j, "InteractionReq
x.layerInfo = get_stack_optional<LayerInfo>(j, "LayerInfo");
x.ociConfigurationPatch = get_stack_optional<OciConfigurationPatch>(j, "OCIConfigurationPatch");
x.packageInfo = get_stack_optional<PackageInfo>(j, "PackageInfo");
x.packageInfoDisplay = get_stack_optional<PackageInfoDisplay>(j, "PackageInfoDisplay");
x.packageInfoV2 = get_stack_optional<PackageInfoV2>(j, "PackageInfoV2");
x.packageManager1GetRepoInfoResult = get_stack_optional<PackageManager1GetRepoInfoResult>(j, "PackageManager1GetRepoInfoResult");
x.packageManager1InstallLayerFDResult = get_stack_optional<CommonResult>(j, "PackageManager1InstallLayerFDResult");
Expand Down Expand Up @@ -1260,6 +1328,9 @@ j["OCIConfigurationPatch"] = x.ociConfigurationPatch;
if (x.packageInfo) {
j["PackageInfo"] = x.packageInfo;
}
if (x.packageInfoDisplay) {
j["PackageInfoDisplay"] = x.packageInfoDisplay;
}
if (x.packageInfoV2) {
j["PackageInfoV2"] = x.packageInfoV2;
}
Expand Down
2 changes: 2 additions & 0 deletions libs/api/src/linglong/api/types/v1/LinglongAPIV1.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include "linglong/api/types/v1/LayerInfo.hpp"
#include "linglong/api/types/v1/OciConfigurationPatch.hpp"
#include "linglong/api/types/v1/PackageInfo.hpp"
#include "linglong/api/types/v1/PackageInfoDisplay.hpp"
#include "linglong/api/types/v1/PackageInfoV2.hpp"
#include "linglong/api/types/v1/PackageManager1GetRepoInfoResult.hpp"
#include "linglong/api/types/v1/PackageManager1InstallParameters.hpp"
Expand Down Expand Up @@ -107,6 +108,7 @@ std::optional<InteractionRequest> interactionRequest;
std::optional<LayerInfo> layerInfo;
std::optional<OciConfigurationPatch> ociConfigurationPatch;
std::optional<PackageInfo> packageInfo;
std::optional<PackageInfoDisplay> packageInfoDisplay;
std::optional<PackageInfoV2> packageInfoV2;
std::optional<PackageManager1GetRepoInfoResult> packageManager1GetRepoInfoResult;
std::optional<CommonResult> packageManager1InstallLayerFDResult;
Expand Down
119 changes: 119 additions & 0 deletions libs/api/src/linglong/api/types/v1/PackageInfoDisplay.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
// This file is generated by tools/codegen.sh
// DO NOT EDIT IT.

// clang-format off

// To parse this JSON data, first install
//
// json.hpp https://github.com/nlohmann/json
//
// Then include this file, and then do
//
// PackageInfoDisplay.hpp data = nlohmann::json::parse(jsonString);

#pragma once

#include <optional>
#include <nlohmann/json.hpp>
#include "linglong/api/types/v1/helper.hpp"

#include "linglong/api/types/v1/ExtensionImpl.hpp"
#include "linglong/api/types/v1/ExtensionDefine.hpp"
#include "linglong/api/types/v1/ApplicationConfigurationPermissions.hpp"

namespace linglong {
namespace api {
namespace types {
namespace v1 {
/**
* this is the each item output of ll-cli list --json
*
* package info of package manager search
*/

using nlohmann::json;

/**
* this is the each item output of ll-cli list --json
*
* package info of package manager search
*/
struct PackageInfoDisplay {
/**
* arch of package info
*/
std::vector<std::string> arch;
/**
* base of package info
*/
std::string base;
/**
* channel of package info
*/
std::string channel;
/**
* command of package info
*/
std::optional<std::vector<std::string>> command;
/**
* record linyaps package is compatible with linyaps component version
*/
std::optional<std::string> compatibleVersion;
/**
* description of package info
*/
std::optional<std::string> description;
std::optional<ExtensionImpl> extImpl;
/**
* description of extension
*/
std::optional<std::vector<ExtensionDefine>> extensions;
/**
* id of package info
*/
std::string id;
/**
* kind of package info
*/
std::string kind;
/**
* module of package info
*/
std::string packageInfoDisplayModule;
/**
* name of package info
*/
std::string name;
std::optional<ApplicationConfigurationPermissions> permissions;
/**
* runtime of package info
*/
std::optional<std::string> runtime;
/**
* version of 'PackageInfo'
*/
std::string schemaVersion;
/**
* Uncompressed package size in bytes
*/
int64_t size;
/**
* this property is only used for app which instead from UAB and it should be null in other
* conditions.
*/
std::optional<std::string> uuid;
/**
* version of package info
*/
std::string version;
/**
* package install time
*/
std::optional<int64_t> installTime;
};
}
}
}
}

// clang-format on
Loading