diff --git a/core/startos/bindings/ExposeUiParams.ts b/core/startos/bindings/ExposeUiParams.ts index 124fac851..3c2230060 100644 --- a/core/startos/bindings/ExposeUiParams.ts +++ b/core/startos/bindings/ExposeUiParams.ts @@ -1,21 +1,3 @@ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. -import type { ExposedUI } from "./ExposedUI"; -export type ExposeUiParams = - | { - type: "object"; - value: { [k: string]: ExposeUiParams }; - } - | { - type: "string"; - /** The path to the value in the Store. [JsonPath](https://jsonpath.com/) */ - path: string; - /** A human readable description or explanation of the value */ - description: string | null; - /** (string/number only) Whether or not to mask the value, for example, when displaying a password */ - masked: boolean; - /** (string/number only) Whether or not to include a button for copying the value to clipboard */ - copyable: boolean | null; - /** (string/number only) Whether or not to include a button for displaying the value as a QR code */ - qr: boolean | null; - }; +export type ExposeUiParams = { "type": "object", value: {[key: string]: ExposeUiParams}, } | { "type": "string", path: string, description: string | null, masked: boolean, copyable: boolean | null, qr: boolean | null, }; \ No newline at end of file diff --git a/core/startos/src/service/service_effect_handler.rs b/core/startos/src/service/service_effect_handler.rs index ebcbcaf08..e67177998 100644 --- a/core/startos/src/service/service_effect_handler.rs +++ b/core/startos/src/service/service_effect_handler.rs @@ -695,9 +695,10 @@ async fn expose_for_dependents( #[ts(export)] enum ExposeUiParams { Object { - value: Record, + #[ts(type = "{[key: string]: ExposeUiParams}")] + value: OrdMap, }, - r#String { + String { path: String, description: Option, masked: bool, @@ -706,25 +707,23 @@ enum ExposeUiParams { }, } -async fn expose_ui( - context: EffectContext, - ExposeUiParams { paths }: ExposeUiParams, -) -> Result<(), Error> { - let context = context.deref()?; - let package_id = context.id.clone(); - context - .ctx - .db - .mutate(|db| { - db.as_public_mut() - .as_package_data_mut() - .as_idx_mut(&package_id) - .or_not_found(&package_id)? - .as_store_exposed_ui_mut() - .ser(&paths) - }) - .await?; - Ok(()) +async fn expose_ui(context: EffectContext, params: ExposeUiParams) -> Result<(), Error> { + todo!() + // let context = context.deref()?; + // let package_id = context.id.clone(); + // context + // .ctx + // .db + // .mutate(|db| { + // db.as_public_mut() + // .as_package_data_mut() + // .as_idx_mut(&package_id) + // .or_not_found(&package_id)? + // .as_store_exposed_ui_mut() + // .ser(&paths) + // }) + // .await?; + // Ok(()) } #[derive(Debug, Clone, serde::Serialize, serde::Deserialize, Parser, TS)] #[ts(export)]