sdk

Radroots SDK and bindings
git clone https://radroots.dev/git/sdk.git
Log | Files | Refs | README

commit abccef4bc45a47e357dd2841b2111db638055cee
parent 010b90e6a19b30b257ffe7ebb91f284f387ec185
Author: triesap <tyson@radroots.org>
Date:   Sat, 27 Jun 2026 10:25:27 +0000

bindings: align dto source-root generation

- pin dto_bindgen to the pushed source-root closeout revision
- update SDK registry helpers for three-part Rust type identities
- regenerate events and trade TypeScript bindings from source roots
- keep trade overlay order DTOs local to the SDK package surface

Diffstat:
MCargo.lock | 13++++++-------
MCargo.toml | 4++--
Mcrates/trade_bindings/src/dto.rs | 191+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------
Mcrates/trade_bindings/src/lib.rs | 8++++----
Mcrates/types_bindings/src/lib.rs | 2+-
Mpackages/events-bindings/src/generated/types.ts | 71++++++++++++++++++++++++-----------------------------------------------
Mpackages/trade-bindings/src/generated/types.ts | 16+++++++++++++---
Mtools/xtask/src/dto_render.rs | 34++++++++++++++++------------------
Mtools/xtask/src/dto_roots.rs | 51+++++++++++++++++++++++++--------------------------
9 files changed, 268 insertions(+), 122 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -502,7 +502,7 @@ checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "dto_bindgen" version = "0.1.0" -source = "git+https://github.com/triesap/dto_bindgen?rev=96ed6c691aacab31860828d25da2e0167b13d92c#96ed6c691aacab31860828d25da2e0167b13d92c" +source = "git+https://github.com/triesap/dto_bindgen?rev=d722db31f56e4c62c423adcf19eaf9029780a017#d722db31f56e4c62c423adcf19eaf9029780a017" dependencies = [ "dto_bindgen_backend_python", "dto_bindgen_backend_ts", @@ -514,7 +514,7 @@ dependencies = [ [[package]] name = "dto_bindgen_backend_python" version = "0.1.0" -source = "git+https://github.com/triesap/dto_bindgen?rev=96ed6c691aacab31860828d25da2e0167b13d92c#96ed6c691aacab31860828d25da2e0167b13d92c" +source = "git+https://github.com/triesap/dto_bindgen?rev=d722db31f56e4c62c423adcf19eaf9029780a017#d722db31f56e4c62c423adcf19eaf9029780a017" dependencies = [ "dto_bindgen_core", ] @@ -522,7 +522,7 @@ dependencies = [ [[package]] name = "dto_bindgen_backend_ts" version = "0.1.0" -source = "git+https://github.com/triesap/dto_bindgen?rev=96ed6c691aacab31860828d25da2e0167b13d92c#96ed6c691aacab31860828d25da2e0167b13d92c" +source = "git+https://github.com/triesap/dto_bindgen?rev=d722db31f56e4c62c423adcf19eaf9029780a017#d722db31f56e4c62c423adcf19eaf9029780a017" dependencies = [ "dto_bindgen_core", ] @@ -530,7 +530,7 @@ dependencies = [ [[package]] name = "dto_bindgen_core" version = "0.1.0" -source = "git+https://github.com/triesap/dto_bindgen?rev=96ed6c691aacab31860828d25da2e0167b13d92c#96ed6c691aacab31860828d25da2e0167b13d92c" +source = "git+https://github.com/triesap/dto_bindgen?rev=d722db31f56e4c62c423adcf19eaf9029780a017#d722db31f56e4c62c423adcf19eaf9029780a017" dependencies = [ "proc-macro2", "quote", @@ -544,7 +544,7 @@ dependencies = [ [[package]] name = "dto_bindgen_macros" version = "0.1.0" -source = "git+https://github.com/triesap/dto_bindgen?rev=96ed6c691aacab31860828d25da2e0167b13d92c#96ed6c691aacab31860828d25da2e0167b13d92c" +source = "git+https://github.com/triesap/dto_bindgen?rev=d722db31f56e4c62c423adcf19eaf9029780a017#d722db31f56e4c62c423adcf19eaf9029780a017" dependencies = [ "proc-macro2", "quote", @@ -1712,7 +1712,7 @@ dependencies = [ name = "radroots_core" version = "0.1.0-alpha.2" dependencies = [ - "dto_bindgen_core", + "dto_bindgen", "rust_decimal", "rust_decimal_macros", "serde", @@ -1742,7 +1742,6 @@ name = "radroots_events" version = "0.1.0-alpha.2" dependencies = [ "dto_bindgen", - "dto_bindgen_core", "hex", "radroots_core", "serde", diff --git a/Cargo.toml b/Cargo.toml @@ -26,8 +26,8 @@ homepage = "https://radroots.org" readme = "README" [workspace.dependencies] -dto_bindgen = { git = "https://github.com/triesap/dto_bindgen", rev = "96ed6c691aacab31860828d25da2e0167b13d92c" } -dto_bindgen_core = { git = "https://github.com/triesap/dto_bindgen", rev = "96ed6c691aacab31860828d25da2e0167b13d92c", package = "dto_bindgen_core" } +dto_bindgen = { git = "https://github.com/triesap/dto_bindgen", rev = "d722db31f56e4c62c423adcf19eaf9029780a017" } +dto_bindgen_core = { git = "https://github.com/triesap/dto_bindgen", rev = "d722db31f56e4c62c423adcf19eaf9029780a017", package = "dto_bindgen_core" } radroots_core = { path = "../lib/crates/core", version = "0.1.0-alpha.2", default-features = false } radroots_authority = { path = "../lib/crates/authority", version = "0.1.0-alpha.2", default-features = false } radroots_event_store = { path = "../lib/crates/event_store", version = "0.1.0-alpha.2", default-features = false } diff --git a/crates/trade_bindings/src/dto.rs b/crates/trade_bindings/src/dto.rs @@ -10,6 +10,9 @@ pub fn dto_roots() -> Vec<RootDescriptor> { .into_iter() .collect::<Vec<_>>(); roots.extend([ + RootDescriptor::new::<RadrootsCommercialMessagePayload>(), + RootDescriptor::new::<RadrootsCommercialMessageType>(), + RootDescriptor::new::<RadrootsOrderStatus>(), RootDescriptor::new::<RadrootsTradeFacetCount>(), RootDescriptor::new::<RadrootsTradeListingBackofficeOverlay>(), RootDescriptor::new::<RadrootsTradeListingBackofficeQuery>(), @@ -82,17 +85,158 @@ imported_ts_type!(RadrootsListingProductImport, "RadrootsListingProduct"); imported_ts_type!(RadrootsNostrEventPtrImport, "RadrootsNostrEventPtr"); imported_ts_type!(RadrootsPlotRefImport, "RadrootsPlotRef"); imported_ts_type!(RadrootsResourceAreaRefImport, "RadrootsResourceAreaRef"); +imported_ts_type!(RadrootsOrderCancellationImport, "RadrootsOrderCancellation"); +imported_ts_type!(RadrootsOrderDecisionImport, "RadrootsOrderDecision"); +imported_ts_type!(RadrootsOrderEconomicLineImport, "RadrootsOrderEconomicLine"); +imported_ts_type!(RadrootsOrderItemImport, "RadrootsOrderItem"); +imported_ts_type!(RadrootsOrderRequestImport, "RadrootsOrderRequest"); imported_ts_type!( - RadrootsCommercialMessagePayloadImport, - "RadrootsCommercialMessagePayload" + RadrootsOrderRevisionDecisionImport, + "RadrootsOrderRevisionDecision" ); imported_ts_type!( - RadrootsCommercialMessageTypeImport, - "RadrootsCommercialMessageType" + RadrootsOrderRevisionProposalImport, + "RadrootsOrderRevisionProposal" +); +imported_ts_type!( + RadrootsTradeListingValidateRequestImport, + "RadrootsTradeListingValidateRequest" +); +imported_ts_type!( + RadrootsTradeListingValidateResultImport, + "RadrootsTradeListingValidateResult" ); -imported_ts_type!(RadrootsOrderEconomicLineImport, "RadrootsOrderEconomicLine"); -imported_ts_type!(RadrootsOrderItemImport, "RadrootsOrderItem"); -imported_ts_type!(RadrootsOrderStatusImport, "RadrootsOrderStatus"); + +pub enum RadrootsCommercialMessagePayload { + ListingValidateRequest, + ListingValidateResult, + TradeOrderRequested, + OrderDecision, + OrderRevisionProposal, + OrderRevisionDecisionAccepted, + OrderRevisionDecisionDeclined, + Cancel, +} + +impl Dto for RadrootsCommercialMessagePayload { + fn describe(ctx: &mut DescribeCtx) -> TypeRef { + let def = EnumDef::new( + "RadrootsCommercialMessagePayload", + "RadrootsCommercialMessagePayload", + EnumRepr::External, + span("crates/trade_bindings/src/dto.rs", 97), + ) + .with_variant(payload_variant( + "ListingValidateRequest", + "listing_validate_request", + RadrootsTradeListingValidateRequestImport::describe(ctx), + "crates/trade_bindings/src/dto.rs", + 99, + )) + .with_variant(payload_variant( + "ListingValidateResult", + "listing_validate_result", + RadrootsTradeListingValidateResultImport::describe(ctx), + "crates/trade_bindings/src/dto.rs", + 100, + )) + .with_variant(payload_variant( + "TradeOrderRequested", + "trade_order_requested", + RadrootsOrderRequestImport::describe(ctx), + "crates/trade_bindings/src/dto.rs", + 101, + )) + .with_variant(payload_variant( + "OrderDecision", + "order_response", + RadrootsOrderDecisionImport::describe(ctx), + "crates/trade_bindings/src/dto.rs", + 102, + )) + .with_variant(payload_variant( + "OrderRevisionProposal", + "order_revision", + RadrootsOrderRevisionProposalImport::describe(ctx), + "crates/trade_bindings/src/dto.rs", + 103, + )) + .with_variant(payload_variant( + "OrderRevisionDecisionAccepted", + "order_revision_accept", + RadrootsOrderRevisionDecisionImport::describe(ctx), + "crates/trade_bindings/src/dto.rs", + 104, + )) + .with_variant(payload_variant( + "OrderRevisionDecisionDeclined", + "order_revision_decline", + RadrootsOrderRevisionDecisionImport::describe(ctx), + "crates/trade_bindings/src/dto.rs", + 105, + )) + .with_variant(payload_variant( + "Cancel", + "cancel", + RadrootsOrderCancellationImport::describe(ctx), + "crates/trade_bindings/src/dto.rs", + 106, + )); + register(ctx, "RadrootsCommercialMessagePayload", TypeDef::Enum(def)) + } +} + +#[derive(dto_bindgen::Dto)] +pub enum RadrootsCommercialMessageType { + #[serde(rename = "listing_validate_request")] + ListingValidateRequest, + #[serde(rename = "listing_validate_result")] + ListingValidateResult, + #[serde(rename = "order_request")] + OrderRequest, + #[serde(rename = "order_response")] + OrderResponse, + #[serde(rename = "order_revision")] + OrderRevision, + #[serde(rename = "order_revision_accept")] + OrderRevisionAccept, + #[serde(rename = "order_revision_decline")] + OrderRevisionDecline, + #[serde(rename = "question")] + Question, + #[serde(rename = "answer")] + Answer, + #[serde(rename = "discount_request")] + DiscountRequest, + #[serde(rename = "discount_offer")] + DiscountOffer, + #[serde(rename = "discount_accept")] + DiscountAccept, + #[serde(rename = "discount_decline")] + DiscountDecline, + #[serde(rename = "cancel")] + Cancel, +} + +#[derive(dto_bindgen::Dto)] +pub enum RadrootsOrderStatus { + #[serde(rename = "draft")] + Draft, + #[serde(rename = "validated")] + Validated, + #[serde(rename = "requested")] + Requested, + #[serde(rename = "questioned")] + Questioned, + #[serde(rename = "revised")] + Revised, + #[serde(rename = "accepted")] + Accepted, + #[serde(rename = "declined")] + Declined, + #[serde(rename = "cancelled")] + Cancelled, +} #[derive(dto_bindgen::Dto)] pub struct RadrootsTradeFacetCount { @@ -278,8 +422,8 @@ pub struct RadrootsTradeMarketplaceOrderSummary { pub listing_addr: String, pub buyer_pubkey: String, pub seller_pubkey: String, - pub status: RadrootsOrderStatusImport, - pub last_message_type: RadrootsCommercialMessageTypeImport, + pub status: RadrootsOrderStatus, + pub last_message_type: RadrootsCommercialMessageType, pub item_count: u32, pub total_bin_count: u32, pub has_requested_discounts: bool, @@ -351,7 +495,7 @@ pub struct RadrootsTradeOrderQuery { pub listing_addr: Option<String>, pub buyer_pubkey: Option<String>, pub seller_pubkey: Option<String>, - pub status: Option<RadrootsOrderStatusImport>, + pub status: Option<RadrootsOrderStatus>, } #[derive(dto_bindgen::Dto)] @@ -388,7 +532,7 @@ pub struct RadrootsTradeOrderWorkflowMessage { pub listing_event: Option<RadrootsNostrEventPtrImport>, pub root_event_id: Option<String>, pub prev_event_id: Option<String>, - pub payload: RadrootsCommercialMessagePayloadImport, + pub payload: RadrootsCommercialMessagePayload, } #[derive(dto_bindgen::Dto)] @@ -399,7 +543,7 @@ pub struct RadrootsTradeOrderWorkflowProjection { pub seller_pubkey: String, pub items: Vec<RadrootsOrderItemImport>, pub requested_discounts: Option<Vec<RadrootsOrderEconomicLineImport>>, - pub status: RadrootsOrderStatusImport, + pub status: RadrootsOrderStatus, pub listing_snapshot: Option<RadrootsNostrEventPtrImport>, pub root_event_id: String, pub last_event_id: String, @@ -416,7 +560,7 @@ pub struct RadrootsTradeOrderWorkflowProjection { pub discount_accept_count: u32, pub discount_decline_count: u32, pub cancellation_count: u32, - pub last_message_type: RadrootsCommercialMessageTypeImport, + pub last_message_type: RadrootsCommercialMessageType, pub last_actor_pubkey: String, } @@ -463,7 +607,11 @@ pub enum RadrootsTradeSortDirection { fn register(ctx: &mut DescribeCtx, rust_ident: &str, type_def: TypeDef) -> TypeRef { ctx.register_type( - RustTypeId::new("radroots_trade_bindings", rust_ident), + RustTypeId::new( + "radroots_trade_bindings", + "radroots_trade_bindings", + rust_ident, + ), type_def, ) } @@ -472,6 +620,21 @@ fn unit_variant(rust_name: &str, wire_name: &str, file: &str, line: u32) -> Vari VariantDef::new(rust_name, wire_name, VariantShape::Unit, span(file, line)) } +fn payload_variant( + rust_name: &str, + wire_name: &str, + ty: TypeRef, + file: &str, + line: u32, +) -> VariantDef { + VariantDef::new( + rust_name, + wire_name, + VariantShape::Newtype(ty), + span(file, line), + ) +} + fn field(rust_name: &str, wire_name: &str, ty: TypeRef, file: &str, line: u32) -> FieldDef { FieldDef::new( IdentName::new(rust_name), diff --git a/crates/trade_bindings/src/lib.rs b/crates/trade_bindings/src/lib.rs @@ -54,7 +54,8 @@ pub const TRADE_TYPE_INVENTORY: &[TradeTypeInventoryEntry] = &[ source_root("RadrootsTradeListingTotal"), local_shape("RadrootsTradeMarketplaceListingSummary"), local_shape("RadrootsTradeMarketplaceOrderSummary"), - event_import("RadrootsCommercialMessageType"), + local_shape("RadrootsCommercialMessagePayload"), + local_shape("RadrootsCommercialMessageType"), local_shape("RadrootsTradeModerationFlag"), local_shape("RadrootsTradeModerationSeverity"), local_shape("RadrootsTradeModerationStatus"), @@ -65,7 +66,7 @@ pub const TRADE_TYPE_INVENTORY: &[TradeTypeInventoryEntry] = &[ local_shape("RadrootsTradeOrderQuery"), local_shape("RadrootsTradeOrderSort"), local_shape("RadrootsTradeOrderSortField"), - event_import("RadrootsOrderStatus"), + local_shape("RadrootsOrderStatus"), local_shape("RadrootsTradeOrderWorkflowMessage"), local_shape("RadrootsTradeOrderWorkflowProjection"), local_shape("RadrootsTradeReviewPriority"), @@ -200,6 +201,7 @@ mod tests { "RadrootsTradeListingTotal", "RadrootsTradeMarketplaceListingSummary", "RadrootsTradeMarketplaceOrderSummary", + "RadrootsCommercialMessagePayload", "RadrootsCommercialMessageType", "RadrootsTradeModerationFlag", "RadrootsTradeModerationSeverity", @@ -233,8 +235,6 @@ mod tests { "RadrootsListingProduct", "RadrootsListingPublicLocation", "RadrootsListingStatus", - "RadrootsCommercialMessageType", - "RadrootsOrderStatus", ] { assert_eq!( disposition(export_name), diff --git a/crates/types_bindings/src/lib.rs b/crates/types_bindings/src/lib.rs @@ -80,7 +80,7 @@ fn field(name: &str, ty: TypeRef) -> FieldDef { } fn rust_id(name: &'static str) -> RustTypeId { - RustTypeId::new(env!("CARGO_PKG_NAME"), name) + RustTypeId::new(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_NAME"), name) } fn source_span() -> SourceSpan { diff --git a/packages/events-bindings/src/generated/types.ts b/packages/events-bindings/src/generated/types.ts @@ -1,10 +1,7 @@ // @generated by cargo xtask generate ts // Do not edit by hand. import type { - RadrootsCoreCurrency, - RadrootsCoreDecimal, RadrootsCoreDiscount, - RadrootsCoreDiscountValue, RadrootsCoreMoney, RadrootsCoreQuantity, RadrootsCoreQuantityPrice, @@ -21,18 +18,10 @@ export type RadrootsAccountClaim = { username: string, pubkey: string, nip05?: s export type RadrootsAppData = { d_tag: string, content: string, }; -export type RadrootsComment = { root: RadrootsNostrEventRef, parent: RadrootsNostrEventRef, content: string, }; +export type RadrootsComment = { root: RadrootsSocialTarget, parent: RadrootsSocialTarget, content: string, }; export type RadrootsCommercialDomain = "trade:listing"; -export type RadrootsCommercialEnvelope<T> = { version: number, domain: RadrootsCommercialDomain, type: RadrootsCommercialMessageType, order_id?: string | null, listing_addr: string, payload: T, }; - -export type RadrootsCommercialMessagePayload = { kind: "listing_validate_request", amount: RadrootsTradeListingValidateRequest, } | { kind: "listing_validate_result", amount: RadrootsTradeListingValidateResult, } | { kind: "trade_order_requested", amount: RadrootsOrderRequest, } | { kind: "order_response", amount: RadrootsOrderResponse, } | { kind: "order_revision", amount: RadrootsOrderRevision, } | { kind: "order_revision_accept", amount: RadrootsOrderRevisionResponse, } | { kind: "order_revision_decline", amount: RadrootsOrderRevisionResponse, } | { kind: "question", amount: RadrootsOrderQuestion, } | { kind: "answer", amount: RadrootsOrderAnswer, } | { kind: "discount_request", amount: RadrootsOrderDiscountRequest, } | { kind: "discount_offer", amount: RadrootsOrderDiscountOffer, } | { kind: "discount_accept", amount: RadrootsOrderDiscountDecision, } | { kind: "discount_decline", amount: RadrootsOrderDiscountDecision, } | { kind: "cancel", amount: RadrootsListingCancel, }; - -export type RadrootsCommercialMessageType = "listing_validate_request" | "listing_validate_result" | "order_request" | "order_response" | "order_revision" | "order_revision_accept" | "order_revision_decline" | "question" | "answer" | "discount_request" | "discount_offer" | "discount_accept" | "discount_decline" | "cancel"; - -export type RadrootsCommercialTransportLane = "service" | "public"; - export type RadrootsCoop = { d_tag: string, name: string, about?: string | null, website?: string | null, picture?: string | null, banner?: string | null, location?: RadrootsCoopLocation | null, tags?: Array<string> | null, }; export type RadrootsCoopLocation = { primary?: string | null, city?: string | null, region?: string | null, country?: string | null, gcs: RadrootsGcsLocation, }; @@ -81,13 +70,11 @@ export type RadrootsListEntry = { tag: string, values: Array<string>, }; export type RadrootsListSet = { d_tag: string, content: string, entries: Array<RadrootsListEntry>, title?: string | null, description?: string | null, image?: string | null, }; -export type RadrootsListing = { d_tag: string, published_at?: number | null, farm: RadrootsFarmRef, product: RadrootsListingProduct, primary_bin_id: string, bins: Array<RadrootsListingBin>, resource_area?: RadrootsResourceAreaRef | null, plot?: RadrootsPlotRef | null, discounts?: Array<RadrootsCoreDiscount> | null, inventory_available?: RadrootsCoreDecimal | null, availability?: RadrootsListingAvailability | null, delivery_method?: RadrootsListingDeliveryMethod | null, location?: RadrootsListingPublicLocation | null, images?: Array<RadrootsListingImage> | null, }; - -export type RadrootsListingAvailability = { kind: "window", amount: { start?: number | null, end?: number | null, }, } | { kind: "status", amount: { status: RadrootsListingStatus, }, }; +export type RadrootsListing = { d_tag: string, published_at?: string | null, farm?: RadrootsFarmRef, product: RadrootsListingProduct, primary_bin_id: string, bins: Array<RadrootsListingBin>, resource_area?: RadrootsResourceAreaRef | null, plot?: RadrootsPlotRef | null, discounts?: Array<RadrootsCoreDiscount> | null, inventory_available?: string | null, availability?: RadrootsListingAvailability | null, delivery_method?: RadrootsListingDeliveryMethod | null, location?: RadrootsListingPublicLocation | null, images?: Array<RadrootsListingImage> | null, }; -export type RadrootsListingBin = { bin_id: string, quantity: RadrootsCoreQuantity, price_per_canonical_unit: RadrootsCoreQuantityPrice, display_amount?: RadrootsCoreDecimal | null, display_unit?: RadrootsCoreUnit | null, display_label?: string | null, display_price?: RadrootsCoreMoney | null, display_price_unit?: RadrootsCoreUnit | null, }; +export type RadrootsListingAvailability = { kind: "window", amount: { start?: string | null, end?: string | null, }, } | { kind: "status", amount: { status: RadrootsListingStatus, }, }; -export type RadrootsListingCancel = { reason?: string | null, }; +export type RadrootsListingBin = { bin_id: string, quantity: RadrootsCoreQuantity, price_per_canonical_unit: RadrootsCoreQuantityPrice, display_amount?: string | null, display_unit?: RadrootsCoreUnit | null, display_label?: string | null, display_price?: RadrootsCoreMoney | null, display_price_unit?: RadrootsCoreUnit | null, }; export type RadrootsListingDeliveryMethod = { kind: "pickup", } | { kind: "local_delivery", } | { kind: "shipping", } | { kind: "other", amount: { method: string, }, }; @@ -107,7 +94,7 @@ export type RadrootsListingStatus = { kind: "active", } | { kind: "sold", } | { export type RadrootsMessage = { recipients: Array<RadrootsMessageRecipient>, content: string, reply_to?: RadrootsNostrEventPtr | null, subject?: string | null, }; -export type RadrootsMessageFile = { recipients: Array<RadrootsMessageRecipient>, file_url: string, reply_to?: RadrootsNostrEventPtr | null, subject?: string | null, file_type: string, encryption_algorithm: string, decryption_key: string, decryption_nonce: string, encrypted_hash: string, original_hash?: string | null, size?: number | null, dimensions?: RadrootsMessageFileDimensions | null, blurhash?: string | null, thumb?: string | null, fallbacks: Array<string>, }; +export type RadrootsMessageFile = { recipients: Array<RadrootsMessageRecipient>, file_url: string, reply_to?: RadrootsNostrEventPtr | null, subject?: string | null, file_type: string, encryption_algorithm: string, decryption_key: string, decryption_nonce: string, encrypted_hash: string, original_hash?: string | null, size?: string | null, dimensions?: RadrootsMessageFileDimensions | null, blurhash?: string | null, thumb?: string | null, fallbacks: Array<string>, }; export type RadrootsMessageFileDimensions = { w: number, h: number, }; @@ -119,27 +106,17 @@ export type RadrootsNostrEventPtr = { id: string, relays?: string | null, }; export type RadrootsNostrEventRef = { id: string, author: string, kind: number, d_tag?: string | null, relays?: Array<string> | null, }; -export type RadrootsOrderAnswer = { question_id: string, }; - export type RadrootsOrderCancellation = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, reason: string, }; -export type RadrootsOrderChange = { kind: "bin_count", amount: { item_index: number, bin_count: number, }, } | { kind: "item_add", amount: { item: RadrootsOrderItem, }, } | { kind: "item_remove", amount: { item_index: number, }, }; - export type RadrootsOrderDecision = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, decision: RadrootsOrderDecisionOutcome, }; export type RadrootsOrderDecisionOutcome = { decision: "accepted", inventory_commitments: Array<RadrootsOrderInventoryCommitment>, } | { decision: "declined", reason: string, }; -export type RadrootsOrderDiscountDecision = { kind: "accept", amount: { value: RadrootsCoreDiscountValue, }, } | { kind: "decline", amount: { reason?: string | null, }, }; - -export type RadrootsOrderDiscountOffer = { discount_id: string, value: RadrootsCoreDiscountValue, }; - -export type RadrootsOrderDiscountRequest = { discount_id: string, value: RadrootsCoreDiscountValue, }; - export type RadrootsOrderEconomicActor = "buyer" | "seller"; export type RadrootsOrderEconomicEffect = "increase" | "decrease"; -export type RadrootsOrderEconomicItem = { bin_id: string, bin_count: number, quantity_amount: RadrootsCoreDecimal, quantity_unit: RadrootsCoreUnit, unit_price_amount: RadrootsCoreDecimal, unit_price_currency: RadrootsCoreCurrency, line_subtotal: RadrootsCoreMoney, }; +export type RadrootsOrderEconomicItem = { bin_id: string, bin_count: number, quantity_amount: string, quantity_unit: RadrootsCoreUnit, unit_price_amount: string, unit_price_currency: string, line_subtotal: RadrootsCoreMoney, }; export type RadrootsOrderEconomicLine = { id: string, kind: RadrootsOrderEconomicLineKind, actor: RadrootsOrderEconomicActor, effect: RadrootsOrderEconomicEffect, amount: RadrootsCoreMoney, reason: string, }; @@ -147,9 +124,7 @@ export type RadrootsOrderEconomicLineKind = "listing_discount" | "basket_adjustm export type RadrootsOrderEconomicTotals = { subtotal: RadrootsCoreMoney, discount_total: RadrootsCoreMoney, adjustment_total: RadrootsCoreMoney, total: RadrootsCoreMoney, }; -export type RadrootsOrderEconomics = { quote_id: string, quote_version: number, pricing_basis: RadrootsOrderPricingBasis, currency: RadrootsCoreCurrency, items: Array<RadrootsOrderEconomicItem>, discounts: Array<RadrootsOrderEconomicLine>, adjustments: Array<RadrootsOrderEconomicLine>, subtotal: RadrootsCoreMoney, discount_total: RadrootsCoreMoney, adjustment_total: RadrootsCoreMoney, total: RadrootsCoreMoney, }; - -export type RadrootsOrderEnvelope<T> = { version: number, domain: RadrootsCommercialDomain, type: RadrootsOrderEventType, order_id: string, listing_addr: string, payload: T, }; +export type RadrootsOrderEconomics = { quote_id: string, quote_version: number, pricing_basis: RadrootsOrderPricingBasis, currency: string, items: Array<RadrootsOrderEconomicItem>, discounts: Array<RadrootsOrderEconomicLine>, adjustments: Array<RadrootsOrderEconomicLine>, subtotal: RadrootsCoreMoney, discount_total: RadrootsCoreMoney, adjustment_total: RadrootsCoreMoney, total: RadrootsCoreMoney, }; export type RadrootsOrderEventType = "TradeOrderRequested" | "TradeOrderDecision" | "TradeOrderRevisionProposed" | "TradeOrderRevisionDecision" | "TradeOrderCancelled"; @@ -159,37 +134,27 @@ export type RadrootsOrderItem = { bin_id: string, bin_count: number, }; export type RadrootsOrderPricingBasis = "listing_event"; -export type RadrootsOrderQuestion = { question_id: string, }; - export type RadrootsOrderRequest = { order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, items: Array<RadrootsOrderItem>, economics: RadrootsOrderEconomics, }; -export type RadrootsOrderResponse = { accepted: boolean, reason?: string | null, }; - -export type RadrootsOrderRevision = { revision_id: string, changes: Array<RadrootsOrderChange>, }; - export type RadrootsOrderRevisionDecision = { revision_id: string, order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, root_event_id: string, prev_event_id: string, decision: RadrootsOrderRevisionOutcome, }; export type RadrootsOrderRevisionOutcome = { decision: "accepted", } | { decision: "declined", reason: string, }; export type RadrootsOrderRevisionProposal = { revision_id: string, order_id: string, listing_addr: string, buyer_pubkey: string, seller_pubkey: string, root_event_id: string, prev_event_id: string, items: Array<RadrootsOrderItem>, economics: RadrootsOrderEconomics, reason: string, }; -export type RadrootsOrderRevisionResponse = { accepted: boolean, reason?: string | null, }; - -export type RadrootsOrderStatus = "draft" | "validated" | "requested" | "questioned" | "revised" | "accepted" | "declined" | "cancelled"; - export type RadrootsPlot = { d_tag: string, farm: RadrootsFarmRef, name: string, about?: string | null, location?: RadrootsPlotLocation | null, tags?: Array<string> | null, }; export type RadrootsPlotLocation = { primary?: string | null, city?: string | null, region?: string | null, country?: string | null, gcs: RadrootsGcsLocation, }; export type RadrootsPlotRef = { pubkey: string, d_tag: string, }; -export type RadrootsPost = { content: string, }; +export type RadrootsPost = { content: string, farm?: RadrootsSocialFarmAnchor | null, address_refs?: Array<RadrootsSocialTarget> | null, location?: RadrootsSocialLocation | null, topics?: Array<string> | null, quote_refs?: Array<RadrootsSocialTarget> | null, media?: Array<RadrootsSocialMediaMetadata> | null, }; export type RadrootsProfile = { name: string, display_name?: string | null, nip05?: string | null, about?: string | null, website?: string | null, picture?: string | null, banner?: string | null, lud06?: string | null, lud16?: string | null, bot?: string | null, }; export type RadrootsProfileType = "individual" | "farm" | "coop" | "any" | "radrootsd"; -export type RadrootsReaction = { root: RadrootsNostrEventRef, content: string, }; +export type RadrootsReaction = { target: RadrootsSocialTarget, content: string, }; export type RadrootsRelayDocument = { name?: string | null, description?: string | null, pubkey?: string | null, contact?: string | null, supported_nips?: Array<number> | null, software?: string | null, version?: string | null, }; @@ -199,14 +164,26 @@ export type RadrootsResourceAreaLocation = { primary?: string | null, city?: str export type RadrootsResourceAreaRef = { pubkey: string, d_tag: string, }; -export type RadrootsResourceHarvestCap = { d_tag: string, resource_area: RadrootsResourceAreaRef, product: RadrootsResourceHarvestProduct, start: bigint, end: bigint, cap_quantity: RadrootsCoreQuantity, display_amount?: RadrootsCoreDecimal | null, display_unit?: RadrootsCoreUnit | null, display_label?: string | null, tags?: Array<string> | null, }; +export type RadrootsResourceHarvestCap = { d_tag: string, resource_area: RadrootsResourceAreaRef, product: RadrootsResourceHarvestProduct, start: string, end: string, cap_quantity: RadrootsCoreQuantity, display_amount?: string | null, display_unit?: RadrootsCoreUnit | null, display_label?: string | null, tags?: Array<string> | null, }; export type RadrootsResourceHarvestProduct = { key: string, category?: string | null, }; export type RadrootsSeal = { content: string, }; +export type RadrootsSocialFarmAnchor = { farm: RadrootsFarmRef, relays?: Array<string> | null, }; + +export type RadrootsSocialLocation = { name?: string | null, geohash?: string | null, }; + +export type RadrootsSocialMediaDimensions = { width: number, height: number, }; + +export type RadrootsSocialMediaMetadata = { url?: string | null, mime_type?: string | null, sha256?: string | null, original_sha256?: string | null, size?: string | null, dimensions?: RadrootsSocialMediaDimensions | null, blurhash?: string | null, thumbnails?: Array<RadrootsSocialMediaThumbnail> | null, image?: string | null, summary?: string | null, alt?: string | null, fallback?: string | null, magnet?: string | null, content_hashes?: Array<string> | null, services?: Array<string> | null, imeta?: Array<Array<string>> | null, }; + +export type RadrootsSocialMediaThumbnail = { url: string, dimensions?: RadrootsSocialMediaDimensions | null, }; + +export type RadrootsSocialTarget = { kind: "event", id: string, author?: string | null, event_kind?: number | null, relays?: Array<string> | null, } | { kind: "address", address: string, author?: string | null, event_kind?: number | null, relays?: Array<string> | null, } | { kind: "external", id: string, external_kind: string, hint?: string | null, }; + export type RadrootsTradeListingValidateRequest = { listing_event?: RadrootsNostrEventPtr | null, }; -export type RadrootsTradeListingValidateResult = { valid: boolean, errors: Array<RadrootsTradeListingValidationError>, }; +export type RadrootsTradeListingValidateResult = { valid: boolean, errors: Array<RadrootsTradeValidationListingError>, }; -export type RadrootsTradeListingValidationError = { kind: "invalid_kind", amount: { kind: number, }, } | { kind: "missing_listing_id", } | { kind: "listing_event_not_found", amount: { listing_addr: string, }, } | { kind: "listing_event_fetch_failed", amount: { listing_addr: string, }, } | { kind: "parse_error", amount: { error: RadrootsListingParseError, }, } | { kind: "invalid_seller", } | { kind: "missing_farm_profile", } | { kind: "missing_farm_record", } | { kind: "missing_title", } | { kind: "missing_description", } | { kind: "missing_product_type", } | { kind: "missing_bins", } | { kind: "missing_primary_bin", } | { kind: "invalid_bin", } | { kind: "missing_price", } | { kind: "invalid_price", } | { kind: "missing_inventory", } | { kind: "invalid_inventory", } | { kind: "missing_availability", } | { kind: "missing_location", } | { kind: "missing_delivery_method", }; +export type RadrootsTradeValidationListingError = { kind: "invalid_kind", amount: { kind: number, }, } | { kind: "missing_listing_id", } | { kind: "listing_event_not_found", amount: { listing_addr: string, }, } | { kind: "listing_event_fetch_failed", amount: { listing_addr: string, }, } | { kind: "parse_error", amount: { error: RadrootsListingParseError, }, } | { kind: "invalid_seller", } | { kind: "missing_farm_profile", } | { kind: "missing_farm_record", } | { kind: "missing_title", } | { kind: "missing_description", } | { kind: "missing_product_type", } | { kind: "missing_bins", } | { kind: "missing_primary_bin", } | { kind: "invalid_bin", } | { kind: "missing_price", } | { kind: "invalid_price", } | { kind: "missing_inventory", } | { kind: "invalid_inventory", } | { kind: "missing_availability", } | { kind: "missing_location", } | { kind: "missing_location_locality", } | { kind: "missing_location_geohash", } | { kind: "invalid_location_geohash", } | { kind: "missing_delivery_method", }; diff --git a/packages/trade-bindings/src/generated/types.ts b/packages/trade-bindings/src/generated/types.ts @@ -10,8 +10,6 @@ import type { RadrootsCoreUnit, } from "@radroots/core-bindings"; import type { - RadrootsCommercialMessagePayload, - RadrootsCommercialMessageType, RadrootsFarmRef, RadrootsListing, RadrootsListingAvailability, @@ -21,13 +19,25 @@ import type { RadrootsListingProduct, RadrootsListingPublicLocation, RadrootsNostrEventPtr, + RadrootsOrderCancellation, + RadrootsOrderDecision, RadrootsOrderEconomicLine, RadrootsOrderItem, - RadrootsOrderStatus, + RadrootsOrderRequest, + RadrootsOrderRevisionDecision, + RadrootsOrderRevisionProposal, RadrootsPlotRef, RadrootsResourceAreaRef, + RadrootsTradeListingValidateRequest, + RadrootsTradeListingValidateResult, } from "@radroots/events-bindings"; +export type RadrootsCommercialMessagePayload = { listing_validate_request: RadrootsTradeListingValidateRequest, } | { listing_validate_result: RadrootsTradeListingValidateResult, } | { trade_order_requested: RadrootsOrderRequest, } | { order_response: RadrootsOrderDecision, } | { order_revision: RadrootsOrderRevisionProposal, } | { order_revision_accept: RadrootsOrderRevisionDecision, } | { order_revision_decline: RadrootsOrderRevisionDecision, } | { cancel: RadrootsOrderCancellation, }; + +export type RadrootsCommercialMessageType = "listing_validate_request" | "listing_validate_result" | "order_request" | "order_response" | "order_revision" | "order_revision_accept" | "order_revision_decline" | "question" | "answer" | "discount_request" | "discount_offer" | "discount_accept" | "discount_decline" | "cancel"; + +export type RadrootsOrderStatus = "draft" | "validated" | "requested" | "questioned" | "revised" | "accepted" | "declined" | "cancelled"; + export type RadrootsTradeFacetCount = { key: string, count: number, }; export type RadrootsTradeListing = { listing_id: string, listing_addr: string, seller_pubkey: string, title: string, description: string, product_type: string, primary_bin_id: string, bin_quantity: RadrootsCoreQuantity, unit: RadrootsCoreUnit, unit_price: RadrootsCoreMoney, inventory_available: RadrootsCoreDecimal, availability: RadrootsListingAvailability, location: RadrootsListingPublicLocation, delivery_method: RadrootsListingDeliveryMethod, listing: RadrootsListing, }; diff --git a/tools/xtask/src/dto_render.rs b/tools/xtask/src/dto_render.rs @@ -487,15 +487,13 @@ fn render_primitive( if primitive.requires_explicit_integer_policy() { return match int_repr { Some(IntRepr::JsonString) => Ok("string".to_owned()), - Some(IntRepr::JsonNumberUnsafe) => Ok("number".to_owned()), - Some(IntRepr::NonJsonBigint) => Ok("bigint".to_owned()), + Some(IntRepr::JsonNumber) => Ok("number".to_owned()), None => match options.config.numeric.large_int_policy { LargeIntPolicy::RequireExplicit => { Err("large integer field requires explicit numeric policy".to_owned()) } LargeIntPolicy::JsonString => Ok("string".to_owned()), - LargeIntPolicy::JsonNumberUnsafe => Ok("number".to_owned()), - LargeIntPolicy::NonJsonBigint => Ok("bigint".to_owned()), + LargeIntPolicy::JsonNumber => Ok("number".to_owned()), }, }; } @@ -642,7 +640,7 @@ mod tests { fn renders_synthetic_registry_as_package_level_types() { let mut registry = Registry::new(); let external_id = registry.register_type( - RustTypeId::new("external", "ExternalThing"), + RustTypeId::new("external", "external", "ExternalThing"), TypeDef::Struct(StructDef::new("ExternalThing", "ExternalThing", span())), ); let envelope = TypeDef::Struct(StructDef { @@ -653,7 +651,7 @@ mod tests { TypeRef::GenericParam("T".to_owned()), )) }); - registry.register_type(RustTypeId::new("sdk", "Envelope"), envelope); + registry.register_type(RustTypeId::new("sdk", "sdk", "Envelope"), envelope); let thing = TypeDef::Struct( StructDef::new("SyntheticThing", "SyntheticThing", span()) .with_field(field("external", "external", TypeRef::Named(external_id))) @@ -680,7 +678,7 @@ mod tests { )), )), ); - registry.register_type(RustTypeId::new("sdk", "SyntheticThing"), thing); + registry.register_type(RustTypeId::new("sdk", "sdk", "SyntheticThing"), thing); let mode = TypeDef::Enum( EnumDef::new("SyntheticMode", "SyntheticMode", EnumRepr::External, span()) .with_variant(VariantDef::new( @@ -691,7 +689,7 @@ mod tests { )) .with_variant(VariantDef::new("Done", "done", VariantShape::Unit, span())), ); - registry.register_type(RustTypeId::new("sdk", "SyntheticMode"), mode); + registry.register_type(RustTypeId::new("sdk", "sdk", "SyntheticMode"), mode); let event = TypeDef::Enum( EnumDef::new( "SyntheticEvent", @@ -718,7 +716,7 @@ mod tests { span(), )), ); - registry.register_type(RustTypeId::new("sdk", "SyntheticEvent"), event); + registry.register_type(RustTypeId::new("sdk", "sdk", "SyntheticEvent"), event); let rendered = render_registry_types( &registry, @@ -744,7 +742,7 @@ mod tests { fn imports_typescript_overrides_when_configured() { let mut registry = Registry::new(); registry.register_type( - RustTypeId::new("sdk", "SyntheticThing"), + RustTypeId::new("sdk", "sdk", "SyntheticThing"), TypeDef::Struct( StructDef::new("SyntheticThing", "SyntheticThing", span()).with_field(field( "external", @@ -778,7 +776,7 @@ mod tests { fn renders_untagged_object_unions() { let mut registry = Registry::new(); registry.register_type( - RustTypeId::new("sdk", "Query"), + RustTypeId::new("sdk", "sdk", "Query"), TypeDef::Enum( EnumDef::new("Query", "Query", EnumRepr::Untagged, span()) .with_variant(VariantDef::new( @@ -809,7 +807,7 @@ mod tests { fn renders_untagged_newtype_aliases() { let mut registry = Registry::new(); registry.register_type( - RustTypeId::new("sdk", "FindOneResolve"), + RustTypeId::new("sdk", "sdk", "FindOneResolve"), TypeDef::Enum( EnumDef::new( "FindOneResolve", @@ -842,7 +840,7 @@ mod tests { fn rejects_untagged_unit_variants() { let mut registry = Registry::new(); registry.register_type( - RustTypeId::new("sdk", "MaybeReady"), + RustTypeId::new("sdk", "sdk", "MaybeReady"), TypeDef::Enum( EnumDef::new("MaybeReady", "MaybeReady", EnumRepr::Untagged, span()).with_variant( VariantDef::new("Ready", "ready", VariantShape::Unit, span()), @@ -863,7 +861,7 @@ mod tests { fn requires_explicit_large_integer_policy() { let mut registry = Registry::new(); registry.register_type( - RustTypeId::new("sdk", "Counter"), + RustTypeId::new("sdk", "sdk", "Counter"), TypeDef::Struct( StructDef::new("Counter", "Counter", span()).with_field(field( "value", @@ -886,16 +884,16 @@ mod tests { fn propagates_integer_policy_through_transparent_containers_only() { let mut registry = Registry::new(); let counter_id = registry.register_type( - RustTypeId::new("sdk", "Counter"), + RustTypeId::new("sdk", "sdk", "Counter"), TypeDef::Struct( StructDef::new("Counter", "Counter", span()).with_field( field("value", "value", TypeRef::Primitive(Primitive::U64)) - .with_int_repr(IntRepr::JsonNumberUnsafe), + .with_int_repr(IntRepr::JsonNumber), ), ), ); registry.register_type( - RustTypeId::new("sdk", "TransparentCounters"), + RustTypeId::new("sdk", "sdk", "TransparentCounters"), TypeDef::Struct( StructDef::new("TransparentCounters", "TransparentCounters", span()) .with_field( @@ -954,7 +952,7 @@ mod tests { fn renders_external_data_enums() { let mut registry = Registry::new(); registry.register_type( - RustTypeId::new("sdk", "ParseError"), + RustTypeId::new("sdk", "sdk", "ParseError"), TypeDef::Enum( EnumDef::new("ParseError", "ParseError", EnumRepr::External, span()) .with_variant(VariantDef::new( diff --git a/tools/xtask/src/dto_roots.rs b/tools/xtask/src/dto_roots.rs @@ -1,4 +1,4 @@ -use dto_bindgen_core::{Registry, RootDescriptor, RustTypeId, TypeId, build_registry}; +use dto_bindgen_core::{Registry, RootDescriptor, TypeDef, TypeId, build_registry}; use crate::dto_render::{DtoRegistryRenderOptions, DtoTypesModule, render_registry_types}; @@ -235,9 +235,13 @@ fn core_import_options( fn core_type_id(registry: &Registry, rust_ident: &str) -> Option<TypeId> { registry - .rust_id_to_type_id - .get(&RustTypeId::new("radroots_core", rust_ident)) - .copied() + .types_by_id + .iter() + .find_map(|(type_id, type_def)| match type_def { + TypeDef::Struct(def) if def.export_name == rust_ident => Some(*type_id), + TypeDef::Enum(def) if def.export_name == rust_ident => Some(*type_id), + _ => None, + }) } fn trade_import_options(mut options: DtoRegistryRenderOptions) -> DtoRegistryRenderOptions { @@ -266,13 +270,17 @@ fn trade_import_options(mut options: DtoRegistryRenderOptions) -> DtoRegistryRen "RadrootsListingPublicLocation", "RadrootsListingStatus", "RadrootsNostrEventPtr", + "RadrootsOrderCancellation", + "RadrootsOrderDecision", "RadrootsPlotRef", "RadrootsResourceAreaRef", - "RadrootsCommercialMessagePayload", - "RadrootsCommercialMessageType", "RadrootsOrderEconomicLine", "RadrootsOrderItem", - "RadrootsOrderStatus", + "RadrootsOrderRequest", + "RadrootsOrderRevisionDecision", + "RadrootsOrderRevisionProposal", + "RadrootsTradeListingValidateRequest", + "RadrootsTradeListingValidateResult", ] { options = options.with_external_override(export_name, export_name, "@radroots/events-bindings"); @@ -373,10 +381,6 @@ mod tests { "RadrootsAppData", "RadrootsComment", "RadrootsCommercialDomain", - "RadrootsCommercialEnvelope", - "RadrootsCommercialMessagePayload", - "RadrootsCommercialMessageType", - "RadrootsCommercialTransportLane", "RadrootsCoop", "RadrootsCoopLocation", "RadrootsCoopRef", @@ -404,7 +408,6 @@ mod tests { "RadrootsListing", "RadrootsListingAvailability", "RadrootsListingBin", - "RadrootsListingCancel", "RadrootsListingDeliveryMethod", "RadrootsListingImage", "RadrootsListingImageSize", @@ -420,14 +423,9 @@ mod tests { "RadrootsNostrEvent", "RadrootsNostrEventPtr", "RadrootsNostrEventRef", - "RadrootsOrderAnswer", "RadrootsOrderCancellation", - "RadrootsOrderChange", "RadrootsOrderDecision", "RadrootsOrderDecisionOutcome", - "RadrootsOrderDiscountDecision", - "RadrootsOrderDiscountOffer", - "RadrootsOrderDiscountRequest", "RadrootsOrderEconomicActor", "RadrootsOrderEconomicEffect", "RadrootsOrderEconomicItem", @@ -435,20 +433,14 @@ mod tests { "RadrootsOrderEconomicLineKind", "RadrootsOrderEconomicTotals", "RadrootsOrderEconomics", - "RadrootsOrderEnvelope", "RadrootsOrderEventType", "RadrootsOrderInventoryCommitment", "RadrootsOrderItem", "RadrootsOrderPricingBasis", - "RadrootsOrderQuestion", "RadrootsOrderRequest", - "RadrootsOrderResponse", - "RadrootsOrderRevision", "RadrootsOrderRevisionDecision", "RadrootsOrderRevisionOutcome", "RadrootsOrderRevisionProposal", - "RadrootsOrderRevisionResponse", - "RadrootsOrderStatus", "RadrootsPlot", "RadrootsPlotLocation", "RadrootsPlotRef", @@ -463,9 +455,15 @@ mod tests { "RadrootsResourceHarvestCap", "RadrootsResourceHarvestProduct", "RadrootsSeal", + "RadrootsSocialFarmAnchor", + "RadrootsSocialLocation", + "RadrootsSocialMediaDimensions", + "RadrootsSocialMediaMetadata", + "RadrootsSocialMediaThumbnail", + "RadrootsSocialTarget", "RadrootsTradeListingValidateRequest", "RadrootsTradeListingValidateResult", - "RadrootsTradeListingValidationError", + "RadrootsTradeValidationListingError", ]; const EVENTS_INDEXED_TYPE_INVENTORY: &[&str] = &[ "RadrootsEventsIndexedShardId", @@ -476,6 +474,9 @@ mod tests { "RadrootsEventsIndexedIndexCheckpoint", ]; const TRADE_TYPE_INVENTORY: &[&str] = &[ + "RadrootsCommercialMessagePayload", + "RadrootsCommercialMessageType", + "RadrootsOrderStatus", "RadrootsTradeFacetCount", "RadrootsTradeListing", "RadrootsTradeListingBackofficeOverlay", @@ -643,8 +644,6 @@ mod tests { for duplicate in [ "export type RadrootsListing = ", "export type RadrootsFarmRef = ", - "export type RadrootsCommercialMessageType = ", - "export type RadrootsOrderStatus = ", ] { assert!(!TRADE_BINDINGS_TYPES_TS.contains(duplicate)); }