tag include unused flag for future use

This commit is contained in:
mbecker20
2025-07-31 17:10:36 -04:00
parent 842c67bb50
commit ae9f2d9f74
6 changed files with 36 additions and 14 deletions

View File

@@ -46,6 +46,7 @@ impl Resolve<WriteArgs> for CreateTag {
name: self.name,
color: TagColor::Slate,
owner: user.id.clone(),
unused: false,
};
tag.id = db_client()

View File

@@ -32,14 +32,25 @@ pub struct Tag {
#[cfg_attr(feature = "mongo", unique_index)]
pub name: String,
/// Hex color code with alpha for UI display
#[serde(default)]
pub color: TagColor,
#[serde(default)]
#[builder(default)]
#[cfg_attr(feature = "mongo", index)]
pub owner: String,
/// Hex color code with alpha for UI display
#[serde(default)]
#[builder(default)]
pub color: TagColor,
/// This field is not stored on database,
/// but rather populated at query time based on results from the other resources.
#[serde(default, skip_serializing_if = "is_false")]
#[builder(default)]
pub unused: bool,
}
fn is_false(b: &bool) -> bool {
!b
}
#[typeshare]

View File

@@ -2429,9 +2429,14 @@ export interface Tag {
*/
_id?: MongoId;
name: string;
owner?: string;
/** Hex color code with alpha for UI display */
color?: TagColor;
owner?: string;
/**
* This field is not stored on database,
* but rather populated at query time based on results from the other resources.
*/
unused?: boolean;
}
export type GetTagResponse = Tag;

View File

@@ -162,7 +162,7 @@ export declare function KomodoClient(url: string, options: InitOptions): {
* and gives a callback to handle the output as it comes in.
*
* ```ts
* const stream = await komodo.execute_terminal(
* await komodo.execute_terminal(
* {
* server: "my-server",
* terminal: "name",
@@ -222,7 +222,7 @@ export declare function KomodoClient(url: string, options: InitOptions): {
* and gives a callback to handle the output as it comes in.
*
* ```ts
* const stream = await komodo.execute_container_exec(
* await komodo.execute_container_exec(
* {
* server: "my-server",
* container: "name",
@@ -275,7 +275,7 @@ export declare function KomodoClient(url: string, options: InitOptions): {
* and gives a callback to handle the output as it comes in.
*
* ```ts
* const stream = await komodo.execute_deployment_exec(
* await komodo.execute_deployment_exec(
* {
* deployment: "my-deployment",
* shell: "bash",
@@ -326,7 +326,7 @@ export declare function KomodoClient(url: string, options: InitOptions): {
* and gives a callback to handle the output as it comes in.
*
* ```ts
* const stream = await komodo.execute_stack_exec(
* await komodo.execute_stack_exec(
* {
* stack: "my-stack",
* service: "database"

View File

@@ -279,7 +279,7 @@ export function KomodoClient(url, options) {
* and gives a callback to handle the output as it comes in.
*
* ```ts
* const stream = await komodo.execute_terminal(
* await komodo.execute_terminal(
* {
* server: "my-server",
* terminal: "name",
@@ -335,7 +335,7 @@ export function KomodoClient(url, options) {
* and gives a callback to handle the output as it comes in.
*
* ```ts
* const stream = await komodo.execute_container_exec(
* await komodo.execute_container_exec(
* {
* server: "my-server",
* container: "name",
@@ -386,7 +386,7 @@ export function KomodoClient(url, options) {
* and gives a callback to handle the output as it comes in.
*
* ```ts
* const stream = await komodo.execute_deployment_exec(
* await komodo.execute_deployment_exec(
* {
* deployment: "my-deployment",
* shell: "bash",
@@ -435,7 +435,7 @@ export function KomodoClient(url, options) {
* and gives a callback to handle the output as it comes in.
*
* ```ts
* const stream = await komodo.execute_stack_exec(
* await komodo.execute_stack_exec(
* {
* stack: "my-stack",
* service: "database"

View File

@@ -2521,9 +2521,14 @@ export interface Tag {
*/
_id?: MongoId;
name: string;
owner?: string;
/** Hex color code with alpha for UI display */
color?: TagColor;
owner?: string;
/**
* This field is not stored on database,
* but rather populated at query time based on results from the other resources.
*/
unused?: boolean;
}
export type GetTagResponse = Tag;
export type GetUpdateResponse = Update;