lib

Core libraries for Radroots
git clone https://radroots.dev/git/lib.git
Log | Files | Refs | README

commit db352eac57658b672c6f2920693eaa92c7436ed2
parent 57394009fea0b6291d6c2f068d60fbfa139362b2
Author: triesap <tyson@radroots.org>
Date:   Sat, 11 Jul 2026 22:22:49 +0000

crate-surface: delete types bindings package

- remove the retired types_bindings crate and generated TypeScript package
- generate replica schema bindings with source-owned result contracts
- align SDK Rust dependencies with singular event crate names
- update package matrices, locks, provenance, and checks for the removed package

Diffstat:
Mcrates/replica_sync_wasm/Cargo.toml | 2+-
Mcrates/replica_sync_wasm/src/lib.rs | 2+-
Mcrates/sdk/Cargo.toml | 18+++++++++---------
Mcrates/sdk/examples/runtime_local.rs | 8++++----
Mcrates/sdk/examples/sdk_v1_listing_prepare.rs | 8++++----
Mcrates/sdk/examples/sdk_v1_local_enqueue_and_mock_sync.rs | 8++++----
Mcrates/sdk/src/actor_json.rs | 2+-
Mcrates/sdk/src/adapters/radrootsd.rs | 2+-
Mcrates/sdk/src/adapters/signing.rs | 2+-
Mcrates/sdk/src/dvm_runtime.rs | 8++++----
Mcrates/sdk/src/farm.rs | 8++++----
Mcrates/sdk/src/farms_runtime.rs | 4++--
Mcrates/sdk/src/idempotency.rs | 2+-
Mcrates/sdk/src/knowledge.rs | 8++++----
Mcrates/sdk/src/listings_runtime.rs | 2+-
Mcrates/sdk/src/market_runtime.rs | 2+-
Mcrates/sdk/src/order.rs | 24++++++++++++------------
Mcrates/sdk/src/orders_runtime.rs | 32++++++++++++++++----------------
Mcrates/sdk/src/private_store.rs | 2+-
Mcrates/sdk/src/signer_provider.rs | 6+++---
Mcrates/sdk/src/sync_runtime.rs | 6+++---
Mcrates/sdk/src/trade_storage.rs | 6+++---
Mcrates/sdk/src/workflow_runtime.rs | 8++++----
Mcrates/sdk/tests/dvm_runtime.rs | 10+++++-----
Mcrates/sdk/tests/farms_runtime.rs | 6+++---
Mcrates/sdk/tests/listings_runtime.rs | 6+++---
Mcrates/sdk/tests/market_runtime.rs | 4++--
Mcrates/sdk/tests/orders_runtime.rs | 20++++++++++----------
Mcrates/sdk/tests/replica_ingest.rs | 5++---
Mcrates/sdk/tests/runtime_foundation.rs | 2+-
Mcrates/sdk/tests/support/fixture_signer.rs | 4++--
Mcrates/sdk/tests/sync_runtime.rs | 6+++---
Mcrates/sdk/tests/trade_product_publish_runtime.rs | 2+-
Mcrates/sdk/tests/trade_public_api.rs | 2+-
Mcrates/sdk/tests/unit/actor_json_tests.rs | 2+-
Mcrates/sdk/tests/unit/adapters_nostr_tests.rs | 2+-
Mcrates/sdk/tests/unit/adapters_signing_tests.rs | 2+-
Mcrates/sdk/tests/unit/dvm_runtime_tests.rs | 2+-
Mcrates/sdk/tests/unit/error_tests.rs | 4++--
Mcrates/sdk/tests/unit/idempotency_tests.rs | 2+-
Mcrates/sdk/tests/unit/listings_runtime_tests.rs | 2+-
Mcrates/sdk/tests/unit/orders_runtime_tests.rs | 4++--
Mcrates/sdk/tests/unit/private_store_tests.rs | 4++--
Mcrates/sdk/tests/unit/runtime_tests.rs | 6+++---
Mcrates/sdk/tests/unit/signer_provider_tests.rs | 6+++---
Mcrates/sdk/tests/unit/sync_runtime_tests.rs | 14+++++++-------
Mcrates/sdk/tests/unit/workflow_runtime_tests.rs | 10+++++-----
Mtools/sdk_xtask_import/Cargo.toml | 5++---
Mtools/sdk_xtask_import/src/contracts.rs | 12++----------
Mtools/sdk_xtask_import/src/dto_roots.rs | 82++++++++++++++++++++++++-------------------------------------------------------
Mtools/sdk_xtask_import/src/output.rs | 17+++--------------
Mtools/sdk_xtask_import/src/package_matrix.rs | 11++---------
52 files changed, 182 insertions(+), 242 deletions(-)

diff --git a/crates/replica_sync_wasm/Cargo.toml b/crates/replica_sync_wasm/Cargo.toml @@ -16,7 +16,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] base64 = { workspace = true } -radroots_events = { workspace = true, default-features = false, features = [ +radroots_event = { workspace = true, default-features = false, features = [ "serde", ] } radroots_sdk_sql_wasm_runtime = { workspace = true } diff --git a/crates/replica_sync_wasm/src/lib.rs b/crates/replica_sync_wasm/src/lib.rs @@ -4,7 +4,7 @@ use base64::Engine; #[cfg(target_arch = "wasm32")] use base64::engine::general_purpose::URL_SAFE_NO_PAD; -use radroots_events::RadrootsEventEnvelope; +use radroots_event::RadrootsEventEnvelope; use radroots_replica_sync::RadrootsReplicaSyncRequest; #[cfg(target_arch = "wasm32")] use radroots_replica_sync::{ diff --git a/crates/sdk/Cargo.toml b/crates/sdk/Cargo.toml @@ -13,22 +13,22 @@ readme = "README" [features] default = ["std", "serde", "serde_json", "identity-models"] -std = ["radroots_events/std", "radroots_events_codec/std", "radroots_trade/std"] -serde = ["dep:serde", "radroots_events/serde", "radroots_trade/serde"] +std = ["radroots_event/std", "radroots_event_codec/std", "radroots_trade/std"] +serde = ["dep:serde", "radroots_event/serde", "radroots_trade/serde"] serde_json = [ "dep:serde_json", "serde", "nostr", - "radroots_events_codec/serde_json", + "radroots_event_codec/serde_json", "radroots_trade/serde_json", ] -nostr = ["radroots_events_codec/nostr"] +nostr = ["radroots_event_codec/nostr"] knowledge = [ "serde", "serde_json", - "radroots_events/knowledge-nip54", - "radroots_events_codec/contract-manifest", - "radroots_events_codec/knowledge-nip54", + "radroots_event/knowledge-nip54", + "radroots_event_codec/contract-manifest", + "radroots_event_codec/knowledge-nip54", ] identity-models = [ "dep:radroots_identity", @@ -121,8 +121,8 @@ test-fixture-geonames-asset = [ futures = { workspace = true, optional = true } radroots_authority = { workspace = true, optional = true, default-features = false } radroots_event_store = { workspace = true, optional = true, default-features = false } -radroots_events = { workspace = true, default-features = false } -radroots_events_codec = { workspace = true, default-features = false } +radroots_event = { workspace = true, default-features = false } +radroots_event_codec = { workspace = true, default-features = false } radroots_geocoder = { workspace = true, optional = true } radroots_outbox = { workspace = true, optional = true, default-features = false } radroots_transport = { workspace = true, optional = true, default-features = false } diff --git a/crates/sdk/examples/runtime_local.rs b/crates/sdk/examples/runtime_local.rs @@ -3,10 +3,10 @@ use radroots_core::{ RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreQuantity, RadrootsCoreQuantityPrice, RadrootsCoreUnit, }; -use radroots_events::contract::RadrootsActorRole; -use radroots_events::farm::RadrootsFarmRef; -use radroots_events::ids::{RadrootsDTag, RadrootsInventoryBinId}; -use radroots_events::listing::{RadrootsListing, RadrootsListingBin, RadrootsListingProduct}; +use radroots_event::contract::RadrootsActorRole; +use radroots_event::farm::RadrootsFarmRef; +use radroots_event::ids::{RadrootsDTag, RadrootsInventoryBinId}; +use radroots_event::listing::{RadrootsListing, RadrootsListingBin, RadrootsListingProduct}; use radroots_nostr::prelude::RadrootsNostrKeys; use radroots_sdk::{ ListingPreparePublishRequest, NostrRelayUrlPolicy, PushOutboxRequest, RadrootsClient, diff --git a/crates/sdk/examples/sdk_v1_listing_prepare.rs b/crates/sdk/examples/sdk_v1_listing_prepare.rs @@ -3,10 +3,10 @@ use radroots_core::{ RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreQuantity, RadrootsCoreQuantityPrice, RadrootsCoreUnit, }; -use radroots_events::contract::RadrootsActorRole; -use radroots_events::farm::RadrootsFarmRef; -use radroots_events::ids::{RadrootsDTag, RadrootsInventoryBinId}; -use radroots_events::listing::{RadrootsListing, RadrootsListingBin, RadrootsListingProduct}; +use radroots_event::contract::RadrootsActorRole; +use radroots_event::farm::RadrootsFarmRef; +use radroots_event::ids::{RadrootsDTag, RadrootsInventoryBinId}; +use radroots_event::listing::{RadrootsListing, RadrootsListingBin, RadrootsListingProduct}; use radroots_sdk::{ListingPreparePublishRequest, RadrootsClient, RadrootsSdkTimestamp}; const SELLER: &str = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; diff --git a/crates/sdk/examples/sdk_v1_local_enqueue_and_mock_sync.rs b/crates/sdk/examples/sdk_v1_local_enqueue_and_mock_sync.rs @@ -3,10 +3,10 @@ use radroots_core::{ RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreQuantity, RadrootsCoreQuantityPrice, RadrootsCoreUnit, }; -use radroots_events::contract::RadrootsActorRole; -use radroots_events::farm::RadrootsFarmRef; -use radroots_events::ids::{RadrootsDTag, RadrootsInventoryBinId}; -use radroots_events::listing::{RadrootsListing, RadrootsListingBin, RadrootsListingProduct}; +use radroots_event::contract::RadrootsActorRole; +use radroots_event::farm::RadrootsFarmRef; +use radroots_event::ids::{RadrootsDTag, RadrootsInventoryBinId}; +use radroots_event::listing::{RadrootsListing, RadrootsListingBin, RadrootsListingProduct}; use radroots_nostr::prelude::RadrootsNostrKeys; use radroots_sdk::{ ListingPreparePublishRequest, NostrRelayUrlPolicy, PushOutboxRequest, RadrootsClient, diff --git a/crates/sdk/src/actor_json.rs b/crates/sdk/src/actor_json.rs @@ -1,5 +1,5 @@ use radroots_authority::{RadrootsActorContext, RadrootsActorSource}; -use radroots_events::contract::RadrootsActorRole; +use radroots_event::contract::RadrootsActorRole; use serde::{Serialize, ser::SerializeStruct}; pub(crate) struct SdkActorContextJson<'a>(pub(crate) &'a RadrootsActorContext); diff --git a/crates/sdk/src/adapters/radrootsd.rs b/crates/sdk/src/adapters/radrootsd.rs @@ -1,7 +1,7 @@ use core::fmt; use core::time::Duration; -use radroots_events::draft::RadrootsSignedEvent; +use radroots_event::draft::RadrootsSignedEvent; use radroots_transport_publish_protocol::{ METHOD_EVENT, SignedNostrEventWire, TransportPublishDeliveryPolicy, TransportPublishEventRequest, TransportPublishEventResponse, TransportPublishProtocolError, diff --git a/crates/sdk/src/adapters/signing.rs b/crates/sdk/src/adapters/signing.rs @@ -1,5 +1,5 @@ use crate::identity::RadrootsIdentity; -use radroots_events_codec::wire::WireEventParts; +use radroots_event_codec::wire::WireEventParts; use radroots_nostr::prelude::{RadrootsNostrError, radroots_nostr_build_event}; pub type SignedNostrEvent = radroots_nostr::prelude::RadrootsNostrEvent; diff --git a/crates/sdk/src/dvm_runtime.rs b/crates/sdk/src/dvm_runtime.rs @@ -12,16 +12,16 @@ use crate::{ #[cfg(feature = "runtime")] use radroots_authority::{RadrootsActorContext, RadrootsEventSigner, authorize_actor_for_draft}; #[cfg(feature = "runtime")] -use radroots_event_store::RadrootsEventIngest; -#[cfg(feature = "runtime")] -use radroots_events::{ +use radroots_event::{ RadrootsEventEnvelope, draft::RadrootsEventDraft, ids::{RadrootsEventId, RadrootsListingAddress, RadrootsOrderId, RadrootsPublicKey}, kinds::KIND_TRADE_TRANSITION_PROOF_REQUEST, }; #[cfg(feature = "runtime")] -use radroots_events_codec::wire::{WireEventParts, canonicalize_tags, to_frozen_draft}; +use radroots_event_codec::wire::{WireEventParts, canonicalize_tags, to_frozen_draft}; +#[cfg(feature = "runtime")] +use radroots_event_store::RadrootsEventIngest; #[cfg(feature = "runtime")] use radroots_trade::dvm::RadrootsTradeInventoryBinWitnessDto; #[cfg(feature = "runtime")] diff --git a/crates/sdk/src/farm.rs b/crates/sdk/src/farm.rs @@ -1,9 +1,9 @@ -pub use radroots_events::farm::*; +pub use radroots_event::farm::*; -pub use radroots_events_codec::error::EventEncodeError; +pub use radroots_event_codec::error::EventEncodeError; -use radroots_events_codec::wire::WireEventParts; +use radroots_event_codec::wire::WireEventParts; pub fn build_draft(farm: &RadrootsFarm) -> Result<WireEventParts, EventEncodeError> { - radroots_events_codec::farm::encode::to_wire_parts(farm) + radroots_event_codec::farm::encode::to_wire_parts(farm) } diff --git a/crates/sdk/src/farms_runtime.rs b/crates/sdk/src/farms_runtime.rs @@ -14,7 +14,7 @@ use crate::{ #[cfg(feature = "runtime")] use radroots_authority::{RadrootsActorContext, RadrootsEventSigner}; #[cfg(feature = "runtime")] -use radroots_events::{ +use radroots_event::{ contract::RadrootsActorRole, draft::RadrootsEventDraft, farm::{RadrootsFarm, RadrootsFarmPublicLocation}, @@ -23,7 +23,7 @@ use radroots_events::{ listing::RadrootsListingPublicLocation, }; #[cfg(feature = "runtime")] -use radroots_events_codec::wire::to_frozen_draft; +use radroots_event_codec::wire::to_frozen_draft; #[cfg(feature = "runtime")] pub const FARM_PUBLISH_OPERATION_KIND: &str = "farm.publish.v1"; diff --git a/crates/sdk/src/idempotency.rs b/crates/sdk/src/idempotency.rs @@ -1,6 +1,6 @@ use crate::RadrootsSdkError; use core::fmt; -use radroots_events::ids::{RadrootsEventId, RadrootsPublicKey}; +use radroots_event::ids::{RadrootsEventId, RadrootsPublicKey}; use serde::ser::SerializeStruct; use sha2::{Digest, Sha256}; diff --git a/crates/sdk/src/knowledge.rs b/crates/sdk/src/knowledge.rs @@ -11,7 +11,7 @@ use std::{ use core::fmt; -pub use radroots_events::{ +pub use radroots_event::{ RadrootsEventEnvelope, RadrootsEventRef, draft::{RadrootsDraftError, RadrootsEventDraft}, kinds::{ @@ -37,7 +37,7 @@ pub use radroots_events::{ validate_knowledge_claim, validate_wiki_article, validate_wiki_d_tag, }, }; -pub use radroots_events_codec::{ +pub use radroots_event_codec::{ RADROOTS_KNOWLEDGE_CONTRACT_MANIFEST_SCHEMA_VERSION, error::RadrootsEncodeError, manifest::{ @@ -52,11 +52,11 @@ pub use radroots_events_codec::{ wire::WireEventParts, }; -use radroots_events::knowledge::{ +use radroots_event::knowledge::{ validate_knowledge_field_report, validate_knowledge_relation, validate_knowledge_review, validate_knowledge_source, validate_wiki_merge_request, validate_wiki_redirect, }; -use radroots_events_codec::{ +use radroots_event_codec::{ contract_manifest_json as codec_contract_manifest_json, contract_manifest_sha256 as codec_contract_manifest_sha256, knowledge::{ diff --git a/crates/sdk/src/listings_runtime.rs b/crates/sdk/src/listings_runtime.rs @@ -9,7 +9,7 @@ use crate::{ #[cfg(feature = "runtime")] use radroots_authority::{RadrootsActorContext, RadrootsEventSigner}; #[cfg(feature = "runtime")] -use radroots_events::{ +use radroots_event::{ draft::RadrootsEventDraft, ids::{RadrootsEventId, RadrootsListingAddress}, listing::RadrootsListing, diff --git a/crates/sdk/src/market_runtime.rs b/crates/sdk/src/market_runtime.rs @@ -5,7 +5,7 @@ use crate::{ MarketClient, RadrootsSdkError, SyncProjectionRefreshReceipt, SyncProjectionRefreshRequest, }; #[cfg(feature = "runtime")] -use radroots_events::ids::{RadrootsEventId, RadrootsListingAddress, RadrootsPublicKey}; +use radroots_event::ids::{RadrootsEventId, RadrootsListingAddress, RadrootsPublicKey}; #[cfg(feature = "runtime")] use radroots_trade::projection::{ RadrootsListingProjectionRow, RadrootsListingSearchRequest, search_listing_projection, diff --git a/crates/sdk/src/order.rs b/crates/sdk/src/order.rs @@ -1,13 +1,13 @@ -pub use radroots_events::order::*; +pub use radroots_event::order::*; #[cfg(any(feature = "signer-adapters", test))] -pub use radroots_events_codec::error::EventEncodeError; -pub use radroots_events_codec::order::RadrootsOrderEnvelopeParseError; +pub use radroots_event_codec::error::EventEncodeError; +pub use radroots_event_codec::order::RadrootsOrderEnvelopeParseError; -use radroots_events::RadrootsEventEnvelope; +use radroots_event::RadrootsEventEnvelope; #[cfg(any(feature = "signer-adapters", test))] -use radroots_events::{RadrootsEventPtr, ids::RadrootsEventId, tags::TAG_E}; +use radroots_event::{RadrootsEventPtr, ids::RadrootsEventId, tags::TAG_E}; #[cfg(any(feature = "signer-adapters", test))] -use radroots_events_codec::wire::WireEventParts; +use radroots_event_codec::wire::WireEventParts; #[cfg(any(feature = "signer-adapters", test))] #[derive(Debug, Clone)] @@ -91,7 +91,7 @@ pub fn build_order_request_draft( payload: &RadrootsOrderRequest, ) -> Result<RadrootsOrderRequestDraft, EventEncodeError> { Ok(RadrootsOrderRequestDraft { - parts: radroots_events_codec::order::order_request_event_build(listing_event, payload)?, + parts: radroots_event_codec::order::order_request_event_build(listing_event, payload)?, }) } @@ -103,7 +103,7 @@ pub fn build_order_decision_draft( ) -> Result<RadrootsOrderDecisionDraft, EventEncodeError> { Ok(RadrootsOrderDecisionDraft { parts: with_contract_root_event_tag( - radroots_events_codec::order::order_decision_event_build( + radroots_event_codec::order::order_decision_event_build( root_event_id, prev_event_id, payload, @@ -121,7 +121,7 @@ pub fn build_order_revision_proposal_draft( ) -> Result<RadrootsOrderRevisionProposalDraft, EventEncodeError> { Ok(RadrootsOrderRevisionProposalDraft { parts: with_contract_root_event_tag( - radroots_events_codec::order::order_revision_proposal_event_build( + radroots_event_codec::order::order_revision_proposal_event_build( root_event_id, prev_event_id, payload, @@ -139,7 +139,7 @@ pub fn build_order_revision_decision_draft( ) -> Result<RadrootsOrderRevisionDecisionDraft, EventEncodeError> { Ok(RadrootsOrderRevisionDecisionDraft { parts: with_contract_root_event_tag( - radroots_events_codec::order::order_revision_decision_event_build( + radroots_event_codec::order::order_revision_decision_event_build( root_event_id, prev_event_id, payload, @@ -157,7 +157,7 @@ pub fn build_order_cancellation_draft( ) -> Result<RadrootsOrderCancellationDraft, EventEncodeError> { Ok(RadrootsOrderCancellationDraft { parts: with_contract_root_event_tag( - radroots_events_codec::order::order_cancellation_event_build( + radroots_event_codec::order::order_cancellation_event_build( root_event_id, prev_event_id, payload, @@ -170,5 +170,5 @@ pub fn build_order_cancellation_draft( pub fn parse_order_request( event: &RadrootsEventEnvelope, ) -> Result<RadrootsOrderEnvelope<RadrootsOrderRequest>, RadrootsOrderEnvelopeParseError> { - radroots_events_codec::order::order_request_from_event(event) + radroots_event_codec::order::order_request_from_event(event) } diff --git a/crates/sdk/src/orders_runtime.rs b/crates/sdk/src/orders_runtime.rs @@ -25,12 +25,8 @@ use crate::{ use radroots_authority::RadrootsActorContext; #[cfg(all(feature = "runtime", test))] use radroots_authority::RadrootsEventSigner; -#[cfg(all(feature = "runtime", feature = "transport-nostr-runtime"))] -use radroots_event_store::RadrootsStoredEventTag; -#[cfg(feature = "runtime")] -use radroots_event_store::{RadrootsEventIngest, RadrootsStoredEvent}; #[cfg(feature = "runtime")] -use radroots_events::{ +use radroots_event::{ RadrootsEventEnvelope, contract::RadrootsActorRole, ids::RadrootsEventId, @@ -42,7 +38,7 @@ use radroots_events::{ tags::TAG_P, }; #[cfg(any(feature = "signer-adapters", test))] -use radroots_events::{ +use radroots_event::{ RadrootsEventPtr, draft::RadrootsEventDraft, ids::RadrootsOrderRevisionId, @@ -53,22 +49,26 @@ use radroots_events::{ }, }; #[cfg(any(feature = "runtime", feature = "signer-adapters", test))] -use radroots_events::{ +use radroots_event::{ ids::{RadrootsListingAddress, RadrootsOrderId, RadrootsPublicKey}, order::RadrootsOrderEconomics, }; #[cfg(all(feature = "runtime", feature = "transport-nostr-runtime"))] -use radroots_events::{ +use radroots_event::{ kinds::KIND_LISTING, tags::{TAG_D, TAG_E}, }; #[cfg(feature = "runtime")] -use radroots_events_codec::order::{ +use radroots_event_codec::order::{ order_cancellation_from_event, order_decision_from_event, order_request_from_event, order_revision_decision_from_event, order_revision_proposal_from_event, }; #[cfg(any(feature = "signer-adapters", test))] -use radroots_events_codec::wire::{WireEventParts, to_frozen_draft}; +use radroots_event_codec::wire::{WireEventParts, to_frozen_draft}; +#[cfg(all(feature = "runtime", feature = "transport-nostr-runtime"))] +use radroots_event_store::RadrootsStoredEventTag; +#[cfg(feature = "runtime")] +use radroots_event_store::{RadrootsEventIngest, RadrootsStoredEvent}; #[cfg(all(feature = "runtime", feature = "transport-nostr-runtime"))] use radroots_nostr::prelude::{ RadrootsNostrEventId, RadrootsNostrFilter, RadrootsNostrKind, RadrootsNostrPublicKey, @@ -6440,7 +6440,7 @@ fn parse_order_evidence( #[cfg(feature = "runtime")] fn order_evidence_parse_error( - error: radroots_events_codec::order::RadrootsOrderEnvelopeParseError, + error: radroots_event_codec::order::RadrootsOrderEnvelopeParseError, ) -> RadrootsSdkError { RadrootsSdkError::InvalidRequest { message: format!("order evidence event is invalid: {error}"), @@ -7167,14 +7167,14 @@ where trait OrderPayloadValidate { fn validate_order_payload( &self, - ) -> Result<(), radroots_events::order::RadrootsOrderPayloadError>; + ) -> Result<(), radroots_event::order::RadrootsOrderPayloadError>; } #[cfg(any(feature = "signer-adapters", test))] impl OrderPayloadValidate for RadrootsOrderDecision { fn validate_order_payload( &self, - ) -> Result<(), radroots_events::order::RadrootsOrderPayloadError> { + ) -> Result<(), radroots_event::order::RadrootsOrderPayloadError> { self.validate() } } @@ -7183,7 +7183,7 @@ impl OrderPayloadValidate for RadrootsOrderDecision { impl OrderPayloadValidate for RadrootsOrderRevisionProposal { fn validate_order_payload( &self, - ) -> Result<(), radroots_events::order::RadrootsOrderPayloadError> { + ) -> Result<(), radroots_event::order::RadrootsOrderPayloadError> { self.validate() } } @@ -7192,7 +7192,7 @@ impl OrderPayloadValidate for RadrootsOrderRevisionProposal { impl OrderPayloadValidate for RadrootsOrderRevisionDecision { fn validate_order_payload( &self, - ) -> Result<(), radroots_events::order::RadrootsOrderPayloadError> { + ) -> Result<(), radroots_event::order::RadrootsOrderPayloadError> { self.validate() } } @@ -7201,7 +7201,7 @@ impl OrderPayloadValidate for RadrootsOrderRevisionDecision { impl OrderPayloadValidate for RadrootsOrderCancellation { fn validate_order_payload( &self, - ) -> Result<(), radroots_events::order::RadrootsOrderPayloadError> { + ) -> Result<(), radroots_event::order::RadrootsOrderPayloadError> { self.validate() } } diff --git a/crates/sdk/src/private_store.rs b/crates/sdk/src/private_store.rs @@ -1,7 +1,7 @@ #![cfg(feature = "runtime")] use crate::RadrootsSdkError; -use radroots_events::ids::RadrootsAddressableCoordinate; +use radroots_event::ids::RadrootsAddressableCoordinate; use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions}; use sqlx::{Row, SqlitePool}; use std::path::Path; diff --git a/crates/sdk/src/signer_provider.rs b/crates/sdk/src/signer_provider.rs @@ -6,9 +6,9 @@ use radroots_authority::{ RadrootsActorContext, RadrootsEventSigner, RadrootsSignerError, authorize_actor_for_draft, authorize_signer_for_draft, sign_authorized_draft, validate_signed_event_matches_draft, }; -use radroots_events::draft::{RadrootsEventDraft, RadrootsSignedEvent}; -use radroots_events::ids::RadrootsPublicKey; -use radroots_events::kinds::{ +use radroots_event::draft::{RadrootsEventDraft, RadrootsSignedEvent}; +use radroots_event::ids::RadrootsPublicKey; +use radroots_event::kinds::{ KIND_FARM, KIND_LISTING, KIND_ORDER_CANCELLATION, KIND_ORDER_DECISION, KIND_ORDER_REQUEST, KIND_ORDER_REVISION_DECISION, KIND_ORDER_REVISION_PROPOSAL, }; diff --git a/crates/sdk/src/sync_runtime.rs b/crates/sdk/src/sync_runtime.rs @@ -12,9 +12,9 @@ use crate::{ #[cfg(all(feature = "runtime", feature = "radrootsd-proxy"))] use crate::{ProxyAuth, ProxyProfile}; #[cfg(feature = "runtime")] -use radroots_event_store::{RADROOTS_EVENT_STORE_QUERY_LIMIT_MAX, RadrootsEventStoreStatusSummary}; +use radroots_event::ids::RadrootsEventId; #[cfg(feature = "runtime")] -use radroots_events::ids::RadrootsEventId; +use radroots_event_store::{RADROOTS_EVENT_STORE_QUERY_LIMIT_MAX, RadrootsEventStoreStatusSummary}; #[cfg(all(feature = "runtime", feature = "transport-nostr-runtime"))] use radroots_nostr::prelude::RadrootsNostrClient; #[cfg(all(feature = "runtime", feature = "radrootsd-proxy"))] @@ -1663,7 +1663,7 @@ fn proxy_error_message(error: &RadrootsdError) -> String { #[cfg(all(feature = "runtime", feature = "radrootsd-proxy"))] fn proxy_transport_error_receipt( claimed: &RadrootsOutboxClaimedEvent, - event: &radroots_events::draft::RadrootsSignedEvent, + event: &radroots_event::draft::RadrootsSignedEvent, delivery_policy: &TransportPublishDeliveryPolicy, message: String, ) -> Result<PushOutboxEventReceipt, RadrootsSdkError> { diff --git a/crates/sdk/src/trade_storage.rs b/crates/sdk/src/trade_storage.rs @@ -2,7 +2,7 @@ use std::collections::BTreeMap; #[cfg(feature = "runtime")] -use radroots_events::ids::{RadrootsEventId, RadrootsOrderId}; +use radroots_event::ids::{RadrootsEventId, RadrootsOrderId}; #[cfg(feature = "runtime")] use radroots_trade::{ identity::{RadrootsTradeId, RadrootsTradeLocator, RadrootsTradeLocatorCandidate}, @@ -83,10 +83,10 @@ mod tests { SDK_TRADE_PROJECTION_CACHE_VERSION, SdkTradeProjectionCache, SdkTradeProjectionCacheKey, SdkTradeProjectionCacheRecord, }; - use radroots_events::ids::{ + use radroots_event::ids::{ RadrootsEventId, RadrootsListingAddress, RadrootsOrderId, RadrootsPublicKey, }; - use radroots_events::kinds::KIND_LISTING; + use radroots_event::kinds::KIND_LISTING; use radroots_trade::{identity::RadrootsTradeLocator, workflow::RadrootsTradeWorkflowState}; const SELLER: &str = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"; diff --git a/crates/sdk/src/workflow_runtime.rs b/crates/sdk/src/workflow_runtime.rs @@ -5,14 +5,14 @@ use crate::{ SdkIdempotencyKey, TargetPolicy, TargetSet, TransportProfile, runtime::sdk_now_ms, }; use radroots_authority::{RadrootsActorContext, RadrootsEventSigner, sign_authorized_draft}; -use radroots_event_store::{ - RadrootsEventIngest, RadrootsTransportObservation, RadrootsTransportObservationType, -}; -use radroots_events::{ +use radroots_event::{ RadrootsEventEnvelope, draft::{RadrootsEventDraft, RadrootsSignedEvent}, ids::RadrootsEventId, }; +use radroots_event_store::{ + RadrootsEventIngest, RadrootsTransportObservation, RadrootsTransportObservationType, +}; use radroots_outbox::{ RadrootsOutboxDeliveryPlanInput, RadrootsOutboxEnqueueStatus, RadrootsOutboxReticulumPreviewBehavior, RadrootsOutboxSignedOperationInput, diff --git a/crates/sdk/tests/dvm_runtime.rs b/crates/sdk/tests/dvm_runtime.rs @@ -6,8 +6,7 @@ use radroots_authority::{ use radroots_core::{ RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreUnit, }; -use radroots_event_store::{RadrootsEventIngest, RadrootsEventStore}; -use radroots_events::{ +use radroots_event::{ RadrootsEventEnvelope, RadrootsEventPtr, contract::RadrootsActorRole, draft::{RadrootsEventDraft, RadrootsSignedEvent}, @@ -22,6 +21,7 @@ use radroots_events::{ RadrootsOrderItem, RadrootsOrderPricingBasis, RadrootsOrderRequest, }, }; +use radroots_event_store::{RadrootsEventIngest, RadrootsEventStore}; use radroots_nostr::prelude::{ RadrootsNostrKeys, RadrootsNostrSecretKey, RadrootsNostrTimestamp, radroots_event_from_nostr, radroots_nostr_build_event, radroots_nostr_sign_frozen_draft, @@ -783,7 +783,7 @@ fn order_decision(raw_order_id: &str) -> RadrootsOrderDecision { } fn signed_order_request_event(raw_order_id: &str, created_at: u32) -> RadrootsEventEnvelope { - let draft = radroots_events_codec::order::order_request_event_build( + let draft = radroots_event_codec::order::order_request_event_build( &listing_event_ptr(), &order_request(raw_order_id), ) @@ -796,7 +796,7 @@ fn signed_order_decision_event( root_event_id: &RadrootsEventId, created_at: u32, ) -> RadrootsEventEnvelope { - let draft = radroots_events_codec::order::order_decision_event_build( + let draft = radroots_event_codec::order::order_decision_event_build( root_event_id, root_event_id, &order_decision(raw_order_id), @@ -845,7 +845,7 @@ fn signed_validation_receipt_event( fn signed_event( secret_key_hex: &str, created_at: u32, - parts: radroots_events_codec::wire::WireEventParts, + parts: radroots_event_codec::wire::WireEventParts, ) -> RadrootsEventEnvelope { let secret_key = RadrootsNostrSecretKey::from_hex(secret_key_hex).expect("secret key"); let keys = RadrootsNostrKeys::new(secret_key); diff --git a/crates/sdk/tests/farms_runtime.rs b/crates/sdk/tests/farms_runtime.rs @@ -3,14 +3,14 @@ use radroots_authority::{ RadrootsActorContext, RadrootsEventSigner, RadrootsSignerError, RadrootsSignerIdentity, }; -use radroots_event_store::RadrootsEventStore; -use radroots_events::{ +use radroots_event::{ contract::RadrootsActorRole, draft::{RadrootsEventDraft, RadrootsSignedEvent, RadrootsSignedEventParts}, farm::RadrootsFarm, ids::RadrootsAddressableCoordinate, kinds::{KIND_FARM, KIND_PROFILE}, }; +use radroots_event_store::RadrootsEventStore; use radroots_outbox::{ RadrootsOutbox, RadrootsOutboxDeliveryPlanStatus, RadrootsOutboxDeliveryTargetStatus, RadrootsOutboxEventState, @@ -60,7 +60,7 @@ impl FixtureSigner { } impl RadrootsEventSigner for FixtureSigner { - fn pubkey(&self) -> &radroots_events::ids::RadrootsPublicKey { + fn pubkey(&self) -> &radroots_event::ids::RadrootsPublicKey { self.identity.pubkey() } diff --git a/crates/sdk/tests/listings_runtime.rs b/crates/sdk/tests/listings_runtime.rs @@ -7,8 +7,7 @@ use radroots_core::{ RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreQuantity, RadrootsCoreQuantityPrice, RadrootsCoreUnit, }; -use radroots_event_store::RadrootsEventStore; -use radroots_events::{ +use radroots_event::{ contract::RadrootsActorRole, draft::{RadrootsEventDraft, RadrootsSignedEvent, RadrootsSignedEventParts}, farm::RadrootsFarmRef, @@ -16,6 +15,7 @@ use radroots_events::{ kinds::KIND_LISTING, listing::{RadrootsListing, RadrootsListingBin, RadrootsListingProduct}, }; +use radroots_event_store::RadrootsEventStore; use radroots_outbox::{ RadrootsOutbox, RadrootsOutboxDeliveryPlanStatus, RadrootsOutboxDeliveryTargetStatus, RadrootsOutboxEventState, @@ -66,7 +66,7 @@ impl FixtureSigner { } impl RadrootsEventSigner for FixtureSigner { - fn pubkey(&self) -> &radroots_events::ids::RadrootsPublicKey { + fn pubkey(&self) -> &radroots_event::ids::RadrootsPublicKey { self.identity.pubkey() } diff --git a/crates/sdk/tests/market_runtime.rs b/crates/sdk/tests/market_runtime.rs @@ -7,7 +7,7 @@ use radroots_core::{ RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreQuantity, RadrootsCoreQuantityPrice, RadrootsCoreUnit, }; -use radroots_events::{ +use radroots_event::{ contract::RadrootsActorRole, draft::{RadrootsEventDraft, RadrootsSignedEvent}, farm::RadrootsFarmRef, @@ -54,7 +54,7 @@ impl FixtureSigner { } impl RadrootsEventSigner for FixtureSigner { - fn pubkey(&self) -> &radroots_events::ids::RadrootsPublicKey { + fn pubkey(&self) -> &radroots_event::ids::RadrootsPublicKey { self.identity.pubkey() } diff --git a/crates/sdk/tests/orders_runtime.rs b/crates/sdk/tests/orders_runtime.rs @@ -14,10 +14,9 @@ use radroots_authority::RadrootsActorContext; use radroots_core::{ RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreUnit, }; -use radroots_event_store::{RadrootsEventIngest, RadrootsEventStore}; #[cfg(feature = "transport-nostr-runtime")] -use radroots_events::ids::RadrootsPublicKey; -use radroots_events::{ +use radroots_event::ids::RadrootsPublicKey; +use radroots_event::{ RadrootsEventEnvelope, RadrootsEventPtr, contract::RadrootsActorRole, ids::{RadrootsEventId, RadrootsListingAddress, RadrootsOrderId, RadrootsOrderRevisionId}, @@ -32,7 +31,8 @@ use radroots_events::{ RadrootsOrderRevisionOutcome, }, }; -use radroots_events_codec::wire::WireEventParts; +use radroots_event_codec::wire::WireEventParts; +use radroots_event_store::{RadrootsEventIngest, RadrootsEventStore}; use radroots_nostr::prelude::{ RadrootsNostrKeys, RadrootsNostrSecretKey, RadrootsNostrTimestamp, radroots_event_from_nostr, radroots_nostr_build_event, @@ -428,14 +428,14 @@ impl FixtureSigner { #[cfg(any())] impl radroots_authority::RadrootsEventSigner for FixtureSigner { - fn pubkey(&self) -> &radroots_events::ids::RadrootsPublicKey { + fn pubkey(&self) -> &radroots_event::ids::RadrootsPublicKey { self.identity.pubkey() } fn sign_frozen_draft( &self, - draft: &radroots_events::draft::RadrootsEventDraft, - ) -> Result<radroots_events::draft::RadrootsSignedEvent, radroots_authority::RadrootsSignerError> + draft: &radroots_event::draft::RadrootsEventDraft, + ) -> Result<radroots_event::draft::RadrootsSignedEvent, radroots_authority::RadrootsSignerError> { radroots_nostr::prelude::radroots_nostr_sign_frozen_draft(&self.keys, draft).map_err( |error| radroots_authority::RadrootsSignerError::SigningFailed { @@ -4202,7 +4202,7 @@ fn signed_raw_event(secret_key_hex: &str, created_at: u32, parts: WireEventParts } fn signed_order_request_event(raw_order_id: &str, created_at: u32) -> RadrootsEventEnvelope { - let draft = radroots_events_codec::order::order_request_event_build( + let draft = radroots_event_codec::order::order_request_event_build( &listing_event_ptr(), &order_request(raw_order_id), ) @@ -4212,7 +4212,7 @@ fn signed_order_request_event(raw_order_id: &str, created_at: u32) -> RadrootsEv #[cfg(feature = "transport-nostr-runtime")] fn signed_raw_order_request_event(raw_order_id: &str, created_at: u32) -> nostr::Event { - let draft = radroots_events_codec::order::order_request_event_build( + let draft = radroots_event_codec::order::order_request_event_build( &listing_event_ptr(), &order_request(raw_order_id), ) @@ -4255,7 +4255,7 @@ fn signed_order_decision_event( root_event_id: &RadrootsEventId, created_at: u32, ) -> RadrootsEventEnvelope { - let draft = radroots_events_codec::order::order_decision_event_build( + let draft = radroots_event_codec::order::order_decision_event_build( root_event_id, root_event_id, &order_decision(raw_order_id), diff --git a/crates/sdk/tests/replica_ingest.rs b/crates/sdk/tests/replica_ingest.rs @@ -1,4 +1,4 @@ -use radroots_events::{RadrootsEventEnvelope, farm::RadrootsFarm}; +use radroots_event::{RadrootsEventEnvelope, farm::RadrootsFarm}; use radroots_replica_db::ReplicaSql; use radroots_replica_db_schema::farm::IFarmFindMany; use radroots_replica_sync::{RadrootsReplicaIngestOutcome, radroots_replica_ingest_event}; @@ -56,8 +56,7 @@ fn open_replica() -> (TempDir, ReplicaSql<SqliteExecutor>) { fn ingest_farm(replica: &ReplicaSql<SqliteExecutor>) -> RadrootsEventEnvelope { let farm_value = sample_farm(); let author = seller_pubkey(); - let parts = - radroots_events_codec::farm::encode::to_wire_parts(&farm_value).expect("farm draft"); + let parts = radroots_event_codec::farm::encode::to_wire_parts(&farm_value).expect("farm draft"); let event = sdk_event( 1, &author, diff --git a/crates/sdk/tests/runtime_foundation.rs b/crates/sdk/tests/runtime_foundation.rs @@ -1,6 +1,6 @@ #![cfg(feature = "runtime")] -use radroots_events::ids::RadrootsOrderId; +use radroots_event::ids::RadrootsOrderId; use radroots_sdk::{ BackupRequest, IntegrityRequest, LISTING_PUBLISH_OPERATION_KIND, NostrProfile, NostrRelayUrlPolicy, RadrootsClient, RadrootsSdkClock, RadrootsSdkError, RadrootsSdkErrorClass, diff --git a/crates/sdk/tests/support/fixture_signer.rs b/crates/sdk/tests/support/fixture_signer.rs @@ -1,5 +1,5 @@ use radroots_authority::{RadrootsEventSigner, RadrootsSignerError, RadrootsSignerIdentity}; -use radroots_events::draft::{RadrootsEventDraft, RadrootsSignedEvent, RadrootsSignedEventParts}; +use radroots_event::draft::{RadrootsEventDraft, RadrootsSignedEvent, RadrootsSignedEventParts}; #[derive(Clone)] pub struct FixtureSigner { @@ -15,7 +15,7 @@ impl FixtureSigner { } impl RadrootsEventSigner for FixtureSigner { - fn pubkey(&self) -> &radroots_events::ids::RadrootsPublicKey { + fn pubkey(&self) -> &radroots_event::ids::RadrootsPublicKey { self.identity.pubkey() } diff --git a/crates/sdk/tests/sync_runtime.rs b/crates/sdk/tests/sync_runtime.rs @@ -8,14 +8,14 @@ use radroots_core::{ RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreQuantity, RadrootsCoreQuantityPrice, RadrootsCoreUnit, }; -use radroots_event_store::{RadrootsEventStore, RadrootsTransportObservationType}; -use radroots_events::{ +use radroots_event::{ contract::RadrootsActorRole, draft::{RadrootsEventDraft, RadrootsSignedEvent, RadrootsSignedEventParts}, farm::RadrootsFarmRef, ids::{RadrootsDTag, RadrootsEventId, RadrootsInventoryBinId}, listing::{RadrootsListing, RadrootsListingBin, RadrootsListingProduct}, }; +use radroots_event_store::{RadrootsEventStore, RadrootsTransportObservationType}; use radroots_outbox::{ RadrootsOutbox, RadrootsOutboxDeliveryTargetStatus, RadrootsOutboxEventState, RadrootsOutboxOperationInput, RadrootsOutboxSignedOperationInput, @@ -375,7 +375,7 @@ impl FixtureSigner { } impl RadrootsEventSigner for FixtureSigner { - fn pubkey(&self) -> &radroots_events::ids::RadrootsPublicKey { + fn pubkey(&self) -> &radroots_event::ids::RadrootsPublicKey { self.identity.pubkey() } diff --git a/crates/sdk/tests/trade_product_publish_runtime.rs b/crates/sdk/tests/trade_product_publish_runtime.rs @@ -9,7 +9,7 @@ use radroots_authority::RadrootsActorContext; use radroots_core::{ RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreUnit, }; -use radroots_events::{ +use radroots_event::{ RadrootsEventPtr, contract::RadrootsActorRole, ids::RadrootsListingAddress, diff --git a/crates/sdk/tests/trade_public_api.rs b/crates/sdk/tests/trade_public_api.rs @@ -1,7 +1,7 @@ #![cfg(feature = "runtime")] use radroots_authority::RadrootsActorContext; -use radroots_events::contract::RadrootsActorRole; +use radroots_event::contract::RadrootsActorRole; use radroots_sdk::{ RadrootsClient, TradeResyncRequest, TradeSellerInboxRequest, TradeStatusKind, TradeStatusRequest, TradeValidationReceiptListRequest, diff --git a/crates/sdk/tests/unit/actor_json_tests.rs b/crates/sdk/tests/unit/actor_json_tests.rs @@ -1,6 +1,6 @@ use super::{SdkActorContextJson, actor_role_code, actor_source_code}; use radroots_authority::{RadrootsActorContext, RadrootsActorSource}; -use radroots_events::contract::RadrootsActorRole; +use radroots_event::contract::RadrootsActorRole; #[path = "../support/serializer_failure.rs"] mod serializer_failure; diff --git a/crates/sdk/tests/unit/adapters_nostr_tests.rs b/crates/sdk/tests/unit/adapters_nostr_tests.rs @@ -5,7 +5,7 @@ use super::{ use crate::adapters::signing::sign_parts_with_identity; use crate::identity::RadrootsIdentity; use core::time::Duration; -use radroots_events_codec::wire::WireEventParts; +use radroots_event_codec::wire::WireEventParts; use radroots_nostr::prelude::RadrootsNostrClientOptions; use tokio::runtime::Runtime; diff --git a/crates/sdk/tests/unit/adapters_signing_tests.rs b/crates/sdk/tests/unit/adapters_signing_tests.rs @@ -1,6 +1,6 @@ use super::{event_builder_from_parts, sign_parts_with_identity}; use crate::identity::RadrootsIdentity; -use radroots_events_codec::wire::WireEventParts; +use radroots_event_codec::wire::WireEventParts; #[test] fn event_builder_from_parts_preserves_kind_and_content() { diff --git a/crates/sdk/tests/unit/dvm_runtime_tests.rs b/crates/sdk/tests/unit/dvm_runtime_tests.rs @@ -8,7 +8,7 @@ use crate::{ SyncProjectionRefreshRequest, TargetPolicy, }; use radroots_authority::RadrootsActorContext; -use radroots_events::{ +use radroots_event::{ RadrootsEventEnvelope, contract::RadrootsActorRole, ids::{RadrootsEventId, RadrootsInventoryBinId, RadrootsListingAddress, RadrootsPublicKey}, diff --git a/crates/sdk/tests/unit/error_tests.rs b/crates/sdk/tests/unit/error_tests.rs @@ -5,7 +5,7 @@ use super::{ use crate::privacy::{PrivacyPreflightStatus, ProductSensitivityField}; use crate::transport::ReticulumPreviewBehavior; use radroots_authority::RadrootsAuthorityError; -use radroots_events::contract::RadrootsActorRole; +use radroots_event::contract::RadrootsActorRole; use radroots_geocoder::{GeoNamesAssetFetcher, GeoNamesBlockingHttpFetcher, GeocoderError}; #[test] @@ -102,7 +102,7 @@ fn listing_and_store_errors_convert_to_sdk_error_classes() { let draft_fallback = RadrootsSdkError::from( radroots_trade::listing::RadrootsListingDraftError::InvalidFarmPubkey( - radroots_events::ids::RadrootsIdParseError::InvalidCharacter, + radroots_event::ids::RadrootsIdParseError::InvalidCharacter, ), ); assert!(matches!( diff --git a/crates/sdk/tests/unit/idempotency_tests.rs b/crates/sdk/tests/unit/idempotency_tests.rs @@ -1,6 +1,6 @@ use super::{SdkIdempotencyKey, SdkTradeIdempotencyRecord}; use crate::RadrootsSdkError; -use radroots_events::ids::{RadrootsEventId, RadrootsPublicKey}; +use radroots_event::ids::{RadrootsEventId, RadrootsPublicKey}; #[path = "../support/serializer_failure.rs"] mod serializer_failure; diff --git a/crates/sdk/tests/unit/listings_runtime_tests.rs b/crates/sdk/tests/unit/listings_runtime_tests.rs @@ -4,7 +4,7 @@ use radroots_core::{ RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreQuantity, RadrootsCoreQuantityPrice, RadrootsCoreUnit, }; -use radroots_events::{ +use radroots_event::{ contract::RadrootsActorRole, farm::RadrootsFarmRef, ids::{RadrootsDTag, RadrootsInventoryBinId}, diff --git a/crates/sdk/tests/unit/orders_runtime_tests.rs b/crates/sdk/tests/unit/orders_runtime_tests.rs @@ -4,8 +4,7 @@ use radroots_authority::{RadrootsSignerError, RadrootsSignerIdentity}; use radroots_core::{ RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreUnit, }; -use radroots_event_store::RadrootsEventStoreError; -use radroots_events::{ +use radroots_event::{ draft::RadrootsSignedEvent, kinds::KIND_LISTING, order::{ @@ -14,6 +13,7 @@ use radroots_events::{ RadrootsOrderRevisionOutcome, }, }; +use radroots_event_store::RadrootsEventStoreError; use radroots_nostr::prelude::{ RadrootsNostrKeys, RadrootsNostrSecretKey, radroots_nostr_sign_frozen_draft, }; diff --git a/crates/sdk/tests/unit/private_store_tests.rs b/crates/sdk/tests/unit/private_store_tests.rs @@ -1,5 +1,5 @@ use super::*; -use radroots_events::ids::RadrootsAddressableCoordinate; +use radroots_event::ids::RadrootsAddressableCoordinate; use sqlx::sqlite::{SqliteConnectOptions, SqlitePoolOptions}; fn farm_addr() -> RadrootsAddressableCoordinate { @@ -9,7 +9,7 @@ fn farm_addr() -> RadrootsAddressableCoordinate { fn farm_addr_for(d_tag: &str) -> RadrootsAddressableCoordinate { RadrootsAddressableCoordinate::parse(format!( "{}:{}:{}", - radroots_events::kinds::KIND_FARM, + radroots_event::kinds::KIND_FARM, "a".repeat(64), d_tag )) diff --git a/crates/sdk/tests/unit/runtime_tests.rs b/crates/sdk/tests/unit/runtime_tests.rs @@ -165,9 +165,9 @@ fn manifest() -> SdkBackupManifest { fn private_farm_location_record() -> crate::private_store::SdkPrivateFarmLocationRecord { crate::private_store::SdkPrivateFarmLocationRecord { - farm_addr: radroots_events::ids::RadrootsAddressableCoordinate::parse(format!( + farm_addr: radroots_event::ids::RadrootsAddressableCoordinate::parse(format!( "{}:{}:{}", - radroots_events::kinds::KIND_FARM, + radroots_event::kinds::KIND_FARM, "a".repeat(64), "AAAAAAAAAAAAAAAAAAAAAA" )) @@ -1607,7 +1607,7 @@ async fn restore_archive_private_failures_cover_staging_and_verification_edges() populated_sdk ._event_store .ingest_event(radroots_event_store::RadrootsEventIngest::new( - radroots_events::RadrootsEventEnvelope { + radroots_event::RadrootsEventEnvelope { id: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa".to_owned(), author: "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" .to_owned(), diff --git a/crates/sdk/tests/unit/signer_provider_tests.rs b/crates/sdk/tests/unit/signer_provider_tests.rs @@ -1,9 +1,9 @@ use super::*; use nostr::nips::nip44::{self, Version}; use nostr::{EventBuilder, JsonUtil, Kind, Tag}; -use radroots_events::contract::RadrootsActorRole; -use radroots_events::kinds::{KIND_COOP, KIND_FARM}; -use radroots_events_codec::wire::{WireEventParts, to_frozen_draft}; +use radroots_event::contract::RadrootsActorRole; +use radroots_event::kinds::{KIND_COOP, KIND_FARM}; +use radroots_event_codec::wire::{WireEventParts, to_frozen_draft}; use radroots_nostr::prelude::{RadrootsNostrEvent, RadrootsNostrSecretKey}; use radroots_nostr_connect::prelude::{ RADROOTS_NOSTR_CONNECT_RPC_KIND, RadrootsNostrConnectClientTarget, RadrootsNostrConnectError, diff --git a/crates/sdk/tests/unit/sync_runtime_tests.rs b/crates/sdk/tests/unit/sync_runtime_tests.rs @@ -22,16 +22,16 @@ use futures::future::BoxFuture; use radroots_authority::{ RadrootsActorContext, RadrootsEventSigner, RadrootsSignerError, RadrootsSignerIdentity, }; -use radroots_event_store::RadrootsEventStoreStatusSummary; #[cfg(feature = "radrootsd-proxy")] -use radroots_events::contract::RadrootsActorRole; +use radroots_event::contract::RadrootsActorRole; #[cfg(feature = "radrootsd-proxy")] -use radroots_events::draft::{RadrootsEventDraft, RadrootsSignedEvent}; -use radroots_events::ids::RadrootsEventId; +use radroots_event::draft::{RadrootsEventDraft, RadrootsSignedEvent}; +use radroots_event::ids::RadrootsEventId; #[cfg(feature = "radrootsd-proxy")] -use radroots_events::kinds::KIND_FARM; +use radroots_event::kinds::KIND_FARM; #[cfg(feature = "radrootsd-proxy")] -use radroots_events_codec::wire::{WireEventParts, to_frozen_draft}; +use radroots_event_codec::wire::{WireEventParts, to_frozen_draft}; +use radroots_event_store::RadrootsEventStoreStatusSummary; #[cfg(feature = "radrootsd-proxy")] use radroots_nostr::prelude::{ RadrootsNostrKeys, RadrootsNostrSecretKey, radroots_nostr_sign_frozen_draft, @@ -103,7 +103,7 @@ impl ProxyFixtureSigner { #[cfg(feature = "radrootsd-proxy")] impl RadrootsEventSigner for ProxyFixtureSigner { - fn pubkey(&self) -> &radroots_events::ids::RadrootsPublicKey { + fn pubkey(&self) -> &radroots_event::ids::RadrootsPublicKey { self.identity.pubkey() } diff --git a/crates/sdk/tests/unit/workflow_runtime_tests.rs b/crates/sdk/tests/unit/workflow_runtime_tests.rs @@ -2,10 +2,10 @@ use super::*; #[cfg(feature = "signer-adapters")] use crate::{RadrootsSdkLocalKeySigner, RadrootsSdkSignerProvider}; use radroots_authority::{RadrootsSignerError, RadrootsSignerIdentity}; -use radroots_events::contract::RadrootsActorRole; -use radroots_events::draft::RadrootsSignedEvent; -use radroots_events::kinds::KIND_FARM; -use radroots_events_codec::wire::{WireEventParts, to_frozen_draft}; +use radroots_event::contract::RadrootsActorRole; +use radroots_event::draft::RadrootsSignedEvent; +use radroots_event::kinds::KIND_FARM; +use radroots_event_codec::wire::{WireEventParts, to_frozen_draft}; use radroots_nostr::prelude::{ RadrootsNostrKeys, RadrootsNostrSecretKey, radroots_nostr_sign_frozen_draft, }; @@ -33,7 +33,7 @@ impl WorkflowSigner { } impl RadrootsEventSigner for WorkflowSigner { - fn pubkey(&self) -> &radroots_events::ids::RadrootsPublicKey { + fn pubkey(&self) -> &radroots_event::ids::RadrootsPublicKey { self.identity.pubkey() } diff --git a/tools/sdk_xtask_import/Cargo.toml b/tools/sdk_xtask_import/Cargo.toml @@ -17,12 +17,11 @@ path = "src/main.rs" dto_bindgen_backend_ts = { workspace = true } dto_bindgen_core = { workspace = true } radroots_core = { workspace = true, features = ["dto-bindgen"] } -radroots_events = { workspace = true, features = ["dto-bindgen"] } +radroots_event = { workspace = true, features = ["dto-bindgen"] } radroots_events_bindings = { path = "../../crates/events_bindings" } -radroots_events_indexed = { workspace = true, features = ["dto-bindgen"] } +radroots_event_index = { workspace = true, features = ["dto-bindgen"] } radroots_identity_bindings = { path = "../../crates/identity_bindings" } radroots_replica_db_schema_bindings = { path = "../../crates/replica_db_schema_bindings" } -radroots_types_bindings = { path = "../../crates/types_bindings" } radroots_trade_bindings = { path = "../../crates/trade_bindings" } flate2 = "1" serde_json = "1" diff --git a/tools/sdk_xtask_import/src/contracts.rs b/tools/sdk_xtask_import/src/contracts.rs @@ -575,12 +575,11 @@ repository = "sdk-typescript" [packages] "radroots_core" = "@radroots/core-bindings" -"radroots_events" = "@radroots/events-bindings" -"radroots_events_indexed" = "@radroots/events-indexed-bindings" +"radroots_event" = "@radroots/events-bindings" +"radroots_event_index" = "@radroots/events-indexed-bindings" "radroots_identity" = "@radroots/identity-bindings" "radroots_replica_db_schema" = "@radroots/replica-db-schema-bindings" "radroots_trade" = "@radroots/trade-bindings" -"radroots_types" = "@radroots/types-bindings" "radroots_events_codec_wasm" = "@radroots/events-codec-wasm" "radroots_replica_db_wasm" = "@radroots/replica-db-wasm" "radroots_replica_sync_wasm" = "@radroots/replica-sync-wasm" @@ -650,13 +649,6 @@ crate_dir = "crates/trade_bindings" package = "@radroots/trade-bindings" package_dir = "packages/trade-bindings" -[npm_packages.types] -kind = "bindings" -crate_name = "radroots_types_bindings" -crate_dir = "crates/types_bindings" -package = "@radroots/types-bindings" -package_dir = "packages/types-bindings" - [npm_packages.events_codec] kind = "wasm" crate_name = "radroots_events_codec_wasm" diff --git a/tools/sdk_xtask_import/src/dto_roots.rs b/tools/sdk_xtask_import/src/dto_roots.rs @@ -66,10 +66,6 @@ pub const DTO_PACKAGE_ROOTS: &[DtoPackageRootSet] = &[ package_key: "trade", roots: trade_roots, }, - DtoPackageRootSet { - package_key: "types", - roots: types_roots, - }, ]; pub const MANUAL_DESCRIPTOR_FAMILIES: &[ManualDescriptorFamily] = &[ @@ -103,11 +99,6 @@ pub const MANUAL_DESCRIPTOR_FAMILIES: &[ManualDescriptorFamily] = &[ source_family: "untagged query wrappers and serde_json value fields", reason: "schema query shapes are generated and not all source fields map to derive-supported DTOs", }, - ManualDescriptorFamily { - package_key: "types", - source_family: "generic result wrapper types", - reason: "generic export instantiations must be explicit and package-scoped", - }, ]; pub const SDK_LOCAL_WRAPPER_ALLOWANCES: &[SdkLocalWrapperAllowance] = &[ @@ -122,13 +113,8 @@ pub const SDK_LOCAL_WRAPPER_ALLOWANCES: &[SdkLocalWrapperAllowance] = &[ reason: "schema operation inputs are generated package shapes rather than source-owned public DTO structs", }, SdkLocalWrapperAllowance { - package_key: "types", - shape_family: "IResult, IResultList, and IResultPass generic envelopes", - reason: "generic helper envelopes are SDK package contracts used across generated schema packages", - }, - SdkLocalWrapperAllowance { package_key: "events_indexed", - shape_family: "RadrootsEventsIndexedShardId package alias", + shape_family: "RadrootsEventIndexShardId package alias", reason: "source descriptors correctly describe the shard id newtype as a string, while package roots still need a stable named TypeScript alias", }, SdkLocalWrapperAllowance { @@ -226,33 +212,22 @@ pub fn trade_types_module() -> Result<DtoTypesModule, String> { Ok(rendered) } -pub fn types_types_module() -> Result<DtoTypesModule, String> { - let root_set = package_root_set("types").ok_or_else(|| "missing types DTO roots".to_owned())?; - render_registry_types(&root_set.registry(), &DtoRegistryRenderOptions::default()) -} - fn core_roots() -> Vec<RootDescriptor> { radroots_core::dto::dto_roots().into_iter().collect() } fn events_roots() -> Vec<RootDescriptor> { - radroots_events::dto::dto_roots().into_iter().collect() + radroots_event::dto::dto_roots().into_iter().collect() } fn events_indexed_roots() -> Vec<RootDescriptor> { - radroots_events_indexed::dto::dto_roots() - .into_iter() - .collect() + radroots_event_index::dto::dto_roots().into_iter().collect() } fn trade_roots() -> Vec<RootDescriptor> { radroots_trade_bindings::dto_roots() } -fn types_roots() -> Vec<RootDescriptor> { - radroots_types_bindings::dto_roots() -} - fn core_import_options( registry: &Registry, mut options: DtoRegistryRenderOptions, @@ -491,16 +466,16 @@ fn with_events_indexed_sdk_wrappers(module: DtoTypesModule) -> DtoTypesModule { .map(str::to_owned) .collect::<Vec<_>>(); declarations.push(type_alias( - "RadrootsEventsIndexedShardId", + "RadrootsEventIndexShardId", TypeScriptType::String, )); let order = [ - "RadrootsEventsIndexedShardId", - "RadrootsEventsIndexedIdRange", - "RadrootsEventsIndexedShardMetadata", - "RadrootsEventsIndexedManifest", - "RadrootsEventsIndexedShardCheckpoint", - "RadrootsEventsIndexedIndexCheckpoint", + "RadrootsEventIndexShardId", + "RadrootsEventIndexIdRange", + "RadrootsEventIndexShardMetadata", + "RadrootsEventIndexManifest", + "RadrootsEventIndexShardCheckpoint", + "RadrootsEventIndexIndexCheckpoint", ]; declarations.sort_by_key(|declaration| { order @@ -600,6 +575,9 @@ mod tests { "RadrootsCoopRef", "RadrootsDocument", "RadrootsDocumentSubject", + "RadrootsEventEnvelope", + "RadrootsEventPtr", + "RadrootsEventRef", "RadrootsEvidenceBounty", "RadrootsFarm", "RadrootsFarmPublicLocation", @@ -651,9 +629,6 @@ mod tests { "RadrootsMessageFile", "RadrootsMessageFileDimensions", "RadrootsMessageRecipient", - "RadrootsEventEnvelope", - "RadrootsEventPtr", - "RadrootsEventRef", "RadrootsOrderCancellation", "RadrootsOrderDecision", "RadrootsOrderDecisionOutcome", @@ -702,12 +677,12 @@ mod tests { "RadrootsWikiRedirect", ]; const EVENTS_INDEXED_TYPE_INVENTORY: &[&str] = &[ - "RadrootsEventsIndexedShardId", - "RadrootsEventsIndexedIdRange", - "RadrootsEventsIndexedShardMetadata", - "RadrootsEventsIndexedManifest", - "RadrootsEventsIndexedShardCheckpoint", - "RadrootsEventsIndexedIndexCheckpoint", + "RadrootsEventIndexShardId", + "RadrootsEventIndexIdRange", + "RadrootsEventIndexShardMetadata", + "RadrootsEventIndexManifest", + "RadrootsEventIndexShardCheckpoint", + "RadrootsEventIndexIndexCheckpoint", ]; const TRADE_TYPE_INVENTORY: &[&str] = &[ "RadrootsOrderIssue", @@ -765,7 +740,6 @@ mod tests { assert!(package_root_set("events").is_some()); assert!(package_root_set("events_indexed").is_some()); assert!(package_root_set("trade").is_some()); - assert!(package_root_set("types").is_some()); } #[test] @@ -776,11 +750,6 @@ mod tests { .any(|family| family.source_family.contains("GeoJSON")) ); assert!( - MANUAL_DESCRIPTOR_FAMILIES - .iter() - .any(|family| family.source_family.contains("generic result")) - ); - assert!( SDK_LOCAL_WRAPPER_ALLOWANCES .iter() .any(|allowance| allowance.shape_family.contains("RadrootsCoreDecimal")) @@ -788,16 +757,11 @@ mod tests { assert!( SDK_LOCAL_WRAPPER_ALLOWANCES .iter() - .any(|allowance| allowance.shape_family.contains("IResult")) + .any(|allowance| { allowance.shape_family.contains("RadrootsEventIndexShardId") }) ); assert!(SDK_LOCAL_WRAPPER_ALLOWANCES.iter().any(|allowance| { allowance .shape_family - .contains("RadrootsEventsIndexedShardId") - })); - assert!(SDK_LOCAL_WRAPPER_ALLOWANCES.iter().any(|allowance| { - allowance - .shape_family .contains("marketplace, query, projection") })); } @@ -972,8 +936,12 @@ mod tests { )); assert!( REPLICA_DB_SCHEMA_BINDINGS_TYPES_TS - .contains("export type IFarmFindOneResolve = IResult<Farm | null>;") + .contains("export type IFarmFindOneResolve = ReplicaSchemaResult<Farm | null>;") ); + assert!(actual.contains(&"ReplicaSchemaResult")); + assert!(actual.contains(&"ReplicaSchemaResultList")); + assert!(actual.contains(&"ReplicaSchemaResultPass")); + assert!(actual.contains(&"ReplicaSchemaError")); assert!(trade_product_filter.contains("year?: bigint")); assert!(trade_product_filter.contains("qty_avail?: bigint")); assert!(trade_product_partial.contains("year?: ReplicaDbJsonValue | null")); diff --git a/tools/sdk_xtask_import/src/output.rs b/tools/sdk_xtask_import/src/output.rs @@ -119,10 +119,7 @@ pub fn package_outputs() -> Result<Vec<PackageOutput>, String> { types_ts: Some(TsSource::DtoRegistry( dto_roots::replica_db_schema_types_module()?, )), - types_imports: vec![TypeScriptImport::type_only( - ["IResult", "IResultList", "IResultPass"], - "@radroots/types-bindings", - )], + types_imports: Vec::new(), constants_ts: None, kinds_ts: None, }, @@ -133,13 +130,6 @@ pub fn package_outputs() -> Result<Vec<PackageOutput>, String> { constants_ts: None, kinds_ts: None, }, - PackageOutput { - spec: spec_by_key("types"), - types_ts: Some(TsSource::DtoRegistry(dto_roots::types_types_module()?)), - types_imports: Vec::new(), - constants_ts: None, - kinds_ts: None, - }, ]) } @@ -239,7 +229,7 @@ mod tests { } #[test] - fn includes_core_and_types_outputs() { + fn includes_core_and_schema_outputs() { let package_names = package_outputs() .expect("package outputs") .into_iter() @@ -251,7 +241,6 @@ mod tests { assert!(package_names.contains(&"@radroots/identity-bindings")); assert!(package_names.contains(&"@radroots/replica-db-schema-bindings")); assert!(package_names.contains(&"@radroots/trade-bindings")); - assert!(package_names.contains(&"@radroots/types-bindings")); } #[test] @@ -335,7 +324,7 @@ mod tests { .expect("replica_db_schema output"); assert!(matches!(output.types_ts, Some(TsSource::DtoRegistry(_)))); - assert_eq!(output.types_imports.len(), 1); + assert!(output.types_imports.is_empty()); let types = output .files() diff --git a/tools/sdk_xtask_import/src/package_matrix.rs b/tools/sdk_xtask_import/src/package_matrix.rs @@ -20,7 +20,7 @@ pub struct WasmPackageSpec { pub out_dir: &'static str, } -pub const PACKAGE_SPECS: [PackageSpec; 7] = [ +pub const PACKAGE_SPECS: [PackageSpec; 6] = [ PackageSpec { key: "core", crate_name: "radroots_core_bindings", @@ -63,13 +63,6 @@ pub const PACKAGE_SPECS: [PackageSpec; 7] = [ package_name: "@radroots/trade-bindings", package_dir: "packages/trade-bindings", }, - PackageSpec { - key: "types", - crate_name: "radroots_types_bindings", - crate_dir: "crates/types_bindings", - package_name: "@radroots/types-bindings", - package_dir: "packages/types-bindings", - }, ]; pub const WASM_PACKAGE_SPECS: [WasmPackageSpec; 3] = [ @@ -179,7 +172,7 @@ mod tests { #[test] fn approved_package_count_is_stable() { - assert_eq!(package_specs().len(), 7); + assert_eq!(package_specs().len(), 6); assert_eq!(wasm_package_specs().len(), 3); }