commit edf40a100590de728fe9ee5677b37d29f61bc40c parent dfa3bb1dbd5b2a407f1e010adf1665df1fde6d96 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:
77 files changed, 415 insertions(+), 945 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock @@ -1749,7 +1749,7 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" name = "radroots_authority" version = "0.1.0-alpha.2" dependencies = [ - "radroots_events", + "radroots_event", "radroots_nostr", ] @@ -1771,49 +1771,58 @@ dependencies = [ ] [[package]] -name = "radroots_event_store" +name = "radroots_event" version = "0.1.0-alpha.2" dependencies = [ - "radroots_events", - "radroots_nostr", - "radroots_transport", + "dto_bindgen", + "hex", + "radroots_core", "serde", "serde_json", - "sqlx", - "thiserror 1.0.69", + "sha2", ] [[package]] -name = "radroots_events" +name = "radroots_event_codec" version = "0.1.0-alpha.2" dependencies = [ - "dto_bindgen", "hex", + "nostr", "radroots_core", + "radroots_event", "serde", "serde_json", "sha2", ] [[package]] -name = "radroots_events_bindings" -version = "0.1.0" +name = "radroots_event_index" +version = "0.1.0-alpha.2" dependencies = [ - "dto_bindgen_backend_ts", - "radroots_events", + "dto_bindgen", + "dto_bindgen_core", + "serde", ] [[package]] -name = "radroots_events_codec" +name = "radroots_event_store" version = "0.1.0-alpha.2" dependencies = [ - "hex", - "nostr", - "radroots_core", - "radroots_events", + "radroots_event", + "radroots_nostr", + "radroots_transport", "serde", "serde_json", - "sha2", + "sqlx", + "thiserror 1.0.69", +] + +[[package]] +name = "radroots_events_bindings" +version = "0.1.0" +dependencies = [ + "dto_bindgen_backend_ts", + "radroots_event", ] [[package]] @@ -1822,27 +1831,18 @@ version = "0.1.0-alpha.2" dependencies = [ "nostr", "radroots_core", - "radroots_events", - "radroots_events_codec", + "radroots_event", + "radroots_event_codec", "serde", "serde_json", "wasm-bindgen", ] [[package]] -name = "radroots_events_indexed" -version = "0.1.0-alpha.2" -dependencies = [ - "dto_bindgen", - "dto_bindgen_core", - "serde", -] - -[[package]] name = "radroots_events_indexed_bindings" version = "0.1.0" dependencies = [ - "radroots_events_indexed", + "radroots_event_index", ] [[package]] @@ -1865,7 +1865,7 @@ name = "radroots_identity" version = "0.1.0-alpha.2" dependencies = [ "nostr", - "radroots_events", + "radroots_event", "radroots_protected_store", "radroots_runtime", "radroots_runtime_paths", @@ -1901,8 +1901,8 @@ version = "0.1.0-alpha.2" dependencies = [ "nostr", "nostr-sdk", - "radroots_events", - "radroots_events_codec", + "radroots_event", + "radroots_event_codec", "radroots_identity", "serde", "serde_json", @@ -1943,8 +1943,8 @@ name = "radroots_outbox" version = "0.1.0-alpha.2" dependencies = [ "hex", + "radroots_event", "radroots_event_store", - "radroots_events", "radroots_transport", "serde", "serde_json", @@ -1972,7 +1972,6 @@ dependencies = [ "hex", "radroots_replica_db_schema", "radroots_sql_core", - "radroots_types", "serde", "serde_json", "sha2", @@ -1983,7 +1982,6 @@ name = "radroots_replica_db_schema" version = "0.1.0-alpha.2" dependencies = [ "dto_bindgen_core", - "radroots_types", "serde", "serde_json", ] @@ -2020,12 +2018,11 @@ dependencies = [ "base64 0.22.1", "hex", "radroots_core", - "radroots_events", - "radroots_events_codec", + "radroots_event", + "radroots_event_codec", "radroots_replica_db", "radroots_replica_db_schema", "radroots_sql_core", - "radroots_types", "serde", "serde_json", "sha2", @@ -2037,7 +2034,7 @@ name = "radroots_replica_sync_wasm" version = "0.1.0-alpha.2" dependencies = [ "base64 0.22.1", - "radroots_events", + "radroots_event", "radroots_replica_sync", "radroots_sdk_sql_wasm_runtime", "serde", @@ -2086,9 +2083,9 @@ dependencies = [ "nostr", "radroots_authority", "radroots_core", + "radroots_event", + "radroots_event_codec", "radroots_event_store", - "radroots_events", - "radroots_events_codec", "radroots_geocoder", "radroots_identity", "radroots_nostr", @@ -2135,13 +2132,12 @@ dependencies = [ "dto_bindgen_core", "flate2", "radroots_core", - "radroots_events", + "radroots_event", + "radroots_event_index", "radroots_events_bindings", - "radroots_events_indexed", "radroots_identity_bindings", "radroots_replica_db_schema_bindings", "radroots_trade_bindings", - "radroots_types_bindings", "serde", "serde_json", "tar", @@ -2174,9 +2170,9 @@ dependencies = [ "hex", "radroots_authority", "radroots_core", + "radroots_event", + "radroots_event_codec", "radroots_event_store", - "radroots_events", - "radroots_events_codec", "serde", "serde_json", "sha2", @@ -2207,8 +2203,8 @@ version = "0.1.0-alpha.2" dependencies = [ "futures", "nostr", + "radroots_event", "radroots_event_store", - "radroots_events", "radroots_nostr", "radroots_outbox", "radroots_transport", @@ -2235,22 +2231,6 @@ dependencies = [ ] [[package]] -name = "radroots_types" -version = "0.1.0-alpha.2" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "radroots_types_bindings" -version = "0.1.0" -dependencies = [ - "dto_bindgen_core", - "radroots_types", -] - -[[package]] name = "rand" version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" diff --git a/Cargo.toml b/Cargo.toml @@ -11,7 +11,6 @@ members = [ "crates/sdk", "crates/sql_wasm_runtime", "crates/trade_bindings", - "crates/types_bindings", "tools/xtask", ] resolver = "2" @@ -32,9 +31,9 @@ dto_bindgen_core = { git = "https://github.com/triesap/dto_bindgen", rev = "d323 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 } -radroots_events = { path = "../lib/crates/events", version = "0.1.0-alpha.2", default-features = false } -radroots_events_codec = { path = "../lib/crates/events_codec", version = "0.1.0-alpha.2", default-features = false } -radroots_events_indexed = { path = "../lib/crates/events_indexed", version = "0.1.0-alpha.2", default-features = false } +radroots_event = { path = "../lib/crates/event", version = "0.1.0-alpha.2", default-features = false } +radroots_event_codec = { path = "../lib/crates/event_codec", version = "0.1.0-alpha.2", default-features = false } +radroots_event_index = { path = "../lib/crates/event_index", version = "0.1.0-alpha.2", default-features = false } radroots_geocoder = { path = "../lib/crates/geocoder", version = "0.1.0-alpha.2" } radroots_identity = { path = "../lib/crates/identity", version = "0.1.0-alpha.2", default-features = false, features = [ "std", @@ -58,7 +57,6 @@ radroots_trade = { path = "../lib/crates/trade", version = "0.1.0-alpha.2", defa "serde_json", "std", ] } -radroots_types = { path = "../lib/crates/types", version = "0.1.0-alpha.2", default-features = false } base64 = { version = "0.22", default-features = false, features = ["alloc"] } futures = { version = "0.3" } diff --git a/contracts/exports/ts.toml b/contracts/exports/ts.toml @@ -9,7 +9,6 @@ repository = "sdk-typescript" "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" diff --git a/contracts/packages/ts.toml b/contracts/packages/ts.toml @@ -51,13 +51,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/contracts/provenance/typescript/types.json b/contracts/provenance/typescript/types.json @@ -1,6 +0,0 @@ -{ - "crate": "radroots_types_bindings", - "generated": true, - "generator": "radroots_sdk_xtask", - "package": "@radroots/types-bindings" -} diff --git a/crates/events_bindings/Cargo.toml b/crates/events_bindings/Cargo.toml @@ -11,4 +11,4 @@ publish = false [dependencies] dto_bindgen_backend_ts = { workspace = true } -radroots_events = { workspace = true } +radroots_event = { workspace = true } diff --git a/crates/events_bindings/src/lib.rs b/crates/events_bindings/src/lib.rs @@ -1,4 +1,4 @@ -pub use radroots_events as upstream; +pub use radroots_event as upstream; mod model; @@ -6,7 +6,7 @@ pub use model::{constants_module, kinds_module}; #[cfg(test)] mod tests { - use radroots_events::{kinds, listing::RADROOTS_LISTING_PRODUCT_TAG_KEYS}; + use radroots_event::{kinds, listing::RADROOTS_LISTING_PRODUCT_TAG_KEYS}; use super::{constants_module, kinds_module}; diff --git a/crates/events_bindings/src/model.rs b/crates/events_bindings/src/model.rs @@ -1,7 +1,7 @@ use dto_bindgen_backend_ts::{ TypeScriptDeclaration, TypeScriptImport, TypeScriptModule, TypeScriptType, TypeScriptValue, }; -use radroots_events::{kinds, listing::RADROOTS_LISTING_PRODUCT_TAG_KEYS}; +use radroots_event::{kinds, listing::RADROOTS_LISTING_PRODUCT_TAG_KEYS}; pub fn constants_module() -> TypeScriptModule { TypeScriptModule::new("src/generated/constants.ts") diff --git a/crates/events_codec_wasm/Cargo.toml b/crates/events_codec_wasm/Cargo.toml @@ -15,12 +15,12 @@ readme = "README" crate-type = ["cdylib", "rlib"] [dependencies] -radroots_events = { workspace = true, default-features = false, features = [ +radroots_event = { workspace = true, default-features = false, features = [ "std", "serde", "knowledge-nip54", ] } -radroots_events_codec = { workspace = true, default-features = false, features = [ +radroots_event_codec = { workspace = true, default-features = false, features = [ "std", "serde_json", "nostr", diff --git a/crates/events_codec_wasm/src/lib.rs b/crates/events_codec_wasm/src/lib.rs @@ -1,93 +1,93 @@ #![forbid(unsafe_code)] -use radroots_events::article::RadrootsArticle; -use radroots_events::calendar::{ +use radroots_event::article::RadrootsArticle; +use radroots_event::calendar::{ RadrootsCalendar, RadrootsCalendarDateEvent, RadrootsCalendarEventRsvp, RadrootsCalendarTimeEvent, }; -use radroots_events::comment::RadrootsComment; -use radroots_events::coop::RadrootsCoop; -use radroots_events::document::RadrootsDocument; -use radroots_events::farm::RadrootsFarm; -use radroots_events::farm_crdt::RadrootsFarmCrdtChange; -use radroots_events::farm_file::RadrootsFarmFileMetadata; -use radroots_events::farm_workspace::RadrootsFarmWorkspaceManifest; -use radroots_events::file_metadata::RadrootsFileMetadata; -use radroots_events::follow::RadrootsFollow; -use radroots_events::gift_wrap::RadrootsGiftWrap; -use radroots_events::group::{ +use radroots_event::comment::RadrootsComment; +use radroots_event::coop::RadrootsCoop; +use radroots_event::document::RadrootsDocument; +use radroots_event::farm::RadrootsFarm; +use radroots_event::farm_crdt::RadrootsFarmCrdtChange; +use radroots_event::farm_file::RadrootsFarmFileMetadata; +use radroots_event::farm_workspace::RadrootsFarmWorkspaceManifest; +use radroots_event::file_metadata::RadrootsFileMetadata; +use radroots_event::follow::RadrootsFollow; +use radroots_event::gift_wrap::RadrootsGiftWrap; +use radroots_event::group::{ RadrootsGroupAdmins, RadrootsGroupCreateGroup, RadrootsGroupCreateInvite, RadrootsGroupDeleteEvent, RadrootsGroupDeleteGroup, RadrootsGroupEditMetadata, RadrootsGroupJoinRequest, RadrootsGroupLeaveRequest, RadrootsGroupMembers, RadrootsGroupMetadata, RadrootsGroupPutUser, RadrootsGroupRemoveUser, RadrootsGroupRoles, }; -use radroots_events::http_auth::RadrootsHttpAuth; -use radroots_events::job_feedback::RadrootsJobFeedback; -use radroots_events::job_request::RadrootsJobRequest; -use radroots_events::job_result::RadrootsJobResult; -use radroots_events::knowledge::{ +use radroots_event::http_auth::RadrootsHttpAuth; +use radroots_event::job_feedback::RadrootsJobFeedback; +use radroots_event::job_request::RadrootsJobRequest; +use radroots_event::job_result::RadrootsJobResult; +use radroots_event::knowledge::{ RadrootsKnowledgeClaim, RadrootsKnowledgeFieldReport, RadrootsKnowledgeRelation, RadrootsKnowledgeReview, RadrootsKnowledgeSource, RadrootsWikiArticle, RadrootsWikiMergeRequest, RadrootsWikiRedirect, }; -use radroots_events::list::RadrootsList; -use radroots_events::list_set::RadrootsListSet; -use radroots_events::listing::RadrootsListing; -use radroots_events::message::RadrootsMessage; -use radroots_events::message_file::RadrootsMessageFile; -use radroots_events::plot::RadrootsPlot; -use radroots_events::post::RadrootsPost; -use radroots_events::reaction::RadrootsReaction; -use radroots_events::relay_auth::RadrootsRelayAuth; -use radroots_events::report::RadrootsReport; -use radroots_events::repost::{RadrootsGenericRepost, RadrootsRepost}; -use radroots_events::seal::RadrootsSeal; -use radroots_events_codec::article::encode::article_build_tags; -use radroots_events_codec::calendar::encode::{ +use radroots_event::list::RadrootsList; +use radroots_event::list_set::RadrootsListSet; +use radroots_event::listing::RadrootsListing; +use radroots_event::message::RadrootsMessage; +use radroots_event::message_file::RadrootsMessageFile; +use radroots_event::plot::RadrootsPlot; +use radroots_event::post::RadrootsPost; +use radroots_event::reaction::RadrootsReaction; +use radroots_event::relay_auth::RadrootsRelayAuth; +use radroots_event::report::RadrootsReport; +use radroots_event::repost::{RadrootsGenericRepost, RadrootsRepost}; +use radroots_event::seal::RadrootsSeal; +use radroots_event_codec::article::encode::article_build_tags; +use radroots_event_codec::calendar::encode::{ calendar_collection_build_tags, calendar_date_event_build_tags, calendar_time_event_build_tags, rsvp_build_tags, }; -use radroots_events_codec::comment::encode::comment_build_tags; -use radroots_events_codec::coop::encode::coop_build_tags; -use radroots_events_codec::document::encode::document_build_tags; -use radroots_events_codec::farm::encode::farm_build_tags; -use radroots_events_codec::farm_crdt::encode::farm_crdt_change_build_tags_with_author; -use radroots_events_codec::farm_file::encode::farm_file_metadata_build_tags; -use radroots_events_codec::farm_workspace::encode::farm_workspace_build_tags; -use radroots_events_codec::file_metadata::encode::file_metadata_build_tags; -use radroots_events_codec::follow::encode::follow_build_tags; -use radroots_events_codec::gift_wrap::encode::gift_wrap_build_tags; -use radroots_events_codec::group::encode::{ +use radroots_event_codec::comment::encode::comment_build_tags; +use radroots_event_codec::coop::encode::coop_build_tags; +use radroots_event_codec::document::encode::document_build_tags; +use radroots_event_codec::farm::encode::farm_build_tags; +use radroots_event_codec::farm_crdt::encode::farm_crdt_change_build_tags_with_author; +use radroots_event_codec::farm_file::encode::farm_file_metadata_build_tags; +use radroots_event_codec::farm_workspace::encode::farm_workspace_build_tags; +use radroots_event_codec::file_metadata::encode::file_metadata_build_tags; +use radroots_event_codec::follow::encode::follow_build_tags; +use radroots_event_codec::gift_wrap::encode::gift_wrap_build_tags; +use radroots_event_codec::group::encode::{ group_admins_build_tags, group_create_group_build_tags, group_create_invite_build_tags, group_delete_event_build_tags, group_delete_group_build_tags, group_edit_metadata_build_tags, group_join_request_build_tags, group_leave_request_build_tags, group_members_build_tags, group_metadata_build_tags, group_put_user_build_tags, group_remove_user_build_tags, group_roles_build_tags, }; -use radroots_events_codec::http_auth::encode::http_auth_build_tags; -use radroots_events_codec::job::feedback::encode::job_feedback_build_tags; -use radroots_events_codec::job::request::encode::job_request_build_tags; -use radroots_events_codec::job::result::encode::job_result_build_tags; -use radroots_events_codec::knowledge::{ +use radroots_event_codec::http_auth::encode::http_auth_build_tags; +use radroots_event_codec::job::feedback::encode::job_feedback_build_tags; +use radroots_event_codec::job::request::encode::job_request_build_tags; +use radroots_event_codec::job::result::encode::job_result_build_tags; +use radroots_event_codec::knowledge::{ knowledge_claim_build_tags, knowledge_field_report_build_tags, knowledge_relation_build_tags, knowledge_review_build_tags, knowledge_source_build_tags, wiki_article_build_tags, wiki_merge_request_build_tags, wiki_redirect_build_tags, }; -use radroots_events_codec::list::encode::list_build_tags; -use radroots_events_codec::list_set::encode::list_set_build_tags; -use radroots_events_codec::listing::tags::{ +use radroots_event_codec::list::encode::list_build_tags; +use radroots_event_codec::list_set::encode::list_set_build_tags; +use radroots_event_codec::listing::tags::{ listing_tags as listing_tags_impl, listing_tags_full as listing_tags_full_impl, }; -use radroots_events_codec::message::encode::message_build_tags; -use radroots_events_codec::message_file::encode::message_file_build_tags; -use radroots_events_codec::plot::encode::plot_build_tags; -use radroots_events_codec::post::encode::post_build_tags; -use radroots_events_codec::reaction::encode::reaction_build_tags; -use radroots_events_codec::relay_auth::encode::relay_auth_build_tags; -use radroots_events_codec::report::encode::report_build_tags; -use radroots_events_codec::repost::encode::{generic_repost_build_tags, repost_build_tags}; -use radroots_events_codec::seal::encode::seal_build_tags; -use radroots_events_codec::verification::{RadrootsDecodeError, RadrootsDecodedEvent}; +use radroots_event_codec::message::encode::message_build_tags; +use radroots_event_codec::message_file::encode::message_file_build_tags; +use radroots_event_codec::plot::encode::plot_build_tags; +use radroots_event_codec::post::encode::post_build_tags; +use radroots_event_codec::reaction::encode::reaction_build_tags; +use radroots_event_codec::relay_auth::encode::relay_auth_build_tags; +use radroots_event_codec::report::encode::report_build_tags; +use radroots_event_codec::repost::encode::{generic_repost_build_tags, repost_build_tags}; +use radroots_event_codec::seal::encode::seal_build_tags; +use radroots_event_codec::verification::{RadrootsDecodeError, RadrootsDecodedEvent}; use serde::Serialize; use serde::de::DeserializeOwned; #[cfg(target_arch = "wasm32")] @@ -132,9 +132,7 @@ fn tags_to_json(tags: Vec<Vec<String>>) -> Result<String, RadrootsJsValue> { serde_json::to_string(&tags).map_err(err_js) } -fn parse_event_json( - input: &str, -) -> Result<radroots_events::RadrootsEventEnvelope, RadrootsJsValue> { +fn parse_event_json(input: &str) -> Result<radroots_event::RadrootsEventEnvelope, RadrootsJsValue> { serde_json::from_str(input).map_err(|_| error_json("invalid_json", Some("event_json"))) } @@ -166,7 +164,7 @@ where { event_type: &'static str, contract_id: &'static str, - event: &'a radroots_events::RadrootsEventEnvelope, + event: &'a radroots_event::RadrootsEventEnvelope, payload: &'a T, } @@ -223,7 +221,7 @@ fn decoded_event_to_json(decoded: RadrootsDecodedEvent) -> Result<String, Radroo fn decoded_payload_to_json<T>( event_type: &'static str, contract_id: &'static str, - parsed: &radroots_events_codec::parsed::RadrootsParsedEvent<T>, + parsed: &radroots_event_codec::parsed::RadrootsParsedEvent<T>, ) -> Result<String, RadrootsJsValue> where T: Serialize, @@ -324,14 +322,14 @@ pub fn knowledge_field_report_tags(report_json: &str) -> Result<String, Radroots #[cfg_attr(target_arch = "wasm32", wasm_bindgen(js_name = verify_and_decode_event_json))] pub fn verify_and_decode_event_json(event_json: &str) -> Result<String, RadrootsJsValue> { let event = parse_event_json(event_json)?; - let decoded = radroots_events_codec::verify_and_decode_radroots_event(event) - .map_err(decode_error_json)?; + let decoded = + radroots_event_codec::verify_and_decode_radroots_event(event).map_err(decode_error_json)?; decoded_event_to_json(decoded) } #[cfg_attr(target_arch = "wasm32", wasm_bindgen(js_name = contract_manifest_json))] pub fn contract_manifest_json() -> Result<String, RadrootsJsValue> { - radroots_events_codec::contract_manifest_json().map_err(err_js) + radroots_event_codec::contract_manifest_json().map_err(err_js) } #[cfg_attr(target_arch = "wasm32", wasm_bindgen(js_name = file_metadata_tags))] @@ -564,34 +562,34 @@ mod tests { RadrootsCoreCurrency, RadrootsCoreDecimal, RadrootsCoreMoney, RadrootsCoreQuantity, RadrootsCoreQuantityPrice, RadrootsCoreUnit, }; - use radroots_events::farm::RadrootsFarmRef; - use radroots_events::farm_crdt::{ + use radroots_event::farm::RadrootsFarmRef; + use radroots_event::farm_crdt::{ RADROOTS_FARM_CRDT_CHANGE_SCHEMA, RadrootsCrdtBackend, RadrootsFarmCrdtDocumentKind, RadrootsFarmSemanticKind, }; - use radroots_events::farm_file::{ + use radroots_event::farm_file::{ RadrootsFarmFileDimensions, RadrootsFarmFileMetadata, RadrootsFarmFileSource, }; - use radroots_events::farm_workspace::{ + use radroots_event::farm_workspace::{ RADROOTS_FARM_WORKSPACE_PROTOCOL_VERSION, RADROOTS_FARM_WORKSPACE_SCHEMA, RadrootsFarmWorkspaceManifest, RadrootsFarmWorkspaceMediaServer, RadrootsFarmWorkspaceRef, RadrootsFarmWorkspaceRelay, RadrootsFarmWorkspaceRelayMode, }; - use radroots_events::group::{ + use radroots_event::group::{ RadrootsGroupAdmins, RadrootsGroupCreateGroup, RadrootsGroupCreateInvite, RadrootsGroupDeleteEvent, RadrootsGroupDeleteGroup, RadrootsGroupEditMetadata, RadrootsGroupEditableMetadata, RadrootsGroupJoinRequest, RadrootsGroupLeaveRequest, RadrootsGroupMembers, RadrootsGroupMetadata, RadrootsGroupPutUser, RadrootsGroupRemoveUser, RadrootsGroupRole, RadrootsGroupRoles, RadrootsGroupUserRef, }; - use radroots_events::http_auth::RadrootsHttpAuth; - use radroots_events::job::JobInputType; - use radroots_events::job_request::{RadrootsJobInput, RadrootsJobParam}; - use radroots_events::kinds::{ + use radroots_event::http_auth::RadrootsHttpAuth; + use radroots_event::job::JobInputType; + use radroots_event::job_request::{RadrootsJobInput, RadrootsJobParam}; + use radroots_event::kinds::{ KIND_FARM_FILE_METADATA, KIND_FILE_METADATA, KIND_KNOWLEDGE_CLAIM, KIND_KNOWLEDGE_SOURCE, KIND_WIKI_ARTICLE, }; - use radroots_events::knowledge::{ + use radroots_event::knowledge::{ RADROOTS_KNOWLEDGE_CLAIM_SCHEMA, RADROOTS_KNOWLEDGE_FIELD_REPORT_SCHEMA, RADROOTS_KNOWLEDGE_RELATION_SCHEMA, RADROOTS_KNOWLEDGE_REVIEW_SCHEMA, RADROOTS_KNOWLEDGE_SCHEMA_VERSION, RADROOTS_KNOWLEDGE_SOURCE_SCHEMA, @@ -601,9 +599,9 @@ mod tests { RadrootsKnowledgeReviewScope, RadrootsKnowledgeReviewScore, RadrootsKnowledgeReviewTarget, RadrootsWikiArticleVersionRef, }; - use radroots_events::listing::{RadrootsListingBin, RadrootsListingProduct}; - use radroots_events::relay_auth::RadrootsRelayAuth; - use radroots_events::social::{ + use radroots_event::listing::{RadrootsListingBin, RadrootsListingProduct}; + use radroots_event::relay_auth::RadrootsRelayAuth; + use radroots_event::social::{ RadrootsCalendarDateValue, RadrootsCalendarEventFreeBusy, RadrootsCalendarEventRsvpStatus, RadrootsCalendarParticipant, RadrootsReportFileTarget, RadrootsReportType, RadrootsSocialFarmAnchor, RadrootsSocialLocation, RadrootsSocialMediaDimensions, @@ -695,8 +693,8 @@ mod tests { } } - fn knowledge_event_ref(seed: char, kind: u32) -> radroots_events::RadrootsEventRef { - radroots_events::RadrootsEventRef { + fn knowledge_event_ref(seed: char, kind: u32) -> radroots_event::RadrootsEventRef { + radroots_event::RadrootsEventRef { id: synthetic_event_id(seed), author: synthetic_pubkey('a'), kind, @@ -890,7 +888,7 @@ mod tests { .custom_created_at(nostr::Timestamp::from_secs(1_800_000_000)) .sign_with_keys(&keys) .expect("signed event"); - serde_json::to_string(&radroots_events::RadrootsEventEnvelope { + serde_json::to_string(&radroots_event::RadrootsEventEnvelope { id: event.id.to_hex(), author: event.pubkey.to_hex(), created_at: event.created_at.as_secs() as u32, @@ -1437,7 +1435,7 @@ mod tests { let merge_request = sample_wiki_merge_request(); let merge_parts = - radroots_events_codec::knowledge::wiki_merge_request_to_wire_parts(&merge_request) + radroots_event_codec::knowledge::wiki_merge_request_to_wire_parts(&merge_request) .expect("merge request parts"); assert_eq!(merge_parts.content, "Merge synthetic soil article updates"); let merge_tags = tags_json(wiki_merge_request_tags( diff --git a/crates/events_indexed_bindings/Cargo.toml b/crates/events_indexed_bindings/Cargo.toml @@ -10,4 +10,4 @@ homepage.workspace = true publish = false [dependencies] -radroots_events_indexed = { workspace = true } +radroots_event_index = { workspace = true } diff --git a/crates/events_indexed_bindings/src/lib.rs b/crates/events_indexed_bindings/src/lib.rs @@ -1,4 +1,4 @@ -pub use radroots_events_indexed as upstream; +pub use radroots_event_index as upstream; pub const TYPE_EXPORTS: &[&str] = &[ "RadrootsEventsIndexedShardId", 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/crates/types_bindings/Cargo.toml b/crates/types_bindings/Cargo.toml @@ -1,14 +0,0 @@ -[package] -name = "radroots_types_bindings" -description = "Generated bindings for Radroots shared types" -version.workspace = true -edition.workspace = true -rust-version.workspace = true -license.workspace = true -repository.workspace = true -homepage.workspace = true -publish = false - -[dependencies] -dto_bindgen_core = { workspace = true } -radroots_types = { workspace = true } diff --git a/crates/types_bindings/src/lib.rs b/crates/types_bindings/src/lib.rs @@ -1,129 +0,0 @@ -pub use radroots_types as upstream; - -use dto_bindgen_core::{ - DescribeCtx, Dto, FieldDef, GenericParam, IdentName, Primitive, RootDescriptor, RustTypeId, - SourceSpan, StructDef, TargetFieldNames, TypeDef, TypeRef, WireFieldNames, -}; - -struct IErrorDto; -struct IResultDto; -struct IResultListDto; -struct IResultPassDto; - -pub fn dto_roots() -> Vec<RootDescriptor> { - vec![ - RootDescriptor::new::<IErrorDto>(), - RootDescriptor::new::<IResultDto>(), - RootDescriptor::new::<IResultListDto>(), - RootDescriptor::new::<IResultPassDto>(), - ] -} - -impl Dto for IErrorDto { - fn describe(ctx: &mut DescribeCtx) -> TypeRef { - ctx.register_type( - rust_id("IError"), - generic_struct("IError", "err", TypeRef::GenericParam("T".to_owned())), - ) - } -} - -impl Dto for IResultDto { - fn describe(ctx: &mut DescribeCtx) -> TypeRef { - ctx.register_type( - rust_id("IResult"), - generic_struct("IResult", "result", TypeRef::GenericParam("T".to_owned())), - ) - } -} - -impl Dto for IResultListDto { - fn describe(ctx: &mut DescribeCtx) -> TypeRef { - ctx.register_type( - rust_id("IResultList"), - generic_struct( - "IResultList", - "results", - TypeRef::vec(TypeRef::GenericParam("T".to_owned())), - ), - ) - } -} - -impl Dto for IResultPassDto { - fn describe(ctx: &mut DescribeCtx) -> TypeRef { - ctx.register_type( - rust_id("IResultPass"), - TypeDef::Struct( - StructDef::new("IResultPass", "IResultPass", source_span()) - .with_field(field("pass", TypeRef::Primitive(Primitive::Bool))), - ), - ) - } -} - -fn generic_struct(export_name: &str, field_name: &str, field_type: TypeRef) -> TypeDef { - let mut def = StructDef::new(export_name, export_name, source_span()) - .with_field(field(field_name, field_type)); - def.generics.push(GenericParam::new("T")); - TypeDef::Struct(def) -} - -fn field(name: &str, ty: TypeRef) -> FieldDef { - FieldDef::new( - IdentName::new(name), - WireFieldNames::same(name), - TargetFieldNames::new(name, name), - ty, - source_span(), - ) -} - -fn rust_id(name: &'static str) -> RustTypeId { - RustTypeId::new(env!("CARGO_PKG_NAME"), env!("CARGO_PKG_NAME"), name) -} - -fn source_span() -> SourceSpan { - SourceSpan::new(file!(), line!(), column!()) -} - -#[cfg(test)] -mod tests { - use super::dto_roots; - use dto_bindgen_core::{TypeDef, TypeRef, build_registry}; - - #[test] - fn preserves_result_wrapper_roots() { - let registry = build_registry(dto_roots()); - let actual = registry - .types_by_id - .values() - .map(|type_def| match type_def { - TypeDef::Struct(def) => def.export_name.as_str(), - TypeDef::Enum(def) => def.export_name.as_str(), - }) - .collect::<Vec<_>>(); - - assert_eq!(actual, ["IError", "IResult", "IResultList", "IResultPass"]); - } - - #[test] - fn preserves_generic_result_wrapper_fields() { - let registry = build_registry(dto_roots()); - let result_list = registry - .types_by_id - .values() - .find_map(|type_def| match type_def { - TypeDef::Struct(def) if def.export_name == "IResultList" => Some(def), - _ => None, - }) - .expect("IResultList descriptor"); - - assert_eq!(result_list.generics[0].name, "T"); - assert_eq!(result_list.fields[0].target.typescript, "results"); - assert_eq!( - result_list.fields[0].ty, - TypeRef::vec(TypeRef::GenericParam("T".to_owned())) - ); - } -} diff --git a/packages/events-indexed-bindings/src/generated/types.ts b/packages/events-indexed-bindings/src/generated/types.ts @@ -1,13 +1,13 @@ // @generated by cargo xtask generate ts // Do not edit by hand. -export type RadrootsEventsIndexedShardId = string; +export type RadrootsEventIndexShardId = string; -export type RadrootsEventsIndexedIdRange = { start: string, end: string, }; +export type RadrootsEventIndexIdRange = { start: string, end: string, }; -export type RadrootsEventsIndexedShardMetadata = { file: string, count: number, first_id: string, last_id: string, first_published_at: number, last_published_at: number, sha256: string, }; +export type RadrootsEventIndexShardMetadata = { file: string, count: number, first_id: string, last_id: string, first_published_at: number, last_published_at: number, sha256: string, }; -export type RadrootsEventsIndexedManifest = { country: string, total: number, shard_size: number, first_published_at: number, last_published_at: number, shards: Array<RadrootsEventsIndexedShardMetadata>, }; +export type RadrootsEventIndexManifest = { country: string, total: number, shard_size: number, first_published_at: number, last_published_at: number, shards: Array<RadrootsEventIndexShardMetadata>, }; -export type RadrootsEventsIndexedShardCheckpoint = { shard_id: RadrootsEventsIndexedShardId, last_created_at: number, last_event_id?: string | null, cursor?: string | null, }; +export type RadrootsEventIndexShardCheckpoint = { shard_id: RadrootsEventIndexShardId, last_created_at: number, last_event_id?: string | null, cursor?: string | null, }; -export type RadrootsEventsIndexedIndexCheckpoint = { generated_at: number, shards: Array<RadrootsEventsIndexedShardCheckpoint>, }; +export type RadrootsEventIndexIndexCheckpoint = { generated_at: number, shards: Array<RadrootsEventIndexShardCheckpoint>, }; diff --git a/packages/replica-db-schema-bindings/package.json b/packages/replica-db-schema-bindings/package.json @@ -32,8 +32,5 @@ "scripts": { "build": "tsc -p tsconfig.json", "typecheck": "tsc -p tsconfig.json --noEmit" - }, - "dependencies": { - "@radroots/types-bindings": "workspace:^" } } diff --git a/packages/replica-db-schema-bindings/src/generated/types.ts b/packages/replica-db-schema-bindings/src/generated/types.ts @@ -1,6 +1,5 @@ // @generated by cargo xtask generate ts // Do not edit by hand. -import type { IResult, IResultList, IResultPass } from "@radroots/types-bindings"; export type Farm = { id: string, created_at: string, updated_at: string, d_tag: string, pubkey: string, name: string, about: string | null, website: string | null, picture: string | null, banner: string | null, location_primary: string | null, location_city: string | null, location_region: string | null, location_country: string | null, }; export type FarmGcsLocation = { id: string, created_at: string, updated_at: string, farm_id: string, gcs_location_id: string, role: string, }; @@ -35,11 +34,11 @@ export type GcsLocationTradeProductArgs = { id: string, }; export type IFarmCreate = IFarmFields; -export type IFarmCreateResolve = IResult<Farm>; +export type IFarmCreateResolve = ReplicaSchemaResult<Farm>; export type IFarmDelete = IFarmFindOne; -export type IFarmDeleteResolve = IResult<string>; +export type IFarmDeleteResolve = ReplicaSchemaResult<string>; export type IFarmFields = { d_tag: string, pubkey: string, name: string, about?: string | null, website?: string | null, picture?: string | null, banner?: string | null, location_primary?: string | null, location_city?: string | null, location_region?: string | null, location_country?: string | null, }; @@ -51,21 +50,21 @@ export type IFarmFindMany = IFarmFindManyArgs; export type IFarmFindManyArgs = { filter: IFarmFieldsFilter | null, }; -export type IFarmFindManyResolve = IResultList<Farm>; +export type IFarmFindManyResolve = ReplicaSchemaResultList<Farm>; export type IFarmFindOne = IFarmFindOneArgs; export type IFarmFindOneArgs = { on: FarmQueryBindValues, }; -export type IFarmFindOneResolve = IResult<Farm | null>; +export type IFarmFindOneResolve = ReplicaSchemaResult<Farm | null>; export type IFarmGcsLocationCreate = IFarmGcsLocationFields; -export type IFarmGcsLocationCreateResolve = IResult<FarmGcsLocation>; +export type IFarmGcsLocationCreateResolve = ReplicaSchemaResult<FarmGcsLocation>; export type IFarmGcsLocationDelete = IFarmGcsLocationFindOne; -export type IFarmGcsLocationDeleteResolve = IResult<string>; +export type IFarmGcsLocationDeleteResolve = ReplicaSchemaResult<string>; export type IFarmGcsLocationFields = { farm_id: string, gcs_location_id: string, role: string, }; @@ -77,27 +76,27 @@ export type IFarmGcsLocationFindMany = IFarmGcsLocationFindManyArgs; export type IFarmGcsLocationFindManyArgs = { filter: IFarmGcsLocationFieldsFilter | null, }; -export type IFarmGcsLocationFindManyResolve = IResultList<FarmGcsLocation>; +export type IFarmGcsLocationFindManyResolve = ReplicaSchemaResultList<FarmGcsLocation>; export type IFarmGcsLocationFindOne = IFarmGcsLocationFindOneArgs; export type IFarmGcsLocationFindOneArgs = { on: FarmGcsLocationQueryBindValues, }; -export type IFarmGcsLocationFindOneResolve = IResult<FarmGcsLocation | null>; +export type IFarmGcsLocationFindOneResolve = ReplicaSchemaResult<FarmGcsLocation | null>; export type IFarmGcsLocationUpdate = IFarmGcsLocationUpdateArgs; export type IFarmGcsLocationUpdateArgs = { on: FarmGcsLocationQueryBindValues, fields: IFarmGcsLocationFieldsPartial, }; -export type IFarmGcsLocationUpdateResolve = IResult<FarmGcsLocation>; +export type IFarmGcsLocationUpdateResolve = ReplicaSchemaResult<FarmGcsLocation>; export type IFarmMemberClaimCreate = IFarmMemberClaimFields; -export type IFarmMemberClaimCreateResolve = IResult<FarmMemberClaim>; +export type IFarmMemberClaimCreateResolve = ReplicaSchemaResult<FarmMemberClaim>; export type IFarmMemberClaimDelete = IFarmMemberClaimFindOne; -export type IFarmMemberClaimDeleteResolve = IResult<string>; +export type IFarmMemberClaimDeleteResolve = ReplicaSchemaResult<string>; export type IFarmMemberClaimFields = { member_pubkey: string, farm_pubkey: string, }; @@ -109,27 +108,27 @@ export type IFarmMemberClaimFindMany = IFarmMemberClaimFindManyArgs; export type IFarmMemberClaimFindManyArgs = { filter: IFarmMemberClaimFieldsFilter | null, }; -export type IFarmMemberClaimFindManyResolve = IResultList<FarmMemberClaim>; +export type IFarmMemberClaimFindManyResolve = ReplicaSchemaResultList<FarmMemberClaim>; export type IFarmMemberClaimFindOne = IFarmMemberClaimFindOneArgs; export type IFarmMemberClaimFindOneArgs = { on: FarmMemberClaimQueryBindValues, }; -export type IFarmMemberClaimFindOneResolve = IResult<FarmMemberClaim | null>; +export type IFarmMemberClaimFindOneResolve = ReplicaSchemaResult<FarmMemberClaim | null>; export type IFarmMemberClaimUpdate = IFarmMemberClaimUpdateArgs; export type IFarmMemberClaimUpdateArgs = { on: FarmMemberClaimQueryBindValues, fields: IFarmMemberClaimFieldsPartial, }; -export type IFarmMemberClaimUpdateResolve = IResult<FarmMemberClaim>; +export type IFarmMemberClaimUpdateResolve = ReplicaSchemaResult<FarmMemberClaim>; export type IFarmMemberCreate = IFarmMemberFields; -export type IFarmMemberCreateResolve = IResult<FarmMember>; +export type IFarmMemberCreateResolve = ReplicaSchemaResult<FarmMember>; export type IFarmMemberDelete = IFarmMemberFindOne; -export type IFarmMemberDeleteResolve = IResult<string>; +export type IFarmMemberDeleteResolve = ReplicaSchemaResult<string>; export type IFarmMemberFields = { farm_id: string, member_pubkey: string, role: string, }; @@ -141,27 +140,27 @@ export type IFarmMemberFindMany = IFarmMemberFindManyArgs; export type IFarmMemberFindManyArgs = { filter: IFarmMemberFieldsFilter | null, }; -export type IFarmMemberFindManyResolve = IResultList<FarmMember>; +export type IFarmMemberFindManyResolve = ReplicaSchemaResultList<FarmMember>; export type IFarmMemberFindOne = IFarmMemberFindOneArgs; export type IFarmMemberFindOneArgs = { on: FarmMemberQueryBindValues, }; -export type IFarmMemberFindOneResolve = IResult<FarmMember | null>; +export type IFarmMemberFindOneResolve = ReplicaSchemaResult<FarmMember | null>; export type IFarmMemberUpdate = IFarmMemberUpdateArgs; export type IFarmMemberUpdateArgs = { on: FarmMemberQueryBindValues, fields: IFarmMemberFieldsPartial, }; -export type IFarmMemberUpdateResolve = IResult<FarmMember>; +export type IFarmMemberUpdateResolve = ReplicaSchemaResult<FarmMember>; export type IFarmTagCreate = IFarmTagFields; -export type IFarmTagCreateResolve = IResult<FarmTag>; +export type IFarmTagCreateResolve = ReplicaSchemaResult<FarmTag>; export type IFarmTagDelete = IFarmTagFindOne; -export type IFarmTagDeleteResolve = IResult<string>; +export type IFarmTagDeleteResolve = ReplicaSchemaResult<string>; export type IFarmTagFields = { farm_id: string, tag: string, }; @@ -173,33 +172,33 @@ export type IFarmTagFindMany = IFarmTagFindManyArgs; export type IFarmTagFindManyArgs = { filter: IFarmTagFieldsFilter | null, }; -export type IFarmTagFindManyResolve = IResultList<FarmTag>; +export type IFarmTagFindManyResolve = ReplicaSchemaResultList<FarmTag>; export type IFarmTagFindOne = IFarmTagFindOneArgs; export type IFarmTagFindOneArgs = { on: FarmTagQueryBindValues, }; -export type IFarmTagFindOneResolve = IResult<FarmTag | null>; +export type IFarmTagFindOneResolve = ReplicaSchemaResult<FarmTag | null>; export type IFarmTagUpdate = IFarmTagUpdateArgs; export type IFarmTagUpdateArgs = { on: FarmTagQueryBindValues, fields: IFarmTagFieldsPartial, }; -export type IFarmTagUpdateResolve = IResult<FarmTag>; +export type IFarmTagUpdateResolve = ReplicaSchemaResult<FarmTag>; export type IFarmUpdate = IFarmUpdateArgs; export type IFarmUpdateArgs = { on: FarmQueryBindValues, fields: IFarmFieldsPartial, }; -export type IFarmUpdateResolve = IResult<Farm>; +export type IFarmUpdateResolve = ReplicaSchemaResult<Farm>; export type IGcsLocationCreate = IGcsLocationFields; -export type IGcsLocationCreateResolve = IResult<GcsLocation>; +export type IGcsLocationCreateResolve = ReplicaSchemaResult<GcsLocation>; export type IGcsLocationDelete = IGcsLocationFindOne; -export type IGcsLocationDeleteResolve = IResult<string>; +export type IGcsLocationDeleteResolve = ReplicaSchemaResult<string>; export type IGcsLocationFields = { d_tag: string, lat: number, lng: number, geohash: string, point: string, polygon: string, accuracy?: number | null, altitude?: number | null, tag_0?: string | null, label?: string | null, area?: number | null, elevation?: number | null, soil?: string | null, climate?: string | null, gc_id?: string | null, gc_name?: string | null, gc_admin1_id?: string | null, gc_admin1_name?: string | null, gc_country_id?: string | null, gc_country_name?: string | null, }; @@ -209,7 +208,7 @@ export type IGcsLocationFieldsPartial = { d_tag?: ReplicaDbJsonValue | null, lat export type IGcsLocationFindMany = { filter: IGcsLocationFieldsFilter | null, } | { rel: GcsLocationFindManyRel, }; -export type IGcsLocationFindManyResolve = IResultList<GcsLocation>; +export type IGcsLocationFindManyResolve = ReplicaSchemaResultList<GcsLocation>; export type IGcsLocationFindOne = IGcsLocationFindOneArgs | IGcsLocationFindOneRelArgs; @@ -217,21 +216,21 @@ export type IGcsLocationFindOneArgs = { on: GcsLocationQueryBindValues, }; export type IGcsLocationFindOneRelArgs = { rel: GcsLocationFindManyRel, }; -export type IGcsLocationFindOneResolve = IResult<GcsLocation | null>; +export type IGcsLocationFindOneResolve = ReplicaSchemaResult<GcsLocation | null>; export type IGcsLocationUpdate = IGcsLocationUpdateArgs; export type IGcsLocationUpdateArgs = { on: GcsLocationQueryBindValues, fields: IGcsLocationFieldsPartial, }; -export type IGcsLocationUpdateResolve = IResult<GcsLocation>; +export type IGcsLocationUpdateResolve = ReplicaSchemaResult<GcsLocation>; export type ILogErrorCreate = ILogErrorFields; -export type ILogErrorCreateResolve = IResult<LogError>; +export type ILogErrorCreateResolve = ReplicaSchemaResult<LogError>; export type ILogErrorDelete = ILogErrorFindOne; -export type ILogErrorDeleteResolve = IResult<string>; +export type ILogErrorDeleteResolve = ReplicaSchemaResult<string>; export type ILogErrorFields = { error: string, message: string, stack_trace?: string | null, cause?: string | null, app_system: string, app_version: string, nostr_pubkey: string, data?: string | null, }; @@ -243,27 +242,27 @@ export type ILogErrorFindMany = ILogErrorFindManyArgs; export type ILogErrorFindManyArgs = { filter: ILogErrorFieldsFilter | null, }; -export type ILogErrorFindManyResolve = IResultList<LogError>; +export type ILogErrorFindManyResolve = ReplicaSchemaResultList<LogError>; export type ILogErrorFindOne = ILogErrorFindOneArgs; export type ILogErrorFindOneArgs = { on: LogErrorQueryBindValues, }; -export type ILogErrorFindOneResolve = IResult<LogError | null>; +export type ILogErrorFindOneResolve = ReplicaSchemaResult<LogError | null>; export type ILogErrorUpdate = ILogErrorUpdateArgs; export type ILogErrorUpdateArgs = { on: LogErrorQueryBindValues, fields: ILogErrorFieldsPartial, }; -export type ILogErrorUpdateResolve = IResult<LogError>; +export type ILogErrorUpdateResolve = ReplicaSchemaResult<LogError>; export type IMediaImageCreate = IMediaImageFields; -export type IMediaImageCreateResolve = IResult<MediaImage>; +export type IMediaImageCreateResolve = ReplicaSchemaResult<MediaImage>; export type IMediaImageDelete = IMediaImageFindOne; -export type IMediaImageDeleteResolve = IResult<string>; +export type IMediaImageDeleteResolve = ReplicaSchemaResult<string>; export type IMediaImageFields = { file_path: string, mime_type: string, res_base: string, res_path: string, label?: string | null, description?: string | null, }; @@ -273,7 +272,7 @@ export type IMediaImageFieldsPartial = { file_path?: ReplicaDbJsonValue | null, export type IMediaImageFindMany = { filter: IMediaImageFieldsFilter | null, } | { rel: MediaImageFindManyRel, }; -export type IMediaImageFindManyResolve = IResultList<MediaImage>; +export type IMediaImageFindManyResolve = ReplicaSchemaResultList<MediaImage>; export type IMediaImageFindOne = IMediaImageFindOneArgs | IMediaImageFindOneRelArgs; @@ -281,21 +280,21 @@ export type IMediaImageFindOneArgs = { on: MediaImageQueryBindValues, }; export type IMediaImageFindOneRelArgs = { rel: MediaImageFindManyRel, }; -export type IMediaImageFindOneResolve = IResult<MediaImage | null>; +export type IMediaImageFindOneResolve = ReplicaSchemaResult<MediaImage | null>; export type IMediaImageUpdate = IMediaImageUpdateArgs; export type IMediaImageUpdateArgs = { on: MediaImageQueryBindValues, fields: IMediaImageFieldsPartial, }; -export type IMediaImageUpdateResolve = IResult<MediaImage>; +export type IMediaImageUpdateResolve = ReplicaSchemaResult<MediaImage>; export type INostrEventHeadCreate = INostrEventHeadFields; -export type INostrEventHeadCreateResolve = IResult<NostrEventHead>; +export type INostrEventHeadCreateResolve = ReplicaSchemaResult<NostrEventHead>; export type INostrEventHeadDelete = INostrEventHeadFindOne; -export type INostrEventHeadDeleteResolve = IResult<string>; +export type INostrEventHeadDeleteResolve = ReplicaSchemaResult<string>; export type INostrEventHeadFields = { key: string, kind: number, pubkey: string, d_tag: string, last_event_id: string, last_created_at: number, content_hash: string, }; @@ -307,27 +306,27 @@ export type INostrEventHeadFindMany = INostrEventHeadFindManyArgs; export type INostrEventHeadFindManyArgs = { filter: INostrEventHeadFieldsFilter | null, }; -export type INostrEventHeadFindManyResolve = IResultList<NostrEventHead>; +export type INostrEventHeadFindManyResolve = ReplicaSchemaResultList<NostrEventHead>; export type INostrEventHeadFindOne = INostrEventHeadFindOneArgs; export type INostrEventHeadFindOneArgs = { on: NostrEventHeadQueryBindValues, }; -export type INostrEventHeadFindOneResolve = IResult<NostrEventHead | null>; +export type INostrEventHeadFindOneResolve = ReplicaSchemaResult<NostrEventHead | null>; export type INostrEventHeadUpdate = INostrEventHeadUpdateArgs; export type INostrEventHeadUpdateArgs = { on: NostrEventHeadQueryBindValues, fields: INostrEventHeadFieldsPartial, }; -export type INostrEventHeadUpdateResolve = IResult<NostrEventHead>; +export type INostrEventHeadUpdateResolve = ReplicaSchemaResult<NostrEventHead>; export type INostrProfileCreate = INostrProfileFields; -export type INostrProfileCreateResolve = IResult<NostrProfile>; +export type INostrProfileCreateResolve = ReplicaSchemaResult<NostrProfile>; export type INostrProfileDelete = INostrProfileFindOne; -export type INostrProfileDeleteResolve = IResult<string>; +export type INostrProfileDeleteResolve = ReplicaSchemaResult<string>; export type INostrProfileFields = { public_key: string, profile_type: string, name: string, display_name?: string | null, about?: string | null, website?: string | null, picture?: string | null, banner?: string | null, nip05?: string | null, lud06?: string | null, lud16?: string | null, }; @@ -337,7 +336,7 @@ export type INostrProfileFieldsPartial = { public_key?: ReplicaDbJsonValue | nul export type INostrProfileFindMany = { filter: INostrProfileFieldsFilter | null, } | { rel: NostrProfileFindManyRel, }; -export type INostrProfileFindManyResolve = IResultList<NostrProfile>; +export type INostrProfileFindManyResolve = ReplicaSchemaResultList<NostrProfile>; export type INostrProfileFindOne = INostrProfileFindOneArgs | INostrProfileFindOneRelArgs; @@ -345,25 +344,25 @@ export type INostrProfileFindOneArgs = { on: NostrProfileQueryBindValues, }; export type INostrProfileFindOneRelArgs = { rel: NostrProfileFindManyRel, }; -export type INostrProfileFindOneResolve = IResult<NostrProfile | null>; +export type INostrProfileFindOneResolve = ReplicaSchemaResult<NostrProfile | null>; export type INostrProfileRelayRelation = { nostr_profile: NostrProfileQueryBindValues, nostr_relay: NostrRelayQueryBindValues, }; -export type INostrProfileRelayResolve = IResultPass; +export type INostrProfileRelayResolve = ReplicaSchemaResultPass; export type INostrProfileUpdate = INostrProfileUpdateArgs; export type INostrProfileUpdateArgs = { on: NostrProfileQueryBindValues, fields: INostrProfileFieldsPartial, }; -export type INostrProfileUpdateResolve = IResult<NostrProfile>; +export type INostrProfileUpdateResolve = ReplicaSchemaResult<NostrProfile>; export type INostrRelayCreate = INostrRelayFields; -export type INostrRelayCreateResolve = IResult<NostrRelay>; +export type INostrRelayCreateResolve = ReplicaSchemaResult<NostrRelay>; export type INostrRelayDelete = INostrRelayFindOne; -export type INostrRelayDeleteResolve = IResult<string>; +export type INostrRelayDeleteResolve = ReplicaSchemaResult<string>; export type INostrRelayFields = { url: string, relay_id?: string | null, name?: string | null, description?: string | null, pubkey?: string | null, contact?: string | null, supported_nips?: string | null, software?: string | null, version?: string | null, data?: string | null, }; @@ -373,7 +372,7 @@ export type INostrRelayFieldsPartial = { url?: ReplicaDbJsonValue | null, relay_ export type INostrRelayFindMany = { filter: INostrRelayFieldsFilter | null, } | { rel: NostrRelayFindManyRel, }; -export type INostrRelayFindManyResolve = IResultList<NostrRelay>; +export type INostrRelayFindManyResolve = ReplicaSchemaResultList<NostrRelay>; export type INostrRelayFindOne = INostrRelayFindOneArgs | INostrRelayFindOneRelArgs; @@ -381,21 +380,21 @@ export type INostrRelayFindOneArgs = { on: NostrRelayQueryBindValues, }; export type INostrRelayFindOneRelArgs = { rel: NostrRelayFindManyRel, }; -export type INostrRelayFindOneResolve = IResult<NostrRelay | null>; +export type INostrRelayFindOneResolve = ReplicaSchemaResult<NostrRelay | null>; export type INostrRelayUpdate = INostrRelayUpdateArgs; export type INostrRelayUpdateArgs = { on: NostrRelayQueryBindValues, fields: INostrRelayFieldsPartial, }; -export type INostrRelayUpdateResolve = IResult<NostrRelay>; +export type INostrRelayUpdateResolve = ReplicaSchemaResult<NostrRelay>; export type IPlotCreate = IPlotFields; -export type IPlotCreateResolve = IResult<Plot>; +export type IPlotCreateResolve = ReplicaSchemaResult<Plot>; export type IPlotDelete = IPlotFindOne; -export type IPlotDeleteResolve = IResult<string>; +export type IPlotDeleteResolve = ReplicaSchemaResult<string>; export type IPlotFields = { d_tag: string, farm_id: string, name: string, about?: string | null, location_primary?: string | null, location_city?: string | null, location_region?: string | null, location_country?: string | null, }; @@ -407,21 +406,21 @@ export type IPlotFindMany = IPlotFindManyArgs; export type IPlotFindManyArgs = { filter: IPlotFieldsFilter | null, }; -export type IPlotFindManyResolve = IResultList<Plot>; +export type IPlotFindManyResolve = ReplicaSchemaResultList<Plot>; export type IPlotFindOne = IPlotFindOneArgs; export type IPlotFindOneArgs = { on: PlotQueryBindValues, }; -export type IPlotFindOneResolve = IResult<Plot | null>; +export type IPlotFindOneResolve = ReplicaSchemaResult<Plot | null>; export type IPlotGcsLocationCreate = IPlotGcsLocationFields; -export type IPlotGcsLocationCreateResolve = IResult<PlotGcsLocation>; +export type IPlotGcsLocationCreateResolve = ReplicaSchemaResult<PlotGcsLocation>; export type IPlotGcsLocationDelete = IPlotGcsLocationFindOne; -export type IPlotGcsLocationDeleteResolve = IResult<string>; +export type IPlotGcsLocationDeleteResolve = ReplicaSchemaResult<string>; export type IPlotGcsLocationFields = { plot_id: string, gcs_location_id: string, role: string, }; @@ -433,27 +432,27 @@ export type IPlotGcsLocationFindMany = IPlotGcsLocationFindManyArgs; export type IPlotGcsLocationFindManyArgs = { filter: IPlotGcsLocationFieldsFilter | null, }; -export type IPlotGcsLocationFindManyResolve = IResultList<PlotGcsLocation>; +export type IPlotGcsLocationFindManyResolve = ReplicaSchemaResultList<PlotGcsLocation>; export type IPlotGcsLocationFindOne = IPlotGcsLocationFindOneArgs; export type IPlotGcsLocationFindOneArgs = { on: PlotGcsLocationQueryBindValues, }; -export type IPlotGcsLocationFindOneResolve = IResult<PlotGcsLocation | null>; +export type IPlotGcsLocationFindOneResolve = ReplicaSchemaResult<PlotGcsLocation | null>; export type IPlotGcsLocationUpdate = IPlotGcsLocationUpdateArgs; export type IPlotGcsLocationUpdateArgs = { on: PlotGcsLocationQueryBindValues, fields: IPlotGcsLocationFieldsPartial, }; -export type IPlotGcsLocationUpdateResolve = IResult<PlotGcsLocation>; +export type IPlotGcsLocationUpdateResolve = ReplicaSchemaResult<PlotGcsLocation>; export type IPlotTagCreate = IPlotTagFields; -export type IPlotTagCreateResolve = IResult<PlotTag>; +export type IPlotTagCreateResolve = ReplicaSchemaResult<PlotTag>; export type IPlotTagDelete = IPlotTagFindOne; -export type IPlotTagDeleteResolve = IResult<string>; +export type IPlotTagDeleteResolve = ReplicaSchemaResult<string>; export type IPlotTagFields = { plot_id: string, tag: string, }; @@ -465,33 +464,33 @@ export type IPlotTagFindMany = IPlotTagFindManyArgs; export type IPlotTagFindManyArgs = { filter: IPlotTagFieldsFilter | null, }; -export type IPlotTagFindManyResolve = IResultList<PlotTag>; +export type IPlotTagFindManyResolve = ReplicaSchemaResultList<PlotTag>; export type IPlotTagFindOne = IPlotTagFindOneArgs; export type IPlotTagFindOneArgs = { on: PlotTagQueryBindValues, }; -export type IPlotTagFindOneResolve = IResult<PlotTag | null>; +export type IPlotTagFindOneResolve = ReplicaSchemaResult<PlotTag | null>; export type IPlotTagUpdate = IPlotTagUpdateArgs; export type IPlotTagUpdateArgs = { on: PlotTagQueryBindValues, fields: IPlotTagFieldsPartial, }; -export type IPlotTagUpdateResolve = IResult<PlotTag>; +export type IPlotTagUpdateResolve = ReplicaSchemaResult<PlotTag>; export type IPlotUpdate = IPlotUpdateArgs; export type IPlotUpdateArgs = { on: PlotQueryBindValues, fields: IPlotFieldsPartial, }; -export type IPlotUpdateResolve = IResult<Plot>; +export type IPlotUpdateResolve = ReplicaSchemaResult<Plot>; export type ITradeProductCreate = ITradeProductFields; -export type ITradeProductCreateResolve = IResult<TradeProduct>; +export type ITradeProductCreateResolve = ReplicaSchemaResult<TradeProduct>; export type ITradeProductDelete = ITradeProductFindOne; -export type ITradeProductDeleteResolve = IResult<string>; +export type ITradeProductDeleteResolve = ReplicaSchemaResult<string>; export type ITradeProductFields = { key: string, category: string, title: string, summary: string, process: string, lot: string, profile: string, year: bigint, qty_amt: number, qty_amt_exact: string, qty_unit: string, qty_label?: string | null, qty_avail?: bigint | null, price_amt: number, price_amt_exact: string, price_currency: string, price_qty_amt: number, price_qty_amt_exact: string, price_qty_unit: string, listing_addr?: string | null, primary_bin_id?: string | null, verified_primary_bin_id?: string | null, notes?: string | null, }; @@ -503,27 +502,27 @@ export type ITradeProductFindMany = ITradeProductFindManyArgs; export type ITradeProductFindManyArgs = { filter: ITradeProductFieldsFilter | null, }; -export type ITradeProductFindManyResolve = IResultList<TradeProduct>; +export type ITradeProductFindManyResolve = ReplicaSchemaResultList<TradeProduct>; export type ITradeProductFindOne = ITradeProductFindOneArgs; export type ITradeProductFindOneArgs = { on: TradeProductQueryBindValues, }; -export type ITradeProductFindOneResolve = IResult<TradeProduct | null>; +export type ITradeProductFindOneResolve = ReplicaSchemaResult<TradeProduct | null>; export type ITradeProductLocationRelation = { trade_product: TradeProductQueryBindValues, gcs_location: GcsLocationQueryBindValues, }; -export type ITradeProductLocationResolve = IResultPass; +export type ITradeProductLocationResolve = ReplicaSchemaResultPass; export type ITradeProductMediaRelation = { trade_product: TradeProductQueryBindValues, media_image: MediaImageQueryBindValues, }; -export type ITradeProductMediaResolve = IResultPass; +export type ITradeProductMediaResolve = ReplicaSchemaResultPass; export type ITradeProductUpdate = ITradeProductUpdateArgs; export type ITradeProductUpdateArgs = { on: TradeProductQueryBindValues, fields: ITradeProductFieldsPartial, }; -export type ITradeProductUpdateResolve = IResult<TradeProduct>; +export type ITradeProductUpdateResolve = ReplicaSchemaResult<TradeProduct>; export type LogError = { id: string, created_at: string, updated_at: string, error: string, message: string, stack_trace: string | null, cause: string | null, app_system: string, app_version: string, nostr_pubkey: string, data: string | null, }; @@ -571,6 +570,14 @@ export type PlotTagQueryBindValues = { id: string, } | { plot_id: string, } | { export type ReplicaDbJsonValue = null | boolean | number | string | Array<ReplicaDbJsonValue> | { [key: string]: ReplicaDbJsonValue }; +export type ReplicaSchemaError<T> = { err: T, }; + +export type ReplicaSchemaResult<T> = { result: T, }; + +export type ReplicaSchemaResultList<T> = { results: Array<T>, }; + +export type ReplicaSchemaResultPass = { pass: boolean, }; + export type TradeProduct = { id: string, created_at: string, updated_at: string, key: string, category: string, title: string, summary: string, process: string, lot: string, profile: string, year: bigint, qty_amt: number, qty_amt_exact: string | null, qty_unit: string, qty_label: string | null, qty_avail: bigint | null, price_amt: number, price_amt_exact: string | null, price_currency: string, price_qty_amt: number, price_qty_amt_exact: string | null, price_qty_unit: string, listing_addr: string | null, primary_bin_id: string | null, verified_primary_bin_id: string | null, notes: string | null, }; export type TradeProductQueryBindValues = { id: string, }; diff --git a/packages/types-bindings/LICENSE-APACHE b/packages/types-bindings/LICENSE-APACHE @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright 2026 Tyson Lupul - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/packages/types-bindings/LICENSE-MIT b/packages/types-bindings/LICENSE-MIT @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2026 Tyson Lupul - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/packages/types-bindings/README.md b/packages/types-bindings/README.md @@ -1,9 +0,0 @@ -# @radroots/types-bindings - -Shared TypeScript bindings for Radroots result envelopes - -This package publishes generated ESM JavaScript, TypeScript declarations, and any runtime artifacts from the Radroots SDK build pipeline. Runtime files are distributed from `dist/`; source and provenance metadata are kept outside the npm package payload. - -## License - -Licensed under either MIT or Apache-2.0, at your option. See `LICENSE-MIT` and `LICENSE-APACHE`. diff --git a/packages/types-bindings/package.json b/packages/types-bindings/package.json @@ -1,36 +0,0 @@ -{ - "name": "@radroots/types-bindings", - "version": "0.1.0", - "description": "Shared TypeScript bindings for Radroots result envelopes", - "license": "MIT OR Apache-2.0", - "homepage": "https://radroots.org", - "repository": { - "type": "git", - "url": "git+https://github.com/radrootslabs/sdk.git", - "directory": "packages/types-bindings" - }, - "publishConfig": { - "access": "public" - }, - "type": "module", - "sideEffects": false, - "files": [ - "dist", - "README.md", - "LICENSE-MIT", - "LICENSE-APACHE" - ], - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "exports": { - ".": { - "types": "./dist/index.d.ts", - "import": "./dist/index.js", - "default": "./dist/index.js" - } - }, - "scripts": { - "build": "tsc -p tsconfig.json", - "typecheck": "tsc -p tsconfig.json --noEmit" - } -} diff --git a/packages/types-bindings/src/generated/types.ts b/packages/types-bindings/src/generated/types.ts @@ -1,9 +0,0 @@ -// @generated by cargo xtask generate ts -// Do not edit by hand. -export type IError<T> = { err: T, }; - -export type IResult<T> = { result: T, }; - -export type IResultList<T> = { results: Array<T>, }; - -export type IResultPass = { pass: boolean, }; diff --git a/packages/types-bindings/src/index.ts b/packages/types-bindings/src/index.ts @@ -1 +0,0 @@ -export * from "./generated/types.js"; diff --git a/packages/types-bindings/tsconfig.json b/packages/types-bindings/tsconfig.json @@ -1,10 +0,0 @@ -{ - "extends": "../../tsconfig.base.json", - "compilerOptions": { - "outDir": "dist", - "rootDir": "src" - }, - "include": [ - "src/**/*.ts" - ] -} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml @@ -26,11 +26,7 @@ importers: packages/identity-bindings: {} - packages/replica-db-schema-bindings: - dependencies: - '@radroots/types-bindings': - specifier: workspace:^ - version: link:../types-bindings + packages/replica-db-schema-bindings: {} packages/replica-db-wasm: {} @@ -45,8 +41,6 @@ importers: specifier: workspace:^ version: link:../events-bindings - packages/types-bindings: {} - packages: typescript@5.9.3: diff --git a/tools/xtask/Cargo.toml b/tools/xtask/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/xtask/src/contracts.rs b/tools/xtask/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/xtask/src/dto_roots.rs b/tools/xtask/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/xtask/src/output.rs b/tools/xtask/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/xtask/src/package_matrix.rs b/tools/xtask/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); }