From b683ddc3ddfac87fd1148953181e807c0dcd2cdb Mon Sep 17 00:00:00 2001 From: Orual Date: Sun, 14 Dec 2025 01:49:06 -0500 Subject: [PATCH] indexer endpoints --- .../sh_weaver_edit_getContributors.json | 46 + .../lexicons/sh_weaver_edit_listDrafts.json | 89 ++ .../sh_weaver_notebook_getEntryNotebooks.json | 66 + crates/weaver-api/src/app_bsky/actor.rs | 136 +- .../weaver-api/src/app_bsky/ageassurance.rs | 122 +- crates/weaver-api/src/app_bsky/embed.rs | 26 +- .../weaver-api/src/app_bsky/embed/external.rs | 78 +- .../weaver-api/src/app_bsky/embed/images.rs | 56 +- .../weaver-api/src/app_bsky/embed/record.rs | 94 +- .../src/app_bsky/embed/record_with_media.rs | 26 +- crates/weaver-api/src/app_bsky/feed.rs | 242 ++-- .../weaver-api/src/app_bsky/feed/generator.rs | 30 +- .../weaver-api/src/app_bsky/feed/get_likes.rs | 30 +- crates/weaver-api/src/app_bsky/feed/like.rs | 26 +- crates/weaver-api/src/app_bsky/feed/post.rs | 30 +- .../weaver-api/src/app_bsky/feed/postgate.rs | 26 +- crates/weaver-api/src/app_bsky/feed/repost.rs | 26 +- .../src/app_bsky/feed/threadgate.rs | 26 +- crates/weaver-api/src/app_bsky/graph.rs | 382 +++--- crates/weaver-api/src/app_bsky/graph/list.rs | 30 +- .../weaver-api/src/app_bsky/graph/listitem.rs | 30 +- .../src/app_bsky/graph/starterpack.rs | 30 +- .../src/app_bsky/graph/verification.rs | 34 +- crates/weaver-api/src/app_bsky/labeler.rs | 150 +-- .../src/app_bsky/labeler/service.rs | 26 +- .../weaver-api/src/app_bsky/notification.rs | 396 +++--- .../notification/list_notifications.rs | 144 +- .../notification/put_activity_subscription.rs | 26 +- .../app_bsky/notification/register_push.rs | 34 +- .../app_bsky/notification/unregister_push.rs | 62 +- .../weaver-api/src/app_bsky/richtext/facet.rs | 26 +- crates/weaver-api/src/app_bsky/unspecced.rs | 350 ++--- .../unspecced/get_post_thread_other_v2.rs | 30 +- .../app_bsky/unspecced/get_post_thread_v2.rs | 30 +- crates/weaver-api/src/app_bsky/video.rs | 30 +- crates/weaver-api/src/chat_bsky/convo.rs | 428 +++--- .../src/chat_bsky/convo/send_message.rs | 26 +- .../moderation/get_actor_metadata.rs | 34 +- .../moderation/update_actor_access.rs | 26 +- .../src/com_atproto/admin/send_email.rs | 30 +- .../com_atproto/admin/update_account_email.rs | 26 +- .../admin/update_account_handle.rs | 26 +- crates/weaver-api/src/com_atproto/identity.rs | 48 +- crates/weaver-api/src/com_atproto/label.rs | 148 +-- crates/weaver-api/src/com_atproto/repo.rs | 26 +- .../src/com_atproto/repo/apply_writes.rs | 56 +- .../src/com_atproto/repo/create_record.rs | 48 +- .../src/com_atproto/repo/delete_record.rs | 48 +- .../src/com_atproto/repo/get_record.rs | 30 +- .../src/com_atproto/repo/list_records.rs | 30 +- .../src/com_atproto/repo/put_record.rs | 34 +- .../src/com_atproto/repo/strong_ref.rs | 26 +- crates/weaver-api/src/com_atproto/server.rs | 160 +-- .../com_atproto/server/create_app_password.rs | 48 +- .../com_atproto/server/create_invite_codes.rs | 26 +- .../src/com_atproto/server/delete_account.rs | 48 +- .../com_atproto/server/list_app_passwords.rs | 26 +- .../src/com_atproto/sync/get_blob.rs | 26 +- .../src/com_atproto/sync/get_blocks.rs | 26 +- .../src/com_atproto/sync/get_record.rs | 48 +- .../src/com_atproto/sync/subscribe_repos.rs | 356 ++--- crates/weaver-api/src/sh_weaver/actor.rs | 82 +- crates/weaver-api/src/sh_weaver/collab.rs | 352 ++--- .../weaver-api/src/sh_weaver/collab/accept.rs | 30 +- .../src/sh_weaver/collab/session.rs | 30 +- crates/weaver-api/src/sh_weaver/edit.rs | 130 +- .../weaver-api/src/sh_weaver/edit/cursor.rs | 48 +- .../src/sh_weaver/edit/get_contributors.rs | 172 +++ .../src/sh_weaver/edit/list_drafts.rs | 693 ++++++++++ crates/weaver-api/src/sh_weaver/edit/root.rs | 26 +- .../src/sh_weaver/embed/external.rs | 78 +- .../weaver-api/src/sh_weaver/embed/images.rs | 26 +- .../src/sh_weaver/embed/record_with_media.rs | 26 +- .../weaver-api/src/sh_weaver/embed/records.rs | 94 +- .../weaver-api/src/sh_weaver/embed/video.rs | 26 +- .../weaver-api/src/sh_weaver/graph/follow.rs | 26 +- .../src/sh_weaver/graph/follow_accept.rs | 26 +- .../src/sh_weaver/graph/listitem.rs | 30 +- .../src/sh_weaver/graph/subscribe.rs | 26 +- .../src/sh_weaver/graph/subscribe_accept.rs | 26 +- crates/weaver-api/src/sh_weaver/graph/tag.rs | 48 +- crates/weaver-api/src/sh_weaver/notebook.rs | 509 +++---- .../src/sh_weaver/notebook/chapter.rs | 30 +- .../src/sh_weaver/notebook/colour_scheme.rs | 30 +- .../src/sh_weaver/notebook/entry.rs | 34 +- .../sh_weaver/notebook/get_entry_by_title.rs | 26 +- .../sh_weaver/notebook/get_entry_notebooks.rs | 516 ++++++++ .../notebook/get_notebook_by_title.rs | 26 +- .../weaver-api/src/sh_weaver/notebook/page.rs | 30 +- .../src/sh_weaver/notebook/resolve_entry.rs | 48 +- .../src/sh_weaver/notebook/theme.rs | 198 +-- .../weaver-api/src/sh_weaver/notification.rs | 162 +-- .../weaver-api/src/sh_weaver/publish/blob.rs | 26 +- .../src/tools_ozone/communication.rs | 84 +- .../weaver-api/src/tools_ozone/moderation.rs | 1168 ++++++++--------- .../moderation/cancel_scheduled_actions.rs | 52 +- .../src/tools_ozone/moderation/emit_event.rs | 30 +- .../moderation/get_account_timeline.rs | 30 +- .../tools_ozone/moderation/schedule_action.rs | 84 +- crates/weaver-api/src/tools_ozone/safelink.rs | 258 ++-- .../src/tools_ozone/safelink/add_rule.rs | 34 +- .../src/tools_ozone/safelink/update_rule.rs | 34 +- crates/weaver-api/src/tools_ozone/set.rs | 34 +- .../src/tools_ozone/set/delete_values.rs | 26 +- crates/weaver-api/src/tools_ozone/setting.rs | 110 +- .../src/tools_ozone/setting/remove_options.rs | 26 +- .../src/tools_ozone/setting/upsert_option.rs | 30 +- .../src/tools_ozone/team/add_member.rs | 26 +- .../src/tools_ozone/verification.rs | 98 +- .../verification/grant_verifications.rs | 30 +- .../src/components/editor/collab.rs | 54 + .../weaver-app/src/components/editor/sync.rs | 83 ++ crates/weaver-app/src/fetch.rs | 138 ++ crates/weaver-app/src/main.rs | 12 +- .../clickhouse/037_contributors.sql | 56 +- crates/weaver-index/src/clickhouse/client.rs | 2 + .../src/clickhouse/queries/collab.rs | 56 + .../src/clickhouse/queries/contributors.rs | 100 +- .../src/clickhouse/queries/edit.rs | 96 +- .../src/clickhouse/queries/notebooks.rs | 236 ++-- crates/weaver-index/src/endpoints/actor.rs | 58 +- crates/weaver-index/src/endpoints/collab.rs | 139 +- crates/weaver-index/src/endpoints/edit.rs | 211 ++- crates/weaver-index/src/endpoints/mod.rs | 49 + crates/weaver-index/src/endpoints/notebook.rs | 141 +- crates/weaver-index/src/server.rs | 19 +- lexicons/edit/getContributors.json | 39 + lexicons/edit/listDrafts.json | 62 + lexicons/notebook/getEntryNotebooks.json | 45 + 129 files changed, 7425 insertions(+), 4794 deletions(-) create mode 100644 crates/weaver-api/lexicons/sh_weaver_edit_getContributors.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_edit_listDrafts.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_notebook_getEntryNotebooks.json create mode 100644 crates/weaver-api/src/sh_weaver/edit/get_contributors.rs create mode 100644 crates/weaver-api/src/sh_weaver/edit/list_drafts.rs create mode 100644 crates/weaver-api/src/sh_weaver/notebook/get_entry_notebooks.rs create mode 100644 lexicons/edit/getContributors.json create mode 100644 lexicons/edit/listDrafts.json create mode 100644 lexicons/notebook/getEntryNotebooks.json diff --git a/crates/weaver-api/lexicons/sh_weaver_edit_getContributors.json b/crates/weaver-api/lexicons/sh_weaver_edit_getContributors.json new file mode 100644 index 0000000..15d0798 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_edit_getContributors.json @@ -0,0 +1,46 @@ +{ + "lexicon": 1, + "id": "sh.weaver.edit.getContributors", + "defs": { + "main": { + "type": "query", + "description": "Get evidence-based contributors for a resource (entry or notebook). Returns users who have edit history or are explicit collaborators.", + "parameters": { + "type": "params", + "required": [ + "resource" + ], + "properties": { + "includeCascaded": { + "type": "boolean", + "description": "For entries, also include notebook-level collaborators", + "default": true + }, + "resource": { + "type": "string", + "description": "AT URI of the entry or notebook", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "contributors" + ], + "properties": { + "contributors": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_edit_listDrafts.json b/crates/weaver-api/lexicons/sh_weaver_edit_listDrafts.json new file mode 100644 index 0000000..7528058 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_edit_listDrafts.json @@ -0,0 +1,89 @@ +{ + "lexicon": 1, + "id": "sh.weaver.edit.listDrafts", + "defs": { + "draftView": { + "type": "object", + "description": "Hydrated view of a draft with edit state.", + "required": [ + "uri", + "cid", + "createdAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "editRoot": { + "type": "ref", + "description": "Associated edit root if one exists", + "ref": "com.atproto.repo.strongRef" + }, + "lastEditAt": { + "type": "string", + "format": "datetime" + }, + "title": { + "type": "string", + "description": "Extracted title if available from edit state" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "main": { + "type": "query", + "description": "List draft records for an actor. Drafts are unpublished edit roots that aren't linked to a published entry.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "description": "DID or handle of the actor", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "drafts" + ], + "properties": { + "cursor": { + "type": "string" + }, + "drafts": { + "type": "array", + "items": { + "type": "ref", + "ref": "#draftView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getEntryNotebooks.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getEntryNotebooks.json new file mode 100644 index 0000000..30e74fa --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getEntryNotebooks.json @@ -0,0 +1,66 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getEntryNotebooks", + "defs": { + "main": { + "type": "query", + "description": "Get notebooks that contain an entry. An entry can appear in multiple notebooks.", + "parameters": { + "type": "params", + "required": [ + "entry" + ], + "properties": { + "entry": { + "type": "string", + "description": "AT URI of the entry", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "notebooks" + ], + "properties": { + "notebooks": { + "type": "array", + "items": { + "type": "ref", + "ref": "#notebookRef" + } + } + } + } + } + }, + "notebookRef": { + "type": "object", + "description": "Reference to a notebook containing this entry.", + "required": [ + "uri", + "cid" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "owner": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "title": { + "type": "string" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/actor.rs b/crates/weaver-api/src/app_bsky/actor.rs index e423f06..01338ff 100644 --- a/crates/weaver-api/src/app_bsky/actor.rs +++ b/crates/weaver-api/src/app_bsky/actor.rs @@ -3037,37 +3037,37 @@ pub mod known_followers_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Count; type Followers; + type Count; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Count = Unset; type Followers = Unset; - } - ///State transition - sets the `count` field to Set - pub struct SetCount(PhantomData S>); - impl sealed::Sealed for SetCount {} - impl State for SetCount { - type Count = Set; - type Followers = S::Followers; + type Count = Unset; } ///State transition - sets the `followers` field to Set pub struct SetFollowers(PhantomData S>); impl sealed::Sealed for SetFollowers {} impl State for SetFollowers { - type Count = S::Count; type Followers = Set; + type Count = S::Count; + } + ///State transition - sets the `count` field to Set + pub struct SetCount(PhantomData S>); + impl sealed::Sealed for SetCount {} + impl State for SetCount { + type Followers = S::Followers; + type Count = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `count` field - pub struct count(()); ///Marker type for the `followers` field pub struct followers(()); + ///Marker type for the `count` field + pub struct count(()); } } @@ -3140,8 +3140,8 @@ where impl<'a, S> KnownFollowersBuilder<'a, S> where S: known_followers_state::State, - S::Count: known_followers_state::IsSet, S::Followers: known_followers_state::IsSet, + S::Count: known_followers_state::IsSet, { /// Build the final struct pub fn build(self) -> KnownFollowers<'a> { @@ -5141,37 +5141,37 @@ pub mod profile_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Handle; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Handle = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Handle = S::Handle; + type Did = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Did = S::Did; type Handle = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = S::Handle; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -5454,8 +5454,8 @@ impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { impl<'a, S> ProfileViewBasicBuilder<'a, S> where S: profile_view_basic_state::State, - S::Did: profile_view_basic_state::IsSet, S::Handle: profile_view_basic_state::IsSet, + S::Did: profile_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> ProfileViewBasic<'a> { @@ -6290,67 +6290,67 @@ pub mod saved_feed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Value; type Id; - type Type; type Pinned; + type Type; + type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Value = Unset; type Id = Unset; - type Type = Unset; type Pinned = Unset; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type Value = Set; - type Id = S::Id; - type Type = S::Type; - type Pinned = S::Pinned; + type Type = Unset; + type Value = Unset; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type Value = S::Value; type Id = Set; - type Type = S::Type; type Pinned = S::Pinned; + type Type = S::Type; + type Value = S::Value; + } + ///State transition - sets the `pinned` field to Set + pub struct SetPinned(PhantomData S>); + impl sealed::Sealed for SetPinned {} + impl State for SetPinned { + type Id = S::Id; + type Pinned = Set; + type Type = S::Type; + type Value = S::Value; } ///State transition - sets the `type` field to Set pub struct SetType(PhantomData S>); impl sealed::Sealed for SetType {} impl State for SetType { - type Value = S::Value; type Id = S::Id; - type Type = Set; type Pinned = S::Pinned; - } - ///State transition - sets the `pinned` field to Set - pub struct SetPinned(PhantomData S>); - impl sealed::Sealed for SetPinned {} - impl State for SetPinned { + type Type = Set; type Value = S::Value; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { type Id = S::Id; + type Pinned = S::Pinned; type Type = S::Type; - type Pinned = Set; + type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `value` field - pub struct value(()); ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `type` field - pub struct r#type(()); ///Marker type for the `pinned` field pub struct pinned(()); + ///Marker type for the `type` field + pub struct r#type(()); + ///Marker type for the `value` field + pub struct value(()); } } @@ -6463,10 +6463,10 @@ where impl<'a, S> SavedFeedBuilder<'a, S> where S: saved_feed_state::State, - S::Value: saved_feed_state::IsSet, S::Id: saved_feed_state::IsSet, - S::Type: saved_feed_state::IsSet, S::Pinned: saved_feed_state::IsSet, + S::Type: saved_feed_state::IsSet, + S::Value: saved_feed_state::IsSet, { /// Build the final struct pub fn build(self) -> SavedFeed<'a> { @@ -6883,37 +6883,37 @@ pub mod status_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; type Status; + type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Record = Unset; type Status = Unset; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Record = Set; - type Status = S::Status; + type Record = Unset; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type Record = S::Record; type Status = Set; + type Record = S::Record; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Status = S::Status; + type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `record` field - pub struct record(()); ///Marker type for the `status` field pub struct status(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -7040,8 +7040,8 @@ where impl<'a, S> StatusViewBuilder<'a, S> where S: status_view_state::State, - S::Record: status_view_state::IsSet, S::Status: status_view_state::IsSet, + S::Record: status_view_state::IsSet, { /// Build the final struct pub fn build(self) -> StatusView<'a> { diff --git a/crates/weaver-api/src/app_bsky/ageassurance.rs b/crates/weaver-api/src/app_bsky/ageassurance.rs index 82bc4fa..3fc6e42 100644 --- a/crates/weaver-api/src/app_bsky/ageassurance.rs +++ b/crates/weaver-api/src/app_bsky/ageassurance.rs @@ -1500,37 +1500,37 @@ pub mod config_region_rule_if_account_newer_than_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Date; type Access; + type Date; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Date = Unset; type Access = Unset; - } - ///State transition - sets the `date` field to Set - pub struct SetDate(PhantomData S>); - impl sealed::Sealed for SetDate {} - impl State for SetDate { - type Date = Set; - type Access = S::Access; + type Date = Unset; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { - type Date = S::Date; type Access = Set; + type Date = S::Date; + } + ///State transition - sets the `date` field to Set + pub struct SetDate(PhantomData S>); + impl sealed::Sealed for SetDate {} + impl State for SetDate { + type Access = S::Access; + type Date = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `date` field - pub struct date(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `date` field + pub struct date(()); } } @@ -1620,8 +1620,8 @@ where impl<'a, S> ConfigRegionRuleIfAccountNewerThanBuilder<'a, S> where S: config_region_rule_if_account_newer_than_state::State, - S::Date: config_region_rule_if_account_newer_than_state::IsSet, S::Access: config_region_rule_if_account_newer_than_state::IsSet, + S::Date: config_region_rule_if_account_newer_than_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfAccountNewerThan<'a> { @@ -1694,37 +1694,37 @@ pub mod config_region_rule_if_account_older_than_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Access; type Date; + type Access; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Access = Unset; type Date = Unset; - } - ///State transition - sets the `access` field to Set - pub struct SetAccess(PhantomData S>); - impl sealed::Sealed for SetAccess {} - impl State for SetAccess { - type Access = Set; - type Date = S::Date; + type Access = Unset; } ///State transition - sets the `date` field to Set pub struct SetDate(PhantomData S>); impl sealed::Sealed for SetDate {} impl State for SetDate { - type Access = S::Access; type Date = Set; + type Access = S::Access; + } + ///State transition - sets the `access` field to Set + pub struct SetAccess(PhantomData S>); + impl sealed::Sealed for SetAccess {} + impl State for SetAccess { + type Date = S::Date; + type Access = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `access` field - pub struct access(()); ///Marker type for the `date` field pub struct date(()); + ///Marker type for the `access` field + pub struct access(()); } } @@ -1814,8 +1814,8 @@ where impl<'a, S> ConfigRegionRuleIfAccountOlderThanBuilder<'a, S> where S: config_region_rule_if_account_older_than_state::State, - S::Access: config_region_rule_if_account_older_than_state::IsSet, S::Date: config_region_rule_if_account_older_than_state::IsSet, + S::Access: config_region_rule_if_account_older_than_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfAccountOlderThan<'a> { @@ -2698,85 +2698,85 @@ pub mod event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type CountryCode; type Status; + type CreatedAt; type Access; type AttemptId; - type CreatedAt; - type CountryCode; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type CountryCode = Unset; type Status = Unset; + type CreatedAt = Unset; type Access = Unset; type AttemptId = Unset; - type CreatedAt = Unset; - type CountryCode = Unset; + } + ///State transition - sets the `country_code` field to Set + pub struct SetCountryCode(PhantomData S>); + impl sealed::Sealed for SetCountryCode {} + impl State for SetCountryCode { + type CountryCode = Set; + type Status = S::Status; + type CreatedAt = S::CreatedAt; + type Access = S::Access; + type AttemptId = S::AttemptId; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { + type CountryCode = S::CountryCode; type Status = Set; + type CreatedAt = S::CreatedAt; type Access = S::Access; type AttemptId = S::AttemptId; - type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { type CountryCode = S::CountryCode; + type Status = S::Status; + type CreatedAt = Set; + type Access = S::Access; + type AttemptId = S::AttemptId; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { + type CountryCode = S::CountryCode; type Status = S::Status; + type CreatedAt = S::CreatedAt; type Access = Set; type AttemptId = S::AttemptId; - type CreatedAt = S::CreatedAt; - type CountryCode = S::CountryCode; } ///State transition - sets the `attempt_id` field to Set pub struct SetAttemptId(PhantomData S>); impl sealed::Sealed for SetAttemptId {} impl State for SetAttemptId { - type Status = S::Status; - type Access = S::Access; - type AttemptId = Set; - type CreatedAt = S::CreatedAt; type CountryCode = S::CountryCode; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { type Status = S::Status; - type Access = S::Access; - type AttemptId = S::AttemptId; - type CreatedAt = Set; - type CountryCode = S::CountryCode; - } - ///State transition - sets the `country_code` field to Set - pub struct SetCountryCode(PhantomData S>); - impl sealed::Sealed for SetCountryCode {} - impl State for SetCountryCode { - type Status = S::Status; - type Access = S::Access; - type AttemptId = S::AttemptId; type CreatedAt = S::CreatedAt; - type CountryCode = Set; + type Access = S::Access; + type AttemptId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `country_code` field + pub struct country_code(()); ///Marker type for the `status` field pub struct status(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `access` field pub struct access(()); ///Marker type for the `attempt_id` field pub struct attempt_id(()); - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `country_code` field - pub struct country_code(()); } } @@ -3032,11 +3032,11 @@ where impl<'a, S> EventBuilder<'a, S> where S: event_state::State, + S::CountryCode: event_state::IsSet, S::Status: event_state::IsSet, + S::CreatedAt: event_state::IsSet, S::Access: event_state::IsSet, S::AttemptId: event_state::IsSet, - S::CreatedAt: event_state::IsSet, - S::CountryCode: event_state::IsSet, { /// Build the final struct pub fn build(self) -> Event<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed.rs b/crates/weaver-api/src/app_bsky/embed.rs index 27ec288..edfa136 100644 --- a/crates/weaver-api/src/app_bsky/embed.rs +++ b/crates/weaver-api/src/app_bsky/embed.rs @@ -38,37 +38,37 @@ pub mod aspect_ratio_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Height; type Width; + type Height; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Height = Unset; type Width = Unset; - } - ///State transition - sets the `height` field to Set - pub struct SetHeight(PhantomData S>); - impl sealed::Sealed for SetHeight {} - impl State for SetHeight { - type Height = Set; - type Width = S::Width; + type Height = Unset; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData S>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { - type Height = S::Height; type Width = Set; + type Height = S::Height; + } + ///State transition - sets the `height` field to Set + pub struct SetHeight(PhantomData S>); + impl sealed::Sealed for SetHeight {} + impl State for SetHeight { + type Width = S::Width; + type Height = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `height` field - pub struct height(()); ///Marker type for the `width` field pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); } } @@ -138,8 +138,8 @@ where impl<'a, S> AspectRatioBuilder<'a, S> where S: aspect_ratio_state::State, - S::Height: aspect_ratio_state::IsSet, S::Width: aspect_ratio_state::IsSet, + S::Height: aspect_ratio_state::IsSet, { /// Build the final struct pub fn build(self) -> AspectRatio<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/external.rs b/crates/weaver-api/src/app_bsky/embed/external.rs index cc6067e..2b1473d 100644 --- a/crates/weaver-api/src/app_bsky/embed/external.rs +++ b/crates/weaver-api/src/app_bsky/embed/external.rs @@ -38,49 +38,49 @@ pub mod external_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Description; type Uri; + type Description; type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Description = Unset; type Uri = Unset; + type Description = Unset; type Title = Unset; } - ///State transition - sets the `description` field to Set - pub struct SetDescription(PhantomData S>); - impl sealed::Sealed for SetDescription {} - impl State for SetDescription { - type Description = Set; - type Uri = S::Uri; - type Title = S::Title; - } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Description = S::Description; type Uri = Set; + type Description = S::Description; + type Title = S::Title; + } + ///State transition - sets the `description` field to Set + pub struct SetDescription(PhantomData S>); + impl sealed::Sealed for SetDescription {} + impl State for SetDescription { + type Uri = S::Uri; + type Description = Set; type Title = S::Title; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData S>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { - type Description = S::Description; type Uri = S::Uri; + type Description = S::Description; type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `description` field - pub struct description(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `description` field + pub struct description(()); ///Marker type for the `title` field pub struct title(()); } @@ -195,8 +195,8 @@ where impl<'a, S> ExternalBuilder<'a, S> where S: external_state::State, - S::Description: external_state::IsSet, S::Uri: external_state::IsSet, + S::Description: external_state::IsSet, S::Title: external_state::IsSet, { /// Build the final struct @@ -784,51 +784,51 @@ pub mod view_external_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; - type Uri; type Description; + type Uri; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Title = Unset; - type Uri = Unset; type Description = Unset; + type Uri = Unset; + type Title = Unset; } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; + ///State transition - sets the `description` field to Set + pub struct SetDescription(PhantomData S>); + impl sealed::Sealed for SetDescription {} + impl State for SetDescription { + type Description = Set; type Uri = S::Uri; - type Description = S::Description; + type Title = S::Title; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Title = S::Title; - type Uri = Set; type Description = S::Description; - } - ///State transition - sets the `description` field to Set - pub struct SetDescription(PhantomData S>); - impl sealed::Sealed for SetDescription {} - impl State for SetDescription { + type Uri = Set; type Title = S::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Description = S::Description; type Uri = S::Uri; - type Description = Set; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `title` field - pub struct title(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `description` field pub struct description(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -941,9 +941,9 @@ where impl<'a, S> ViewExternalBuilder<'a, S> where S: view_external_state::State, - S::Title: view_external_state::IsSet, - S::Uri: view_external_state::IsSet, S::Description: view_external_state::IsSet, + S::Uri: view_external_state::IsSet, + S::Title: view_external_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewExternal<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/images.rs b/crates/weaver-api/src/app_bsky/embed/images.rs index 1f125f8..ac6f664 100644 --- a/crates/weaver-api/src/app_bsky/embed/images.rs +++ b/crates/weaver-api/src/app_bsky/embed/images.rs @@ -37,37 +37,37 @@ pub mod image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Alt; type Image; + type Alt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Alt = Unset; type Image = Unset; - } - ///State transition - sets the `alt` field to Set - pub struct SetAlt(PhantomData S>); - impl sealed::Sealed for SetAlt {} - impl State for SetAlt { - type Alt = Set; - type Image = S::Image; + type Alt = Unset; } ///State transition - sets the `image` field to Set pub struct SetImage(PhantomData S>); impl sealed::Sealed for SetImage {} impl State for SetImage { - type Alt = S::Alt; type Image = Set; + type Alt = S::Alt; + } + ///State transition - sets the `alt` field to Set + pub struct SetAlt(PhantomData S>); + impl sealed::Sealed for SetAlt {} + impl State for SetAlt { + type Image = S::Image; + type Alt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `alt` field - pub struct alt(()); ///Marker type for the `image` field pub struct image(()); + ///Marker type for the `alt` field + pub struct alt(()); } } @@ -160,8 +160,8 @@ where impl<'a, S> ImageBuilder<'a, S> where S: image_state::State, - S::Alt: image_state::IsSet, S::Image: image_state::IsSet, + S::Alt: image_state::IsSet, { /// Build the final struct pub fn build(self) -> Image<'a> { @@ -760,49 +760,49 @@ pub mod view_image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Thumb; type Fullsize; + type Thumb; type Alt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Thumb = Unset; type Fullsize = Unset; + type Thumb = Unset; type Alt = Unset; } - ///State transition - sets the `thumb` field to Set - pub struct SetThumb(PhantomData S>); - impl sealed::Sealed for SetThumb {} - impl State for SetThumb { - type Thumb = Set; - type Fullsize = S::Fullsize; - type Alt = S::Alt; - } ///State transition - sets the `fullsize` field to Set pub struct SetFullsize(PhantomData S>); impl sealed::Sealed for SetFullsize {} impl State for SetFullsize { - type Thumb = S::Thumb; type Fullsize = Set; + type Thumb = S::Thumb; + type Alt = S::Alt; + } + ///State transition - sets the `thumb` field to Set + pub struct SetThumb(PhantomData S>); + impl sealed::Sealed for SetThumb {} + impl State for SetThumb { + type Fullsize = S::Fullsize; + type Thumb = Set; type Alt = S::Alt; } ///State transition - sets the `alt` field to Set pub struct SetAlt(PhantomData S>); impl sealed::Sealed for SetAlt {} impl State for SetAlt { - type Thumb = S::Thumb; type Fullsize = S::Fullsize; + type Thumb = S::Thumb; type Alt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `thumb` field - pub struct thumb(()); ///Marker type for the `fullsize` field pub struct fullsize(()); + ///Marker type for the `thumb` field + pub struct thumb(()); ///Marker type for the `alt` field pub struct alt(()); } @@ -917,8 +917,8 @@ where impl<'a, S> ViewImageBuilder<'a, S> where S: view_image_state::State, - S::Thumb: view_image_state::IsSet, S::Fullsize: view_image_state::IsSet, + S::Thumb: view_image_state::IsSet, S::Alt: view_image_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/embed/record.rs b/crates/weaver-api/src/app_bsky/embed/record.rs index a8ab8c7..de9f37e 100644 --- a/crates/weaver-api/src/app_bsky/embed/record.rs +++ b/crates/weaver-api/src/app_bsky/embed/record.rs @@ -1303,85 +1303,85 @@ pub mod view_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Author; - type Cid; type Value; - type Uri; type IndexedAt; + type Uri; + type Cid; + type Author; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Author = Unset; - type Cid = Unset; type Value = Unset; - type Uri = Unset; type IndexedAt = Unset; - } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData S>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { - type Author = Set; - type Cid = S::Cid; - type Value = S::Value; - type Uri = S::Uri; - type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Author = S::Author; - type Cid = Set; - type Value = S::Value; - type Uri = S::Uri; - type IndexedAt = S::IndexedAt; + type Uri = Unset; + type Cid = Unset; + type Author = Unset; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Author = S::Author; - type Cid = S::Cid; type Value = Set; - type Uri = S::Uri; type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Cid = S::Cid; + type Author = S::Author; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Value = S::Value; + type IndexedAt = Set; + type Uri = S::Uri; + type Cid = S::Cid; + type Author = S::Author; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Author = S::Author; - type Cid = S::Cid; type Value = S::Value; - type Uri = Set; type IndexedAt = S::IndexedAt; + type Uri = Set; + type Cid = S::Cid; + type Author = S::Author; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Value = S::Value; + type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Cid = Set; type Author = S::Author; - type Cid = S::Cid; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { type Value = S::Value; + type IndexedAt = S::IndexedAt; type Uri = S::Uri; - type IndexedAt = Set; + type Cid = S::Cid; + type Author = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `author` field - pub struct author(()); - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `value` field pub struct value(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `author` field + pub struct author(()); } } @@ -1619,11 +1619,11 @@ where impl<'a, S> ViewRecordBuilder<'a, S> where S: view_record_state::State, - S::Author: view_record_state::IsSet, - S::Cid: view_record_state::IsSet, S::Value: view_record_state::IsSet, - S::Uri: view_record_state::IsSet, S::IndexedAt: view_record_state::IsSet, + S::Uri: view_record_state::IsSet, + S::Cid: view_record_state::IsSet, + S::Author: view_record_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewRecord<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/record_with_media.rs b/crates/weaver-api/src/app_bsky/embed/record_with_media.rs index 622ed2b..11a250f 100644 --- a/crates/weaver-api/src/app_bsky/embed/record_with_media.rs +++ b/crates/weaver-api/src/app_bsky/embed/record_with_media.rs @@ -33,37 +33,37 @@ pub mod record_with_media_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Media; type Record; + type Media; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Media = Unset; type Record = Unset; - } - ///State transition - sets the `media` field to Set - pub struct SetMedia(PhantomData S>); - impl sealed::Sealed for SetMedia {} - impl State for SetMedia { - type Media = Set; - type Record = S::Record; + type Media = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Media = S::Media; type Record = Set; + type Media = S::Media; + } + ///State transition - sets the `media` field to Set + pub struct SetMedia(PhantomData S>); + impl sealed::Sealed for SetMedia {} + impl State for SetMedia { + type Record = S::Record; + type Media = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `media` field - pub struct media(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `media` field + pub struct media(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> RecordWithMediaBuilder<'a, S> where S: record_with_media_state::State, - S::Media: record_with_media_state::IsSet, S::Record: record_with_media_state::IsSet, + S::Media: record_with_media_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordWithMedia<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed.rs b/crates/weaver-api/src/app_bsky/feed.rs index 23857a3..9938369 100644 --- a/crates/weaver-api/src/app_bsky/feed.rs +++ b/crates/weaver-api/src/app_bsky/feed.rs @@ -1609,51 +1609,51 @@ pub mod blocked_post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Blocked; type Author; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Blocked = Unset; type Author = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Blocked = S::Blocked; - type Author = S::Author; + type Uri = Unset; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData S>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { - type Uri = S::Uri; type Blocked = Set; type Author = S::Author; + type Uri = S::Uri; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Uri = S::Uri; type Blocked = S::Blocked; type Author = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Blocked = S::Blocked; + type Author = S::Author; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `blocked` field pub struct blocked(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1746,9 +1746,9 @@ where impl<'a, S> BlockedPostBuilder<'a, S> where S: blocked_post_state::State, - S::Uri: blocked_post_state::IsSet, S::Blocked: blocked_post_state::IsSet, S::Author: blocked_post_state::IsSet, + S::Uri: blocked_post_state::IsSet, { /// Build the final struct pub fn build(self) -> BlockedPost<'a> { @@ -2234,105 +2234,105 @@ pub mod generator_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Creator; type Uri; - type Did; type IndexedAt; - type DisplayName; type Cid; + type Creator; + type DisplayName; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Creator = Unset; type Uri = Unset; - type Did = Unset; type IndexedAt = Unset; - type DisplayName = Unset; type Cid = Unset; - } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData S>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { - type Creator = Set; - type Uri = S::Uri; - type Did = S::Did; - type IndexedAt = S::IndexedAt; - type DisplayName = S::DisplayName; - type Cid = S::Cid; + type Creator = Unset; + type DisplayName = Unset; + type Did = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Creator = S::Creator; type Uri = Set; - type Did = S::Did; type IndexedAt = S::IndexedAt; - type DisplayName = S::DisplayName; type Cid = S::Cid; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { type Creator = S::Creator; - type Uri = S::Uri; - type Did = Set; - type IndexedAt = S::IndexedAt; type DisplayName = S::DisplayName; - type Cid = S::Cid; + type Did = S::Did; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Creator = S::Creator; type Uri = S::Uri; - type Did = S::Did; type IndexedAt = Set; + type Cid = S::Cid; + type Creator = S::Creator; + type DisplayName = S::DisplayName; + type Did = S::Did; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Cid = Set; + type Creator = S::Creator; type DisplayName = S::DisplayName; + type Did = S::Did; + } + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData S>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; type Cid = S::Cid; + type Creator = Set; + type DisplayName = S::DisplayName; + type Did = S::Did; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Creator = S::Creator; type Uri = S::Uri; - type Did = S::Did; type IndexedAt = S::IndexedAt; - type DisplayName = Set; type Cid = S::Cid; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { type Creator = S::Creator; - type Uri = S::Uri; + type DisplayName = Set; type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Uri = S::Uri; type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type Creator = S::Creator; type DisplayName = S::DisplayName; - type Cid = Set; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `creator` field - pub struct creator(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `display_name` field - pub struct display_name(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `display_name` field + pub struct display_name(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -2648,12 +2648,12 @@ impl<'a, S: generator_view_state::State> GeneratorViewBuilder<'a, S> { impl<'a, S> GeneratorViewBuilder<'a, S> where S: generator_view_state::State, - S::Creator: generator_view_state::IsSet, S::Uri: generator_view_state::IsSet, - S::Did: generator_view_state::IsSet, S::IndexedAt: generator_view_state::IsSet, - S::DisplayName: generator_view_state::IsSet, S::Cid: generator_view_state::IsSet, + S::Creator: generator_view_state::IsSet, + S::DisplayName: generator_view_state::IsSet, + S::Did: generator_view_state::IsSet, { /// Build the final struct pub fn build(self) -> GeneratorView<'a> { @@ -3207,85 +3207,85 @@ pub mod post_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; + type IndexedAt; + type Cid; type Author; type Uri; - type Cid; - type IndexedAt; + type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Record = Unset; + type IndexedAt = Unset; + type Cid = Unset; type Author = Unset; type Uri = Unset; - type Cid = Unset; - type IndexedAt = Unset; + type Record = Unset; } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Record = Set; + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; + type Cid = S::Cid; type Author = S::Author; type Uri = S::Uri; - type Cid = S::Cid; + type Record = S::Record; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type IndexedAt = S::IndexedAt; + type Cid = Set; + type Author = S::Author; + type Uri = S::Uri; + type Record = S::Record; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Record = S::Record; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; type Author = Set; type Uri = S::Uri; - type Cid = S::Cid; - type IndexedAt = S::IndexedAt; + type Record = S::Record; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Record = S::Record; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; type Author = S::Author; type Uri = Set; - type Cid = S::Cid; - type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { type Record = S::Record; - type Author = S::Author; - type Uri = S::Uri; - type Cid = Set; - type IndexedAt = S::IndexedAt; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Record = S::Record; + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; type Author = S::Author; type Uri = S::Uri; - type Cid = S::Cid; - type IndexedAt = Set; + type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `record` field - pub struct record(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `author` field pub struct author(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -3598,11 +3598,11 @@ impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { impl<'a, S> PostViewBuilder<'a, S> where S: post_view_state::State, - S::Record: post_view_state::IsSet, + S::IndexedAt: post_view_state::IsSet, + S::Cid: post_view_state::IsSet, S::Author: post_view_state::IsSet, S::Uri: post_view_state::IsSet, - S::Cid: post_view_state::IsSet, - S::IndexedAt: post_view_state::IsSet, + S::Record: post_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PostView<'a> { @@ -3984,37 +3984,37 @@ pub mod reply_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Parent; type Root; + type Parent; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Parent = Unset; type Root = Unset; - } - ///State transition - sets the `parent` field to Set - pub struct SetParent(PhantomData S>); - impl sealed::Sealed for SetParent {} - impl State for SetParent { - type Parent = Set; - type Root = S::Root; + type Parent = Unset; } ///State transition - sets the `root` field to Set pub struct SetRoot(PhantomData S>); impl sealed::Sealed for SetRoot {} impl State for SetRoot { - type Parent = S::Parent; type Root = Set; + type Parent = S::Parent; + } + ///State transition - sets the `parent` field to Set + pub struct SetParent(PhantomData S>); + impl sealed::Sealed for SetParent {} + impl State for SetParent { + type Root = S::Root; + type Parent = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `parent` field - pub struct parent(()); ///Marker type for the `root` field pub struct root(()); + ///Marker type for the `parent` field + pub struct parent(()); } } @@ -4107,8 +4107,8 @@ where impl<'a, S> ReplyRefBuilder<'a, S> where S: reply_ref_state::State, - S::Parent: reply_ref_state::IsSet, S::Root: reply_ref_state::IsSet, + S::Parent: reply_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> ReplyRef<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/generator.rs b/crates/weaver-api/src/app_bsky/feed/generator.rs index 113990d..26c10e8 100644 --- a/crates/weaver-api/src/app_bsky/feed/generator.rs +++ b/crates/weaver-api/src/app_bsky/feed/generator.rs @@ -56,51 +56,51 @@ pub mod generator_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type DisplayName; type CreatedAt; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type DisplayName = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type DisplayName = S::DisplayName; - type CreatedAt = S::CreatedAt; + type Did = Unset; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Did = S::Did; type DisplayName = Set; type CreatedAt = S::CreatedAt; + type Did = S::Did; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Did = S::Did; type DisplayName = S::DisplayName; type CreatedAt = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type DisplayName = S::DisplayName; + type CreatedAt = S::CreatedAt; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `display_name` field pub struct display_name(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -317,9 +317,9 @@ impl<'a, S: generator_state::State> GeneratorBuilder<'a, S> { impl<'a, S> GeneratorBuilder<'a, S> where S: generator_state::State, - S::Did: generator_state::IsSet, S::DisplayName: generator_state::IsSet, S::CreatedAt: generator_state::IsSet, + S::Did: generator_state::IsSet, { /// Build the final struct pub fn build(self) -> Generator<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/get_likes.rs b/crates/weaver-api/src/app_bsky/feed/get_likes.rs index e108641..6532c29 100644 --- a/crates/weaver-api/src/app_bsky/feed/get_likes.rs +++ b/crates/weaver-api/src/app_bsky/feed/get_likes.rs @@ -34,50 +34,50 @@ pub mod like_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type IndexedAt; - type CreatedAt; type Actor; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type IndexedAt = Unset; - type CreatedAt = Unset; type Actor = Unset; + type CreatedAt = Unset; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type IndexedAt = Set; - type CreatedAt = S::CreatedAt; - type Actor = S::Actor; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type IndexedAt = S::IndexedAt; - type CreatedAt = Set; type Actor = S::Actor; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `actor` field to Set pub struct SetActor(PhantomData S>); impl sealed::Sealed for SetActor {} impl State for SetActor { type IndexedAt = S::IndexedAt; - type CreatedAt = S::CreatedAt; type Actor = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type IndexedAt = S::IndexedAt; + type Actor = S::Actor; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `actor` field pub struct actor(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -171,8 +171,8 @@ impl<'a, S> LikeBuilder<'a, S> where S: like_state::State, S::IndexedAt: like_state::IsSet, - S::CreatedAt: like_state::IsSet, S::Actor: like_state::IsSet, + S::CreatedAt: like_state::IsSet, { /// Build the final struct pub fn build(self) -> Like<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/like.rs b/crates/weaver-api/src/app_bsky/feed/like.rs index 29aa754..7d60480 100644 --- a/crates/weaver-api/src/app_bsky/feed/like.rs +++ b/crates/weaver-api/src/app_bsky/feed/like.rs @@ -36,37 +36,37 @@ pub mod like_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = S::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = S::CreatedAt; type Subject = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -159,8 +159,8 @@ impl<'a, S: like_state::State> LikeBuilder<'a, S> { impl<'a, S> LikeBuilder<'a, S> where S: like_state::State, - S::CreatedAt: like_state::IsSet, S::Subject: like_state::IsSet, + S::CreatedAt: like_state::IsSet, { /// Build the final struct pub fn build(self) -> Like<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/post.rs b/crates/weaver-api/src/app_bsky/feed/post.rs index 66ae701..7838524 100644 --- a/crates/weaver-api/src/app_bsky/feed/post.rs +++ b/crates/weaver-api/src/app_bsky/feed/post.rs @@ -38,50 +38,50 @@ pub mod entity_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Index; - type Type; type Value; + type Type; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Index = Unset; - type Type = Unset; type Value = Unset; + type Type = Unset; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData S>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { type Index = Set; - type Type = S::Type; - type Value = S::Value; - } - ///State transition - sets the `type` field to Set - pub struct SetType(PhantomData S>); - impl sealed::Sealed for SetType {} - impl State for SetType { - type Index = S::Index; - type Type = Set; type Value = S::Value; + type Type = S::Type; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { type Index = S::Index; - type Type = S::Type; type Value = Set; + type Type = S::Type; + } + ///State transition - sets the `type` field to Set + pub struct SetType(PhantomData S>); + impl sealed::Sealed for SetType {} + impl State for SetType { + type Index = S::Index; + type Value = S::Value; + type Type = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `index` field pub struct index(()); - ///Marker type for the `type` field - pub struct r#type(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `type` field + pub struct r#type(()); } } @@ -175,8 +175,8 @@ impl<'a, S> EntityBuilder<'a, S> where S: entity_state::State, S::Index: entity_state::IsSet, - S::Type: entity_state::IsSet, S::Value: entity_state::IsSet, + S::Type: entity_state::IsSet, { /// Build the final struct pub fn build(self) -> Entity<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/postgate.rs b/crates/weaver-api/src/app_bsky/feed/postgate.rs index 196efae..f10b387 100644 --- a/crates/weaver-api/src/app_bsky/feed/postgate.rs +++ b/crates/weaver-api/src/app_bsky/feed/postgate.rs @@ -224,37 +224,37 @@ pub mod postgate_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Post; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Post = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Post = S::Post; + type CreatedAt = Unset; } ///State transition - sets the `post` field to Set pub struct SetPost(PhantomData S>); impl sealed::Sealed for SetPost {} impl State for SetPost { - type CreatedAt = S::CreatedAt; type Post = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Post = S::Post; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `post` field pub struct post(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -367,8 +367,8 @@ where impl<'a, S> PostgateBuilder<'a, S> where S: postgate_state::State, - S::CreatedAt: postgate_state::IsSet, S::Post: postgate_state::IsSet, + S::CreatedAt: postgate_state::IsSet, { /// Build the final struct pub fn build(self) -> Postgate<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/repost.rs b/crates/weaver-api/src/app_bsky/feed/repost.rs index 3c88b6b..bd94244 100644 --- a/crates/weaver-api/src/app_bsky/feed/repost.rs +++ b/crates/weaver-api/src/app_bsky/feed/repost.rs @@ -36,37 +36,37 @@ pub mod repost_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type CreatedAt; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type CreatedAt = S::CreatedAt; + type Subject = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Subject = S::Subject; type CreatedAt = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type CreatedAt = S::CreatedAt; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -159,8 +159,8 @@ impl<'a, S: repost_state::State> RepostBuilder<'a, S> { impl<'a, S> RepostBuilder<'a, S> where S: repost_state::State, - S::Subject: repost_state::IsSet, S::CreatedAt: repost_state::IsSet, + S::Subject: repost_state::IsSet, { /// Build the final struct pub fn build(self) -> Repost<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/threadgate.rs b/crates/weaver-api/src/app_bsky/feed/threadgate.rs index e68990f..6384dab 100644 --- a/crates/weaver-api/src/app_bsky/feed/threadgate.rs +++ b/crates/weaver-api/src/app_bsky/feed/threadgate.rs @@ -463,37 +463,37 @@ pub mod threadgate_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Post; type CreatedAt; + type Post; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Post = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `post` field to Set - pub struct SetPost(PhantomData S>); - impl sealed::Sealed for SetPost {} - impl State for SetPost { - type Post = Set; - type CreatedAt = S::CreatedAt; + type Post = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Post = S::Post; type CreatedAt = Set; + type Post = S::Post; + } + ///State transition - sets the `post` field to Set + pub struct SetPost(PhantomData S>); + impl sealed::Sealed for SetPost {} + impl State for SetPost { + type CreatedAt = S::CreatedAt; + type Post = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `post` field - pub struct post(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `post` field + pub struct post(()); } } @@ -603,8 +603,8 @@ where impl<'a, S> ThreadgateBuilder<'a, S> where S: threadgate_state::State, - S::Post: threadgate_state::IsSet, S::CreatedAt: threadgate_state::IsSet, + S::Post: threadgate_state::IsSet, { /// Build the final struct pub fn build(self) -> Threadgate<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph.rs b/crates/weaver-api/src/app_bsky/graph.rs index 888bc9f..396af84 100644 --- a/crates/weaver-api/src/app_bsky/graph.rs +++ b/crates/weaver-api/src/app_bsky/graph.rs @@ -82,37 +82,37 @@ pub mod list_item_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Subject; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Subject = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Subject = S::Subject; + type Uri = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Uri = S::Uri; type Subject = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Subject = S::Subject; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -185,8 +185,8 @@ where impl<'a, S> ListItemViewBuilder<'a, S> where S: list_item_view_state::State, - S::Uri: list_item_view_state::IsSet, S::Subject: list_item_view_state::IsSet, + S::Uri: list_item_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListItemView<'a> { @@ -1277,105 +1277,105 @@ pub mod list_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Purpose; - type Name; - type Cid; + type Uri; type IndexedAt; type Creator; + type Name; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Purpose = Unset; - type Name = Unset; - type Cid = Unset; + type Uri = Unset; type IndexedAt = Unset; type Creator = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Purpose = S::Purpose; - type Name = S::Name; - type Cid = S::Cid; - type IndexedAt = S::IndexedAt; - type Creator = S::Creator; + type Name = Unset; + type Cid = Unset; } ///State transition - sets the `purpose` field to Set pub struct SetPurpose(PhantomData S>); impl sealed::Sealed for SetPurpose {} impl State for SetPurpose { - type Uri = S::Uri; type Purpose = Set; - type Name = S::Name; - type Cid = S::Cid; - type IndexedAt = S::IndexedAt; - type Creator = S::Creator; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { type Uri = S::Uri; - type Purpose = S::Purpose; - type Name = Set; - type Cid = S::Cid; type IndexedAt = S::IndexedAt; type Creator = S::Creator; + type Name = S::Name; + type Cid = S::Cid; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Uri = S::Uri; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type Purpose = S::Purpose; - type Name = S::Name; - type Cid = Set; + type Uri = Set; type IndexedAt = S::IndexedAt; type Creator = S::Creator; + type Name = S::Name; + type Cid = S::Cid; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Uri = S::Uri; type Purpose = S::Purpose; - type Name = S::Name; - type Cid = S::Cid; + type Uri = S::Uri; type IndexedAt = Set; type Creator = S::Creator; + type Name = S::Name; + type Cid = S::Cid; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { - type Uri = S::Uri; type Purpose = S::Purpose; + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Creator = Set; type Name = S::Name; type Cid = S::Cid; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Purpose = S::Purpose; + type Uri = S::Uri; type IndexedAt = S::IndexedAt; - type Creator = Set; + type Creator = S::Creator; + type Name = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Purpose = S::Purpose; + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Creator = S::Creator; + type Name = S::Name; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `purpose` field pub struct purpose(()); - ///Marker type for the `name` field - pub struct name(()); - ///Marker type for the `cid` field - pub struct cid(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `creator` field pub struct creator(()); + ///Marker type for the `name` field + pub struct name(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -1655,12 +1655,12 @@ impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> { impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, - S::Uri: list_view_state::IsSet, S::Purpose: list_view_state::IsSet, - S::Name: list_view_state::IsSet, - S::Cid: list_view_state::IsSet, + S::Uri: list_view_state::IsSet, S::IndexedAt: list_view_state::IsSet, S::Creator: list_view_state::IsSet, + S::Name: list_view_state::IsSet, + S::Cid: list_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListView<'a> { @@ -1835,67 +1835,67 @@ pub mod list_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; - type Name; type Purpose; + type Name; type Uri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; - type Name = Unset; type Purpose = Unset; + type Name = Unset; type Uri = Unset; + type Cid = Unset; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; + ///State transition - sets the `purpose` field to Set + pub struct SetPurpose(PhantomData S>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type Purpose = Set; type Name = S::Name; - type Purpose = S::Purpose; type Uri = S::Uri; + type Cid = S::Cid; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Cid = S::Cid; - type Name = Set; type Purpose = S::Purpose; + type Name = Set; type Uri = S::Uri; - } - ///State transition - sets the `purpose` field to Set - pub struct SetPurpose(PhantomData S>); - impl sealed::Sealed for SetPurpose {} - impl State for SetPurpose { type Cid = S::Cid; - type Name = S::Name; - type Purpose = Set; - type Uri = S::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = S::Cid; - type Name = S::Name; type Purpose = S::Purpose; + type Name = S::Name; type Uri = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Purpose = S::Purpose; + type Name = S::Name; + type Uri = S::Uri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `name` field - pub struct name(()); ///Marker type for the `purpose` field pub struct purpose(()); + ///Marker type for the `name` field + pub struct name(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -2112,10 +2112,10 @@ impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> { impl<'a, S> ListViewBasicBuilder<'a, S> where S: list_view_basic_state::State, - S::Cid: list_view_basic_state::IsSet, - S::Name: list_view_basic_state::IsSet, S::Purpose: list_view_basic_state::IsSet, + S::Name: list_view_basic_state::IsSet, S::Uri: list_view_basic_state::IsSet, + S::Cid: list_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> ListViewBasic<'a> { @@ -2292,37 +2292,37 @@ pub mod not_found_actor_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type NotFound; type Actor; + type NotFound; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type NotFound = Unset; type Actor = Unset; - } - ///State transition - sets the `not_found` field to Set - pub struct SetNotFound(PhantomData S>); - impl sealed::Sealed for SetNotFound {} - impl State for SetNotFound { - type NotFound = Set; - type Actor = S::Actor; + type NotFound = Unset; } ///State transition - sets the `actor` field to Set pub struct SetActor(PhantomData S>); impl sealed::Sealed for SetActor {} impl State for SetActor { - type NotFound = S::NotFound; type Actor = Set; + type NotFound = S::NotFound; + } + ///State transition - sets the `not_found` field to Set + pub struct SetNotFound(PhantomData S>); + impl sealed::Sealed for SetNotFound {} + impl State for SetNotFound { + type Actor = S::Actor; + type NotFound = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `not_found` field - pub struct not_found(()); ///Marker type for the `actor` field pub struct actor(()); + ///Marker type for the `not_found` field + pub struct not_found(()); } } @@ -2395,8 +2395,8 @@ where impl<'a, S> NotFoundActorBuilder<'a, S> where S: not_found_actor_state::State, - S::NotFound: not_found_actor_state::IsSet, S::Actor: not_found_actor_state::IsSet, + S::NotFound: not_found_actor_state::IsSet, { /// Build the final struct pub fn build(self) -> NotFoundActor<'a> { @@ -2699,85 +2699,85 @@ pub mod starter_pack_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; - type Creator; - type Cid; type Uri; + type Cid; + type Creator; type IndexedAt; + type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Record = Unset; - type Creator = Unset; - type Cid = Unset; type Uri = Unset; + type Cid = Unset; + type Creator = Unset; type IndexedAt = Unset; + type Record = Unset; } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Record = Set; - type Creator = S::Creator; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; type Cid = S::Cid; - type Uri = S::Uri; + type Creator = S::Creator; type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData S>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { type Record = S::Record; - type Creator = Set; - type Cid = S::Cid; - type Uri = S::Uri; - type IndexedAt = S::IndexedAt; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Record = S::Record; - type Creator = S::Creator; - type Cid = Set; type Uri = S::Uri; + type Cid = Set; + type Creator = S::Creator; type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { type Record = S::Record; - type Creator = S::Creator; + } + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData S>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type Uri = S::Uri; type Cid = S::Cid; - type Uri = Set; + type Creator = Set; type IndexedAt = S::IndexedAt; + type Record = S::Record; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Record = S::Record; - type Creator = S::Creator; - type Cid = S::Cid; type Uri = S::Uri; + type Cid = S::Cid; + type Creator = S::Creator; type IndexedAt = Set; + type Record = S::Record; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Uri = S::Uri; + type Cid = S::Cid; + type Creator = S::Creator; + type IndexedAt = S::IndexedAt; + type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `creator` field - pub struct creator(()); - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `creator` field + pub struct creator(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -3030,11 +3030,11 @@ where impl<'a, S> StarterPackViewBuilder<'a, S> where S: starter_pack_view_state::State, - S::Record: starter_pack_view_state::IsSet, - S::Creator: starter_pack_view_state::IsSet, - S::Cid: starter_pack_view_state::IsSet, S::Uri: starter_pack_view_state::IsSet, + S::Cid: starter_pack_view_state::IsSet, + S::Creator: starter_pack_view_state::IsSet, S::IndexedAt: starter_pack_view_state::IsSet, + S::Record: starter_pack_view_state::IsSet, { /// Build the final struct pub fn build(self) -> StarterPackView<'a> { @@ -3183,85 +3183,85 @@ pub mod starter_pack_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; + type Cid; type Record; - type IndexedAt; + type Uri; type Creator; - type Cid; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; + type Cid = Unset; type Record = Unset; - type IndexedAt = Unset; + type Uri = Unset; type Creator = Unset; - type Cid = Unset; + type IndexedAt = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Cid = Set; type Record = S::Record; - type IndexedAt = S::IndexedAt; + type Uri = S::Uri; type Creator = S::Creator; - type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Uri = S::Uri; + type Cid = S::Cid; type Record = Set; - type IndexedAt = S::IndexedAt; + type Uri = S::Uri; type Creator = S::Creator; - type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Uri = S::Uri; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Cid = S::Cid; type Record = S::Record; - type IndexedAt = Set; + type Uri = Set; type Creator = S::Creator; - type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { - type Uri = S::Uri; + type Cid = S::Cid; type Record = S::Record; - type IndexedAt = S::IndexedAt; + type Uri = S::Uri; type Creator = Set; - type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Uri = S::Uri; + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Cid = S::Cid; type Record = S::Record; - type IndexedAt = S::IndexedAt; + type Uri = S::Uri; type Creator = S::Creator; - type Cid = Set; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `record` field pub struct record(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `creator` field pub struct creator(()); - ///Marker type for the `cid` field - pub struct cid(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -3472,11 +3472,11 @@ where impl<'a, S> StarterPackViewBasicBuilder<'a, S> where S: starter_pack_view_basic_state::State, - S::Uri: starter_pack_view_basic_state::IsSet, + S::Cid: starter_pack_view_basic_state::IsSet, S::Record: starter_pack_view_basic_state::IsSet, - S::IndexedAt: starter_pack_view_basic_state::IsSet, + S::Uri: starter_pack_view_basic_state::IsSet, S::Creator: starter_pack_view_basic_state::IsSet, - S::Cid: starter_pack_view_basic_state::IsSet, + S::IndexedAt: starter_pack_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> StarterPackViewBasic<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/list.rs b/crates/weaver-api/src/app_bsky/graph/list.rs index e746790..88b06f9 100644 --- a/crates/weaver-api/src/app_bsky/graph/list.rs +++ b/crates/weaver-api/src/app_bsky/graph/list.rs @@ -51,49 +51,49 @@ pub mod list_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Purpose; type Name; + type Purpose; type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Purpose = Unset; type Name = Unset; + type Purpose = Unset; type CreatedAt = Unset; } - ///State transition - sets the `purpose` field to Set - pub struct SetPurpose(PhantomData S>); - impl sealed::Sealed for SetPurpose {} - impl State for SetPurpose { - type Purpose = Set; - type Name = S::Name; - type CreatedAt = S::CreatedAt; - } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Purpose = S::Purpose; type Name = Set; + type Purpose = S::Purpose; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `purpose` field to Set + pub struct SetPurpose(PhantomData S>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type Name = S::Name; + type Purpose = Set; type CreatedAt = S::CreatedAt; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Purpose = S::Purpose; type Name = S::Name; + type Purpose = S::Purpose; type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `purpose` field - pub struct purpose(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `purpose` field + pub struct purpose(()); ///Marker type for the `created_at` field pub struct created_at(()); } @@ -268,8 +268,8 @@ where impl<'a, S> ListBuilder<'a, S> where S: list_state::State, - S::Purpose: list_state::IsSet, S::Name: list_state::IsSet, + S::Purpose: list_state::IsSet, S::CreatedAt: list_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/graph/listitem.rs b/crates/weaver-api/src/app_bsky/graph/listitem.rs index 791ac20..0c870cf 100644 --- a/crates/weaver-api/src/app_bsky/graph/listitem.rs +++ b/crates/weaver-api/src/app_bsky/graph/listitem.rs @@ -37,51 +37,51 @@ pub mod listitem_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type List; type CreatedAt; type Subject; + type List; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type List = Unset; type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `list` field to Set - pub struct SetList(PhantomData S>); - impl sealed::Sealed for SetList {} - impl State for SetList { - type List = Set; - type CreatedAt = S::CreatedAt; - type Subject = S::Subject; + type List = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type List = S::List; type CreatedAt = Set; type Subject = S::Subject; + type List = S::List; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type List = S::List; type CreatedAt = S::CreatedAt; type Subject = Set; + type List = S::List; + } + ///State transition - sets the `list` field to Set + pub struct SetList(PhantomData S>); + impl sealed::Sealed for SetList {} + impl State for SetList { + type CreatedAt = S::CreatedAt; + type Subject = S::Subject; + type List = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `list` field - pub struct list(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `list` field + pub struct list(()); } } @@ -174,9 +174,9 @@ where impl<'a, S> ListitemBuilder<'a, S> where S: listitem_state::State, - S::List: listitem_state::IsSet, S::CreatedAt: listitem_state::IsSet, S::Subject: listitem_state::IsSet, + S::List: listitem_state::IsSet, { /// Build the final struct pub fn build(self) -> Listitem<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/starterpack.rs b/crates/weaver-api/src/app_bsky/graph/starterpack.rs index da639ff..3f6999a 100644 --- a/crates/weaver-api/src/app_bsky/graph/starterpack.rs +++ b/crates/weaver-api/src/app_bsky/graph/starterpack.rs @@ -366,51 +366,51 @@ pub mod starterpack_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; type List; type CreatedAt; + type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Name = Unset; type List = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Name = Set; - type List = S::List; - type CreatedAt = S::CreatedAt; + type Name = Unset; } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData S>); impl sealed::Sealed for SetList {} impl State for SetList { - type Name = S::Name; type List = Set; type CreatedAt = S::CreatedAt; + type Name = S::Name; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Name = S::Name; type List = S::List; type CreatedAt = Set; + type Name = S::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type List = S::List; + type CreatedAt = S::CreatedAt; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `name` field - pub struct name(()); ///Marker type for the `list` field pub struct list(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -563,9 +563,9 @@ where impl<'a, S> StarterpackBuilder<'a, S> where S: starterpack_state::State, - S::Name: starterpack_state::IsSet, S::List: starterpack_state::IsSet, S::CreatedAt: starterpack_state::IsSet, + S::Name: starterpack_state::IsSet, { /// Build the final struct pub fn build(self) -> Starterpack<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/verification.rs b/crates/weaver-api/src/app_bsky/graph/verification.rs index 42af8a3..42bfe80 100644 --- a/crates/weaver-api/src/app_bsky/graph/verification.rs +++ b/crates/weaver-api/src/app_bsky/graph/verification.rs @@ -41,8 +41,8 @@ pub mod verification_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type DisplayName; type Subject; + type DisplayName; type Handle; type CreatedAt; } @@ -50,26 +50,26 @@ pub mod verification_state { pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type DisplayName = Unset; type Subject = Unset; + type DisplayName = Unset; type Handle = Unset; type CreatedAt = Unset; } - ///State transition - sets the `display_name` field to Set - pub struct SetDisplayName(PhantomData S>); - impl sealed::Sealed for SetDisplayName {} - impl State for SetDisplayName { - type DisplayName = Set; - type Subject = S::Subject; - type Handle = S::Handle; - type CreatedAt = S::CreatedAt; - } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type DisplayName = S::DisplayName; type Subject = Set; + type DisplayName = S::DisplayName; + type Handle = S::Handle; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData S>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { + type Subject = S::Subject; + type DisplayName = Set; type Handle = S::Handle; type CreatedAt = S::CreatedAt; } @@ -77,8 +77,8 @@ pub mod verification_state { pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type DisplayName = S::DisplayName; type Subject = S::Subject; + type DisplayName = S::DisplayName; type Handle = Set; type CreatedAt = S::CreatedAt; } @@ -86,18 +86,18 @@ pub mod verification_state { pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type DisplayName = S::DisplayName; type Subject = S::Subject; + type DisplayName = S::DisplayName; type Handle = S::Handle; type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `display_name` field - pub struct display_name(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `display_name` field + pub struct display_name(()); ///Marker type for the `handle` field pub struct handle(()); ///Marker type for the `created_at` field @@ -214,8 +214,8 @@ where impl<'a, S> VerificationBuilder<'a, S> where S: verification_state::State, - S::DisplayName: verification_state::IsSet, S::Subject: verification_state::IsSet, + S::DisplayName: verification_state::IsSet, S::Handle: verification_state::IsSet, S::CreatedAt: verification_state::IsSet, { diff --git a/crates/weaver-api/src/app_bsky/labeler.rs b/crates/weaver-api/src/app_bsky/labeler.rs index 0716bf9..d0abf45 100644 --- a/crates/weaver-api/src/app_bsky/labeler.rs +++ b/crates/weaver-api/src/app_bsky/labeler.rs @@ -632,67 +632,67 @@ pub mod labeler_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; + type Uri; type Creator; type IndexedAt; - type Uri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; + type Uri = Unset; type Creator = Unset; type IndexedAt = Unset; - type Uri = Unset; + type Cid = Unset; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; type Creator = S::Creator; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; + type Cid = S::Cid; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { - type Cid = S::Cid; + type Uri = S::Uri; type Creator = Set; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; + type Cid = S::Cid; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Cid = S::Cid; + type Uri = S::Uri; type Creator = S::Creator; type IndexedAt = Set; - type Uri = S::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = S::Uri; type Creator = S::Creator; type IndexedAt = S::IndexedAt; - type Uri = Set; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `creator` field pub struct creator(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -859,10 +859,10 @@ impl<'a, S: labeler_view_state::State> LabelerViewBuilder<'a, S> { impl<'a, S> LabelerViewBuilder<'a, S> where S: labeler_view_state::State, - S::Cid: labeler_view_state::IsSet, + S::Uri: labeler_view_state::IsSet, S::Creator: labeler_view_state::IsSet, S::IndexedAt: labeler_view_state::IsSet, - S::Uri: labeler_view_state::IsSet, + S::Cid: labeler_view_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerView<'a> { @@ -985,85 +985,85 @@ pub mod labeler_view_detailed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type IndexedAt; - type Cid; - type Creator; type Policies; type Uri; + type Creator; + type IndexedAt; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type IndexedAt = Unset; - type Cid = Unset; - type Creator = Unset; type Policies = Unset; type Uri = Unset; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type IndexedAt = Set; - type Cid = S::Cid; - type Creator = S::Creator; - type Policies = S::Policies; - type Uri = S::Uri; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type IndexedAt = S::IndexedAt; - type Cid = Set; - type Creator = S::Creator; - type Policies = S::Policies; - type Uri = S::Uri; - } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData S>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { - type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - type Creator = Set; - type Policies = S::Policies; - type Uri = S::Uri; + type Creator = Unset; + type IndexedAt = Unset; + type Cid = Unset; } ///State transition - sets the `policies` field to Set pub struct SetPolicies(PhantomData S>); impl sealed::Sealed for SetPolicies {} impl State for SetPolicies { - type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - type Creator = S::Creator; type Policies = Set; type Uri = S::Uri; + type Creator = S::Creator; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { + type Policies = S::Policies; + type Uri = Set; + type Creator = S::Creator; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + } + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData S>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type Policies = S::Policies; + type Uri = S::Uri; + type Creator = Set; type IndexedAt = S::IndexedAt; type Cid = S::Cid; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Policies = S::Policies; + type Uri = S::Uri; type Creator = S::Creator; + type IndexedAt = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type Policies = S::Policies; - type Uri = Set; + type Uri = S::Uri; + type Creator = S::Creator; + type IndexedAt = S::IndexedAt; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `creator` field - pub struct creator(()); ///Marker type for the `policies` field pub struct policies(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -1322,11 +1322,11 @@ impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S impl<'a, S> LabelerViewDetailedBuilder<'a, S> where S: labeler_view_detailed_state::State, - S::IndexedAt: labeler_view_detailed_state::IsSet, - S::Cid: labeler_view_detailed_state::IsSet, - S::Creator: labeler_view_detailed_state::IsSet, S::Policies: labeler_view_detailed_state::IsSet, S::Uri: labeler_view_detailed_state::IsSet, + S::Creator: labeler_view_detailed_state::IsSet, + S::IndexedAt: labeler_view_detailed_state::IsSet, + S::Cid: labeler_view_detailed_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerViewDetailed<'a> { diff --git a/crates/weaver-api/src/app_bsky/labeler/service.rs b/crates/weaver-api/src/app_bsky/labeler/service.rs index c9ccb61..24e3395 100644 --- a/crates/weaver-api/src/app_bsky/labeler/service.rs +++ b/crates/weaver-api/src/app_bsky/labeler/service.rs @@ -54,37 +54,37 @@ pub mod service_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Policies; type CreatedAt; + type Policies; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Policies = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `policies` field to Set - pub struct SetPolicies(PhantomData S>); - impl sealed::Sealed for SetPolicies {} - impl State for SetPolicies { - type Policies = Set; - type CreatedAt = S::CreatedAt; + type Policies = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Policies = S::Policies; type CreatedAt = Set; + type Policies = S::Policies; + } + ///State transition - sets the `policies` field to Set + pub struct SetPolicies(PhantomData S>); + impl sealed::Sealed for SetPolicies {} + impl State for SetPolicies { + type CreatedAt = S::CreatedAt; + type Policies = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `policies` field - pub struct policies(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `policies` field + pub struct policies(()); } } @@ -237,8 +237,8 @@ impl<'a, S: service_state::State> ServiceBuilder<'a, S> { impl<'a, S> ServiceBuilder<'a, S> where S: service_state::State, - S::Policies: service_state::IsSet, S::CreatedAt: service_state::IsSet, + S::Policies: service_state::IsSet, { /// Build the final struct pub fn build(self) -> Service<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification.rs b/crates/weaver-api/src/app_bsky/notification.rs index fa93411..c226b6c 100644 --- a/crates/weaver-api/src/app_bsky/notification.rs +++ b/crates/weaver-api/src/app_bsky/notification.rs @@ -43,37 +43,37 @@ pub mod activity_subscription_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reply; type Post; + type Reply; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Reply = Unset; type Post = Unset; - } - ///State transition - sets the `reply` field to Set - pub struct SetReply(PhantomData S>); - impl sealed::Sealed for SetReply {} - impl State for SetReply { - type Reply = Set; - type Post = S::Post; + type Reply = Unset; } ///State transition - sets the `post` field to Set pub struct SetPost(PhantomData S>); impl sealed::Sealed for SetPost {} impl State for SetPost { - type Reply = S::Reply; type Post = Set; + type Reply = S::Reply; + } + ///State transition - sets the `reply` field to Set + pub struct SetReply(PhantomData S>); + impl sealed::Sealed for SetReply {} + impl State for SetReply { + type Post = S::Post; + type Reply = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reply` field - pub struct reply(()); ///Marker type for the `post` field pub struct post(()); + ///Marker type for the `reply` field + pub struct reply(()); } } @@ -143,8 +143,8 @@ where impl<'a, S> ActivitySubscriptionBuilder<'a, S> where S: activity_subscription_state::State, - S::Reply: activity_subscription_state::IsSet, S::Post: activity_subscription_state::IsSet, + S::Reply: activity_subscription_state::IsSet, { /// Build the final struct pub fn build(self) -> ActivitySubscription<'a> { @@ -986,37 +986,37 @@ pub mod preference_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Push; type List; + type Push; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Push = Unset; type List = Unset; - } - ///State transition - sets the `push` field to Set - pub struct SetPush(PhantomData S>); - impl sealed::Sealed for SetPush {} - impl State for SetPush { - type Push = Set; - type List = S::List; + type Push = Unset; } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData S>); impl sealed::Sealed for SetList {} impl State for SetList { - type Push = S::Push; type List = Set; + type Push = S::Push; + } + ///State transition - sets the `push` field to Set + pub struct SetPush(PhantomData S>); + impl sealed::Sealed for SetPush {} + impl State for SetPush { + type List = S::List; + type Push = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `push` field - pub struct push(()); ///Marker type for the `list` field pub struct list(()); + ///Marker type for the `push` field + pub struct push(()); } } @@ -1086,8 +1086,8 @@ where impl<'a, S> PreferenceBuilder<'a, S> where S: preference_state::State, - S::Push: preference_state::IsSet, S::List: preference_state::IsSet, + S::Push: preference_state::IsSet, { /// Build the final struct pub fn build(self) -> Preference<'a> { @@ -1180,301 +1180,301 @@ pub mod preferences_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reply; + type LikeViaRepost; + type RepostViaRepost; type Chat; + type Mention; type Follow; + type Quote; + type Repost; type Like; - type RepostViaRepost; type StarterpackJoined; + type Reply; type SubscribedPost; type Unverified; - type LikeViaRepost; - type Repost; - type Mention; type Verified; - type Quote; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Reply = Unset; + type LikeViaRepost = Unset; + type RepostViaRepost = Unset; type Chat = Unset; + type Mention = Unset; type Follow = Unset; + type Quote = Unset; + type Repost = Unset; type Like = Unset; - type RepostViaRepost = Unset; type StarterpackJoined = Unset; + type Reply = Unset; type SubscribedPost = Unset; type Unverified = Unset; - type LikeViaRepost = Unset; - type Repost = Unset; - type Mention = Unset; type Verified = Unset; - type Quote = Unset; } - ///State transition - sets the `reply` field to Set - pub struct SetReply(PhantomData S>); - impl sealed::Sealed for SetReply {} - impl State for SetReply { - type Reply = Set; + ///State transition - sets the `like_via_repost` field to Set + pub struct SetLikeViaRepost(PhantomData S>); + impl sealed::Sealed for SetLikeViaRepost {} + impl State for SetLikeViaRepost { + type LikeViaRepost = Set; + type RepostViaRepost = S::RepostViaRepost; type Chat = S::Chat; + type Mention = S::Mention; type Follow = S::Follow; + type Quote = S::Quote; + type Repost = S::Repost; type Like = S::Like; - type RepostViaRepost = S::RepostViaRepost; type StarterpackJoined = S::StarterpackJoined; + type Reply = S::Reply; type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///State transition - sets the `repost_via_repost` field to Set + pub struct SetRepostViaRepost(PhantomData S>); + impl sealed::Sealed for SetRepostViaRepost {} + impl State for SetRepostViaRepost { type LikeViaRepost = S::LikeViaRepost; - type Repost = S::Repost; + type RepostViaRepost = Set; + type Chat = S::Chat; type Mention = S::Mention; - type Verified = S::Verified; + type Follow = S::Follow; type Quote = S::Quote; + type Repost = S::Repost; + type Like = S::Like; + type StarterpackJoined = S::StarterpackJoined; + type Reply = S::Reply; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; } ///State transition - sets the `chat` field to Set pub struct SetChat(PhantomData S>); impl sealed::Sealed for SetChat {} impl State for SetChat { - type Reply = S::Reply; + type LikeViaRepost = S::LikeViaRepost; + type RepostViaRepost = S::RepostViaRepost; type Chat = Set; + type Mention = S::Mention; type Follow = S::Follow; + type Quote = S::Quote; + type Repost = S::Repost; type Like = S::Like; - type RepostViaRepost = S::RepostViaRepost; type StarterpackJoined = S::StarterpackJoined; + type Reply = S::Reply; type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///State transition - sets the `mention` field to Set + pub struct SetMention(PhantomData S>); + impl sealed::Sealed for SetMention {} + impl State for SetMention { type LikeViaRepost = S::LikeViaRepost; + type RepostViaRepost = S::RepostViaRepost; + type Chat = S::Chat; + type Mention = Set; + type Follow = S::Follow; + type Quote = S::Quote; type Repost = S::Repost; - type Mention = S::Mention; + type Like = S::Like; + type StarterpackJoined = S::StarterpackJoined; + type Reply = S::Reply; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; type Verified = S::Verified; - type Quote = S::Quote; } ///State transition - sets the `follow` field to Set pub struct SetFollow(PhantomData S>); impl sealed::Sealed for SetFollow {} impl State for SetFollow { - type Reply = S::Reply; + type LikeViaRepost = S::LikeViaRepost; + type RepostViaRepost = S::RepostViaRepost; type Chat = S::Chat; + type Mention = S::Mention; type Follow = Set; + type Quote = S::Quote; + type Repost = S::Repost; type Like = S::Like; - type RepostViaRepost = S::RepostViaRepost; type StarterpackJoined = S::StarterpackJoined; + type Reply = S::Reply; type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; - type LikeViaRepost = S::LikeViaRepost; - type Repost = S::Repost; - type Mention = S::Mention; type Verified = S::Verified; - type Quote = S::Quote; } - ///State transition - sets the `like` field to Set - pub struct SetLike(PhantomData S>); - impl sealed::Sealed for SetLike {} - impl State for SetLike { - type Reply = S::Reply; + ///State transition - sets the `quote` field to Set + pub struct SetQuote(PhantomData S>); + impl sealed::Sealed for SetQuote {} + impl State for SetQuote { + type LikeViaRepost = S::LikeViaRepost; + type RepostViaRepost = S::RepostViaRepost; type Chat = S::Chat; + type Mention = S::Mention; type Follow = S::Follow; - type Like = Set; - type RepostViaRepost = S::RepostViaRepost; + type Quote = Set; + type Repost = S::Repost; + type Like = S::Like; type StarterpackJoined = S::StarterpackJoined; + type Reply = S::Reply; type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; - type LikeViaRepost = S::LikeViaRepost; - type Repost = S::Repost; - type Mention = S::Mention; type Verified = S::Verified; - type Quote = S::Quote; } - ///State transition - sets the `repost_via_repost` field to Set - pub struct SetRepostViaRepost(PhantomData S>); - impl sealed::Sealed for SetRepostViaRepost {} - impl State for SetRepostViaRepost { - type Reply = S::Reply; + ///State transition - sets the `repost` field to Set + pub struct SetRepost(PhantomData S>); + impl sealed::Sealed for SetRepost {} + impl State for SetRepost { + type LikeViaRepost = S::LikeViaRepost; + type RepostViaRepost = S::RepostViaRepost; type Chat = S::Chat; + type Mention = S::Mention; type Follow = S::Follow; + type Quote = S::Quote; + type Repost = Set; type Like = S::Like; - type RepostViaRepost = Set; type StarterpackJoined = S::StarterpackJoined; + type Reply = S::Reply; type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///State transition - sets the `like` field to Set + pub struct SetLike(PhantomData S>); + impl sealed::Sealed for SetLike {} + impl State for SetLike { type LikeViaRepost = S::LikeViaRepost; - type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type Chat = S::Chat; type Mention = S::Mention; - type Verified = S::Verified; + type Follow = S::Follow; type Quote = S::Quote; + type Repost = S::Repost; + type Like = Set; + type StarterpackJoined = S::StarterpackJoined; + type Reply = S::Reply; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; } ///State transition - sets the `starterpack_joined` field to Set pub struct SetStarterpackJoined(PhantomData S>); impl sealed::Sealed for SetStarterpackJoined {} impl State for SetStarterpackJoined { - type Reply = S::Reply; + type LikeViaRepost = S::LikeViaRepost; + type RepostViaRepost = S::RepostViaRepost; type Chat = S::Chat; + type Mention = S::Mention; type Follow = S::Follow; + type Quote = S::Quote; + type Repost = S::Repost; type Like = S::Like; - type RepostViaRepost = S::RepostViaRepost; type StarterpackJoined = Set; + type Reply = S::Reply; type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Verified = S::Verified; + } + ///State transition - sets the `reply` field to Set + pub struct SetReply(PhantomData S>); + impl sealed::Sealed for SetReply {} + impl State for SetReply { type LikeViaRepost = S::LikeViaRepost; - type Repost = S::Repost; + type RepostViaRepost = S::RepostViaRepost; + type Chat = S::Chat; type Mention = S::Mention; - type Verified = S::Verified; + type Follow = S::Follow; type Quote = S::Quote; + type Repost = S::Repost; + type Like = S::Like; + type StarterpackJoined = S::StarterpackJoined; + type Reply = Set; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Verified = S::Verified; } ///State transition - sets the `subscribed_post` field to Set pub struct SetSubscribedPost(PhantomData S>); impl sealed::Sealed for SetSubscribedPost {} impl State for SetSubscribedPost { - type Reply = S::Reply; + type LikeViaRepost = S::LikeViaRepost; + type RepostViaRepost = S::RepostViaRepost; type Chat = S::Chat; + type Mention = S::Mention; type Follow = S::Follow; + type Quote = S::Quote; + type Repost = S::Repost; type Like = S::Like; - type RepostViaRepost = S::RepostViaRepost; type StarterpackJoined = S::StarterpackJoined; + type Reply = S::Reply; type SubscribedPost = Set; type Unverified = S::Unverified; - type LikeViaRepost = S::LikeViaRepost; - type Repost = S::Repost; - type Mention = S::Mention; type Verified = S::Verified; - type Quote = S::Quote; } ///State transition - sets the `unverified` field to Set pub struct SetUnverified(PhantomData S>); impl sealed::Sealed for SetUnverified {} impl State for SetUnverified { - type Reply = S::Reply; - type Chat = S::Chat; - type Follow = S::Follow; - type Like = S::Like; - type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Unverified = Set; type LikeViaRepost = S::LikeViaRepost; - type Repost = S::Repost; - type Mention = S::Mention; - type Verified = S::Verified; - type Quote = S::Quote; - } - ///State transition - sets the `like_via_repost` field to Set - pub struct SetLikeViaRepost(PhantomData S>); - impl sealed::Sealed for SetLikeViaRepost {} - impl State for SetLikeViaRepost { - type Reply = S::Reply; - type Chat = S::Chat; - type Follow = S::Follow; - type Like = S::Like; type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Unverified = S::Unverified; - type LikeViaRepost = Set; - type Repost = S::Repost; - type Mention = S::Mention; - type Verified = S::Verified; - type Quote = S::Quote; - } - ///State transition - sets the `repost` field to Set - pub struct SetRepost(PhantomData S>); - impl sealed::Sealed for SetRepost {} - impl State for SetRepost { - type Reply = S::Reply; type Chat = S::Chat; - type Follow = S::Follow; - type Like = S::Like; - type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Unverified = S::Unverified; - type LikeViaRepost = S::LikeViaRepost; - type Repost = Set; type Mention = S::Mention; - type Verified = S::Verified; - type Quote = S::Quote; - } - ///State transition - sets the `mention` field to Set - pub struct SetMention(PhantomData S>); - impl sealed::Sealed for SetMention {} - impl State for SetMention { - type Reply = S::Reply; - type Chat = S::Chat; type Follow = S::Follow; + type Quote = S::Quote; + type Repost = S::Repost; type Like = S::Like; - type RepostViaRepost = S::RepostViaRepost; type StarterpackJoined = S::StarterpackJoined; + type Reply = S::Reply; type SubscribedPost = S::SubscribedPost; - type Unverified = S::Unverified; - type LikeViaRepost = S::LikeViaRepost; - type Repost = S::Repost; - type Mention = Set; + type Unverified = Set; type Verified = S::Verified; - type Quote = S::Quote; } ///State transition - sets the `verified` field to Set pub struct SetVerified(PhantomData S>); impl sealed::Sealed for SetVerified {} impl State for SetVerified { - type Reply = S::Reply; - type Chat = S::Chat; - type Follow = S::Follow; - type Like = S::Like; - type RepostViaRepost = S::RepostViaRepost; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Unverified = S::Unverified; type LikeViaRepost = S::LikeViaRepost; - type Repost = S::Repost; - type Mention = S::Mention; - type Verified = Set; - type Quote = S::Quote; - } - ///State transition - sets the `quote` field to Set - pub struct SetQuote(PhantomData S>); - impl sealed::Sealed for SetQuote {} - impl State for SetQuote { - type Reply = S::Reply; + type RepostViaRepost = S::RepostViaRepost; type Chat = S::Chat; + type Mention = S::Mention; type Follow = S::Follow; + type Quote = S::Quote; + type Repost = S::Repost; type Like = S::Like; - type RepostViaRepost = S::RepostViaRepost; type StarterpackJoined = S::StarterpackJoined; + type Reply = S::Reply; type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; - type LikeViaRepost = S::LikeViaRepost; - type Repost = S::Repost; - type Mention = S::Mention; - type Verified = S::Verified; - type Quote = Set; + type Verified = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reply` field - pub struct reply(()); + ///Marker type for the `like_via_repost` field + pub struct like_via_repost(()); + ///Marker type for the `repost_via_repost` field + pub struct repost_via_repost(()); ///Marker type for the `chat` field pub struct chat(()); + ///Marker type for the `mention` field + pub struct mention(()); ///Marker type for the `follow` field pub struct follow(()); + ///Marker type for the `quote` field + pub struct quote(()); + ///Marker type for the `repost` field + pub struct repost(()); ///Marker type for the `like` field pub struct like(()); - ///Marker type for the `repost_via_repost` field - pub struct repost_via_repost(()); ///Marker type for the `starterpack_joined` field pub struct starterpack_joined(()); + ///Marker type for the `reply` field + pub struct reply(()); ///Marker type for the `subscribed_post` field pub struct subscribed_post(()); ///Marker type for the `unverified` field pub struct unverified(()); - ///Marker type for the `like_via_repost` field - pub struct like_via_repost(()); - ///Marker type for the `repost` field - pub struct repost(()); - ///Marker type for the `mention` field - pub struct mention(()); ///Marker type for the `verified` field pub struct verified(()); - ///Marker type for the `quote` field - pub struct quote(()); } } @@ -1781,19 +1781,19 @@ where impl<'a, S> PreferencesBuilder<'a, S> where S: preferences_state::State, - S::Reply: preferences_state::IsSet, + S::LikeViaRepost: preferences_state::IsSet, + S::RepostViaRepost: preferences_state::IsSet, S::Chat: preferences_state::IsSet, + S::Mention: preferences_state::IsSet, S::Follow: preferences_state::IsSet, + S::Quote: preferences_state::IsSet, + S::Repost: preferences_state::IsSet, S::Like: preferences_state::IsSet, - S::RepostViaRepost: preferences_state::IsSet, S::StarterpackJoined: preferences_state::IsSet, + S::Reply: preferences_state::IsSet, S::SubscribedPost: preferences_state::IsSet, S::Unverified: preferences_state::IsSet, - S::LikeViaRepost: preferences_state::IsSet, - S::Repost: preferences_state::IsSet, - S::Mention: preferences_state::IsSet, S::Verified: preferences_state::IsSet, - S::Quote: preferences_state::IsSet, { /// Build the final struct pub fn build(self) -> Preferences<'a> { @@ -1917,37 +1917,37 @@ pub mod subject_activity_subscription_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type ActivitySubscription; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type ActivitySubscription = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type ActivitySubscription = S::ActivitySubscription; + type Subject = Unset; } ///State transition - sets the `activity_subscription` field to Set pub struct SetActivitySubscription(PhantomData S>); impl sealed::Sealed for SetActivitySubscription {} impl State for SetActivitySubscription { - type Subject = S::Subject; type ActivitySubscription = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type ActivitySubscription = S::ActivitySubscription; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `activity_subscription` field pub struct activity_subscription(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -2034,8 +2034,8 @@ where impl<'a, S> SubjectActivitySubscriptionBuilder<'a, S> where S: subject_activity_subscription_state::State, - S::Subject: subject_activity_subscription_state::IsSet, S::ActivitySubscription: subject_activity_subscription_state::IsSet, + S::Subject: subject_activity_subscription_state::IsSet, { /// Build the final struct pub fn build(self) -> SubjectActivitySubscription<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification/list_notifications.rs b/crates/weaver-api/src/app_bsky/notification/list_notifications.rs index 60531c2..052849b 100644 --- a/crates/weaver-api/src/app_bsky/notification/list_notifications.rs +++ b/crates/weaver-api/src/app_bsky/notification/list_notifications.rs @@ -271,127 +271,127 @@ pub mod notification_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reason; - type Uri; - type Record; - type IsRead; type IndexedAt; type Cid; + type IsRead; type Author; + type Reason; + type Uri; + type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Reason = Unset; - type Uri = Unset; - type Record = Unset; - type IsRead = Unset; type IndexedAt = Unset; type Cid = Unset; + type IsRead = Unset; type Author = Unset; + type Reason = Unset; + type Uri = Unset; + type Record = Unset; } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type Reason = Set; - type Uri = S::Uri; - type Record = S::Record; - type IsRead = S::IsRead; - type IndexedAt = S::IndexedAt; + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; type Cid = S::Cid; + type IsRead = S::IsRead; type Author = S::Author; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { type Reason = S::Reason; - type Uri = Set; + type Uri = S::Uri; type Record = S::Record; - type IsRead = S::IsRead; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type IndexedAt = S::IndexedAt; - type Cid = S::Cid; + type Cid = Set; + type IsRead = S::IsRead; type Author = S::Author; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { type Reason = S::Reason; type Uri = S::Uri; - type Record = Set; - type IsRead = S::IsRead; - type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - type Author = S::Author; + type Record = S::Record; } ///State transition - sets the `is_read` field to Set pub struct SetIsRead(PhantomData S>); impl sealed::Sealed for SetIsRead {} impl State for SetIsRead { + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type IsRead = Set; + type Author = S::Author; type Reason = S::Reason; type Uri = S::Uri; type Record = S::Record; - type IsRead = Set; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { type IndexedAt = S::IndexedAt; type Cid = S::Cid; - type Author = S::Author; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { + type IsRead = S::IsRead; + type Author = Set; type Reason = S::Reason; type Uri = S::Uri; type Record = S::Record; - type IsRead = S::IsRead; - type IndexedAt = Set; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type IndexedAt = S::IndexedAt; type Cid = S::Cid; + type IsRead = S::IsRead; type Author = S::Author; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Reason = S::Reason; + type Reason = Set; type Uri = S::Uri; type Record = S::Record; - type IsRead = S::IsRead; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type IndexedAt = S::IndexedAt; - type Cid = Set; + type Cid = S::Cid; + type IsRead = S::IsRead; type Author = S::Author; - } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData S>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { type Reason = S::Reason; - type Uri = S::Uri; + type Uri = Set; type Record = S::Record; - type IsRead = S::IsRead; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { type IndexedAt = S::IndexedAt; type Cid = S::Cid; - type Author = Set; + type IsRead = S::IsRead; + type Author = S::Author; + type Reason = S::Reason; + type Uri = S::Uri; + type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reason` field - pub struct reason(()); - ///Marker type for the `uri` field - pub struct uri(()); - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `is_read` field - pub struct is_read(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `is_read` field + pub struct is_read(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `reason` field + pub struct reason(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -614,13 +614,13 @@ where impl<'a, S> NotificationBuilder<'a, S> where S: notification_state::State, - S::Reason: notification_state::IsSet, - S::Uri: notification_state::IsSet, - S::Record: notification_state::IsSet, - S::IsRead: notification_state::IsSet, S::IndexedAt: notification_state::IsSet, S::Cid: notification_state::IsSet, + S::IsRead: notification_state::IsSet, S::Author: notification_state::IsSet, + S::Reason: notification_state::IsSet, + S::Uri: notification_state::IsSet, + S::Record: notification_state::IsSet, { /// Build the final struct pub fn build(self) -> Notification<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs b/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs index b0c858e..7e167a9 100644 --- a/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs +++ b/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs @@ -33,37 +33,37 @@ pub mod put_activity_subscription_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ActivitySubscription; type Subject; + type ActivitySubscription; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ActivitySubscription = Unset; type Subject = Unset; - } - ///State transition - sets the `activity_subscription` field to Set - pub struct SetActivitySubscription(PhantomData S>); - impl sealed::Sealed for SetActivitySubscription {} - impl State for SetActivitySubscription { - type ActivitySubscription = Set; - type Subject = S::Subject; + type ActivitySubscription = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type ActivitySubscription = S::ActivitySubscription; type Subject = Set; + type ActivitySubscription = S::ActivitySubscription; + } + ///State transition - sets the `activity_subscription` field to Set + pub struct SetActivitySubscription(PhantomData S>); + impl sealed::Sealed for SetActivitySubscription {} + impl State for SetActivitySubscription { + type Subject = S::Subject; + type ActivitySubscription = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `activity_subscription` field - pub struct activity_subscription(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `activity_subscription` field + pub struct activity_subscription(()); } } @@ -148,8 +148,8 @@ where impl<'a, S> PutActivitySubscriptionBuilder<'a, S> where S: put_activity_subscription_state::State, - S::ActivitySubscription: put_activity_subscription_state::IsSet, S::Subject: put_activity_subscription_state::IsSet, + S::ActivitySubscription: put_activity_subscription_state::IsSet, { /// Build the final struct pub fn build(self) -> PutActivitySubscription<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification/register_push.rs b/crates/weaver-api/src/app_bsky/notification/register_push.rs index 59309d0..9c2bb8c 100644 --- a/crates/weaver-api/src/app_bsky/notification/register_push.rs +++ b/crates/weaver-api/src/app_bsky/notification/register_push.rs @@ -40,8 +40,8 @@ pub mod register_push_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type AppId; type ServiceDid; + type AppId; type Token; type Platform; } @@ -49,26 +49,26 @@ pub mod register_push_state { pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type AppId = Unset; type ServiceDid = Unset; + type AppId = Unset; type Token = Unset; type Platform = Unset; } - ///State transition - sets the `app_id` field to Set - pub struct SetAppId(PhantomData S>); - impl sealed::Sealed for SetAppId {} - impl State for SetAppId { - type AppId = Set; - type ServiceDid = S::ServiceDid; - type Token = S::Token; - type Platform = S::Platform; - } ///State transition - sets the `service_did` field to Set pub struct SetServiceDid(PhantomData S>); impl sealed::Sealed for SetServiceDid {} impl State for SetServiceDid { - type AppId = S::AppId; type ServiceDid = Set; + type AppId = S::AppId; + type Token = S::Token; + type Platform = S::Platform; + } + ///State transition - sets the `app_id` field to Set + pub struct SetAppId(PhantomData S>); + impl sealed::Sealed for SetAppId {} + impl State for SetAppId { + type ServiceDid = S::ServiceDid; + type AppId = Set; type Token = S::Token; type Platform = S::Platform; } @@ -76,8 +76,8 @@ pub mod register_push_state { pub struct SetToken(PhantomData S>); impl sealed::Sealed for SetToken {} impl State for SetToken { - type AppId = S::AppId; type ServiceDid = S::ServiceDid; + type AppId = S::AppId; type Token = Set; type Platform = S::Platform; } @@ -85,18 +85,18 @@ pub mod register_push_state { pub struct SetPlatform(PhantomData S>); impl sealed::Sealed for SetPlatform {} impl State for SetPlatform { - type AppId = S::AppId; type ServiceDid = S::ServiceDid; + type AppId = S::AppId; type Token = S::Token; type Platform = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `app_id` field - pub struct app_id(()); ///Marker type for the `service_did` field pub struct service_did(()); + ///Marker type for the `app_id` field + pub struct app_id(()); ///Marker type for the `token` field pub struct token(()); ///Marker type for the `platform` field @@ -227,8 +227,8 @@ where impl<'a, S> RegisterPushBuilder<'a, S> where S: register_push_state::State, - S::AppId: register_push_state::IsSet, S::ServiceDid: register_push_state::IsSet, + S::AppId: register_push_state::IsSet, S::Token: register_push_state::IsSet, S::Platform: register_push_state::IsSet, { diff --git a/crates/weaver-api/src/app_bsky/notification/unregister_push.rs b/crates/weaver-api/src/app_bsky/notification/unregister_push.rs index 75c37f4..1a3ca62 100644 --- a/crates/weaver-api/src/app_bsky/notification/unregister_push.rs +++ b/crates/weaver-api/src/app_bsky/notification/unregister_push.rs @@ -37,67 +37,67 @@ pub mod unregister_push_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ServiceDid; - type Token; type AppId; type Platform; + type ServiceDid; + type Token; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ServiceDid = Unset; - type Token = Unset; type AppId = Unset; type Platform = Unset; - } - ///State transition - sets the `service_did` field to Set - pub struct SetServiceDid(PhantomData S>); - impl sealed::Sealed for SetServiceDid {} - impl State for SetServiceDid { - type ServiceDid = Set; - type Token = S::Token; - type AppId = S::AppId; - type Platform = S::Platform; - } - ///State transition - sets the `token` field to Set - pub struct SetToken(PhantomData S>); - impl sealed::Sealed for SetToken {} - impl State for SetToken { - type ServiceDid = S::ServiceDid; - type Token = Set; - type AppId = S::AppId; - type Platform = S::Platform; + type ServiceDid = Unset; + type Token = Unset; } ///State transition - sets the `app_id` field to Set pub struct SetAppId(PhantomData S>); impl sealed::Sealed for SetAppId {} impl State for SetAppId { - type ServiceDid = S::ServiceDid; - type Token = S::Token; type AppId = Set; type Platform = S::Platform; + type ServiceDid = S::ServiceDid; + type Token = S::Token; } ///State transition - sets the `platform` field to Set pub struct SetPlatform(PhantomData S>); impl sealed::Sealed for SetPlatform {} impl State for SetPlatform { + type AppId = S::AppId; + type Platform = Set; type ServiceDid = S::ServiceDid; type Token = S::Token; + } + ///State transition - sets the `service_did` field to Set + pub struct SetServiceDid(PhantomData S>); + impl sealed::Sealed for SetServiceDid {} + impl State for SetServiceDid { type AppId = S::AppId; - type Platform = Set; + type Platform = S::Platform; + type ServiceDid = Set; + type Token = S::Token; + } + ///State transition - sets the `token` field to Set + pub struct SetToken(PhantomData S>); + impl sealed::Sealed for SetToken {} + impl State for SetToken { + type AppId = S::AppId; + type Platform = S::Platform; + type ServiceDid = S::ServiceDid; + type Token = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `service_did` field - pub struct service_did(()); - ///Marker type for the `token` field - pub struct token(()); ///Marker type for the `app_id` field pub struct app_id(()); ///Marker type for the `platform` field pub struct platform(()); + ///Marker type for the `service_did` field + pub struct service_did(()); + ///Marker type for the `token` field + pub struct token(()); } } @@ -210,10 +210,10 @@ where impl<'a, S> UnregisterPushBuilder<'a, S> where S: unregister_push_state::State, - S::ServiceDid: unregister_push_state::IsSet, - S::Token: unregister_push_state::IsSet, S::AppId: unregister_push_state::IsSet, S::Platform: unregister_push_state::IsSet, + S::ServiceDid: unregister_push_state::IsSet, + S::Token: unregister_push_state::IsSet, { /// Build the final struct pub fn build(self) -> UnregisterPush<'a> { diff --git a/crates/weaver-api/src/app_bsky/richtext/facet.rs b/crates/weaver-api/src/app_bsky/richtext/facet.rs index 2b225b3..08aea7c 100644 --- a/crates/weaver-api/src/app_bsky/richtext/facet.rs +++ b/crates/weaver-api/src/app_bsky/richtext/facet.rs @@ -32,37 +32,37 @@ pub mod byte_slice_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ByteStart; type ByteEnd; + type ByteStart; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ByteStart = Unset; type ByteEnd = Unset; - } - ///State transition - sets the `byte_start` field to Set - pub struct SetByteStart(PhantomData S>); - impl sealed::Sealed for SetByteStart {} - impl State for SetByteStart { - type ByteStart = Set; - type ByteEnd = S::ByteEnd; + type ByteStart = Unset; } ///State transition - sets the `byte_end` field to Set pub struct SetByteEnd(PhantomData S>); impl sealed::Sealed for SetByteEnd {} impl State for SetByteEnd { - type ByteStart = S::ByteStart; type ByteEnd = Set; + type ByteStart = S::ByteStart; + } + ///State transition - sets the `byte_start` field to Set + pub struct SetByteStart(PhantomData S>); + impl sealed::Sealed for SetByteStart {} + impl State for SetByteStart { + type ByteEnd = S::ByteEnd; + type ByteStart = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `byte_start` field - pub struct byte_start(()); ///Marker type for the `byte_end` field pub struct byte_end(()); + ///Marker type for the `byte_start` field + pub struct byte_start(()); } } @@ -132,8 +132,8 @@ where impl<'a, S> ByteSliceBuilder<'a, S> where S: byte_slice_state::State, - S::ByteStart: byte_slice_state::IsSet, S::ByteEnd: byte_slice_state::IsSet, + S::ByteStart: byte_slice_state::IsSet, { /// Build the final struct pub fn build(self) -> ByteSlice<'a> { diff --git a/crates/weaver-api/src/app_bsky/unspecced.rs b/crates/weaver-api/src/app_bsky/unspecced.rs index 71fd394..ceb9352 100644 --- a/crates/weaver-api/src/app_bsky/unspecced.rs +++ b/crates/weaver-api/src/app_bsky/unspecced.rs @@ -81,49 +81,49 @@ pub mod age_assurance_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type AttemptId; + type CreatedAt; type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type AttemptId = Unset; + type CreatedAt = Unset; type Status = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type AttemptId = S::AttemptId; - type Status = S::Status; - } ///State transition - sets the `attempt_id` field to Set pub struct SetAttemptId(PhantomData S>); impl sealed::Sealed for SetAttemptId {} impl State for SetAttemptId { - type CreatedAt = S::CreatedAt; type AttemptId = Set; + type CreatedAt = S::CreatedAt; + type Status = S::Status; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type AttemptId = S::AttemptId; + type CreatedAt = Set; type Status = S::Status; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type CreatedAt = S::CreatedAt; type AttemptId = S::AttemptId; + type CreatedAt = S::CreatedAt; type Status = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `attempt_id` field pub struct attempt_id(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `status` field pub struct status(()); } @@ -309,8 +309,8 @@ where impl<'a, S> AgeAssuranceEventBuilder<'a, S> where S: age_assurance_event_state::State, - S::CreatedAt: age_assurance_event_state::IsSet, S::AttemptId: age_assurance_event_state::IsSet, + S::CreatedAt: age_assurance_event_state::IsSet, S::Status: age_assurance_event_state::IsSet, { /// Build the final struct @@ -1743,105 +1743,105 @@ pub mod skeleton_trend_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Topic; type Link; - type DisplayName; + type StartedAt; type PostCount; + type DisplayName; type Dids; - type StartedAt; + type Topic; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Topic = Unset; type Link = Unset; - type DisplayName = Unset; + type StartedAt = Unset; type PostCount = Unset; + type DisplayName = Unset; type Dids = Unset; - type StartedAt = Unset; - } - ///State transition - sets the `topic` field to Set - pub struct SetTopic(PhantomData S>); - impl sealed::Sealed for SetTopic {} - impl State for SetTopic { - type Topic = Set; - type Link = S::Link; - type DisplayName = S::DisplayName; - type PostCount = S::PostCount; - type Dids = S::Dids; - type StartedAt = S::StartedAt; + type Topic = Unset; } ///State transition - sets the `link` field to Set pub struct SetLink(PhantomData S>); impl sealed::Sealed for SetLink {} impl State for SetLink { - type Topic = S::Topic; type Link = Set; - type DisplayName = S::DisplayName; + type StartedAt = S::StartedAt; type PostCount = S::PostCount; + type DisplayName = S::DisplayName; type Dids = S::Dids; - type StartedAt = S::StartedAt; - } - ///State transition - sets the `display_name` field to Set - pub struct SetDisplayName(PhantomData S>); - impl sealed::Sealed for SetDisplayName {} - impl State for SetDisplayName { type Topic = S::Topic; + } + ///State transition - sets the `started_at` field to Set + pub struct SetStartedAt(PhantomData S>); + impl sealed::Sealed for SetStartedAt {} + impl State for SetStartedAt { type Link = S::Link; - type DisplayName = Set; + type StartedAt = Set; type PostCount = S::PostCount; + type DisplayName = S::DisplayName; type Dids = S::Dids; - type StartedAt = S::StartedAt; + type Topic = S::Topic; } ///State transition - sets the `post_count` field to Set pub struct SetPostCount(PhantomData S>); impl sealed::Sealed for SetPostCount {} impl State for SetPostCount { - type Topic = S::Topic; type Link = S::Link; - type DisplayName = S::DisplayName; + type StartedAt = S::StartedAt; type PostCount = Set; + type DisplayName = S::DisplayName; type Dids = S::Dids; + type Topic = S::Topic; + } + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData S>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { + type Link = S::Link; type StartedAt = S::StartedAt; + type PostCount = S::PostCount; + type DisplayName = Set; + type Dids = S::Dids; + type Topic = S::Topic; } ///State transition - sets the `dids` field to Set pub struct SetDids(PhantomData S>); impl sealed::Sealed for SetDids {} impl State for SetDids { - type Topic = S::Topic; type Link = S::Link; - type DisplayName = S::DisplayName; + type StartedAt = S::StartedAt; type PostCount = S::PostCount; + type DisplayName = S::DisplayName; type Dids = Set; - type StartedAt = S::StartedAt; - } - ///State transition - sets the `started_at` field to Set - pub struct SetStartedAt(PhantomData S>); - impl sealed::Sealed for SetStartedAt {} - impl State for SetStartedAt { type Topic = S::Topic; + } + ///State transition - sets the `topic` field to Set + pub struct SetTopic(PhantomData S>); + impl sealed::Sealed for SetTopic {} + impl State for SetTopic { type Link = S::Link; - type DisplayName = S::DisplayName; + type StartedAt = S::StartedAt; type PostCount = S::PostCount; + type DisplayName = S::DisplayName; type Dids = S::Dids; - type StartedAt = Set; + type Topic = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `topic` field - pub struct topic(()); ///Marker type for the `link` field pub struct link(()); - ///Marker type for the `display_name` field - pub struct display_name(()); + ///Marker type for the `started_at` field + pub struct started_at(()); ///Marker type for the `post_count` field pub struct post_count(()); + ///Marker type for the `display_name` field + pub struct display_name(()); ///Marker type for the `dids` field pub struct dids(()); - ///Marker type for the `started_at` field - pub struct started_at(()); + ///Marker type for the `topic` field + pub struct topic(()); } } @@ -2028,12 +2028,12 @@ where impl<'a, S> SkeletonTrendBuilder<'a, S> where S: skeleton_trend_state::State, - S::Topic: skeleton_trend_state::IsSet, S::Link: skeleton_trend_state::IsSet, - S::DisplayName: skeleton_trend_state::IsSet, + S::StartedAt: skeleton_trend_state::IsSet, S::PostCount: skeleton_trend_state::IsSet, + S::DisplayName: skeleton_trend_state::IsSet, S::Dids: skeleton_trend_state::IsSet, - S::StartedAt: skeleton_trend_state::IsSet, + S::Topic: skeleton_trend_state::IsSet, { /// Build the final struct pub fn build(self) -> SkeletonTrend<'a> { @@ -2322,105 +2322,105 @@ pub mod thread_item_post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type OpThread; + type Post; + type MutedByViewer; + type HiddenByThreadgate; type MoreReplies; + type OpThread; type MoreParents; - type HiddenByThreadgate; - type MutedByViewer; - type Post; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type OpThread = Unset; + type Post = Unset; + type MutedByViewer = Unset; + type HiddenByThreadgate = Unset; type MoreReplies = Unset; + type OpThread = Unset; type MoreParents = Unset; - type HiddenByThreadgate = Unset; - type MutedByViewer = Unset; - type Post = Unset; } - ///State transition - sets the `op_thread` field to Set - pub struct SetOpThread(PhantomData S>); - impl sealed::Sealed for SetOpThread {} - impl State for SetOpThread { - type OpThread = Set; + ///State transition - sets the `post` field to Set + pub struct SetPost(PhantomData S>); + impl sealed::Sealed for SetPost {} + impl State for SetPost { + type Post = Set; + type MutedByViewer = S::MutedByViewer; + type HiddenByThreadgate = S::HiddenByThreadgate; type MoreReplies = S::MoreReplies; + type OpThread = S::OpThread; type MoreParents = S::MoreParents; + } + ///State transition - sets the `muted_by_viewer` field to Set + pub struct SetMutedByViewer(PhantomData S>); + impl sealed::Sealed for SetMutedByViewer {} + impl State for SetMutedByViewer { + type Post = S::Post; + type MutedByViewer = Set; type HiddenByThreadgate = S::HiddenByThreadgate; - type MutedByViewer = S::MutedByViewer; + type MoreReplies = S::MoreReplies; + type OpThread = S::OpThread; + type MoreParents = S::MoreParents; + } + ///State transition - sets the `hidden_by_threadgate` field to Set + pub struct SetHiddenByThreadgate(PhantomData S>); + impl sealed::Sealed for SetHiddenByThreadgate {} + impl State for SetHiddenByThreadgate { type Post = S::Post; + type MutedByViewer = S::MutedByViewer; + type HiddenByThreadgate = Set; + type MoreReplies = S::MoreReplies; + type OpThread = S::OpThread; + type MoreParents = S::MoreParents; } ///State transition - sets the `more_replies` field to Set pub struct SetMoreReplies(PhantomData S>); impl sealed::Sealed for SetMoreReplies {} impl State for SetMoreReplies { - type OpThread = S::OpThread; + type Post = S::Post; + type MutedByViewer = S::MutedByViewer; + type HiddenByThreadgate = S::HiddenByThreadgate; type MoreReplies = Set; + type OpThread = S::OpThread; type MoreParents = S::MoreParents; - type HiddenByThreadgate = S::HiddenByThreadgate; - type MutedByViewer = S::MutedByViewer; + } + ///State transition - sets the `op_thread` field to Set + pub struct SetOpThread(PhantomData S>); + impl sealed::Sealed for SetOpThread {} + impl State for SetOpThread { type Post = S::Post; + type MutedByViewer = S::MutedByViewer; + type HiddenByThreadgate = S::HiddenByThreadgate; + type MoreReplies = S::MoreReplies; + type OpThread = Set; + type MoreParents = S::MoreParents; } ///State transition - sets the `more_parents` field to Set pub struct SetMoreParents(PhantomData S>); impl sealed::Sealed for SetMoreParents {} impl State for SetMoreParents { - type OpThread = S::OpThread; - type MoreReplies = S::MoreReplies; - type MoreParents = Set; - type HiddenByThreadgate = S::HiddenByThreadgate; - type MutedByViewer = S::MutedByViewer; type Post = S::Post; - } - ///State transition - sets the `hidden_by_threadgate` field to Set - pub struct SetHiddenByThreadgate(PhantomData S>); - impl sealed::Sealed for SetHiddenByThreadgate {} - impl State for SetHiddenByThreadgate { - type OpThread = S::OpThread; - type MoreReplies = S::MoreReplies; - type MoreParents = S::MoreParents; - type HiddenByThreadgate = Set; type MutedByViewer = S::MutedByViewer; - type Post = S::Post; - } - ///State transition - sets the `muted_by_viewer` field to Set - pub struct SetMutedByViewer(PhantomData S>); - impl sealed::Sealed for SetMutedByViewer {} - impl State for SetMutedByViewer { - type OpThread = S::OpThread; - type MoreReplies = S::MoreReplies; - type MoreParents = S::MoreParents; type HiddenByThreadgate = S::HiddenByThreadgate; - type MutedByViewer = Set; - type Post = S::Post; - } - ///State transition - sets the `post` field to Set - pub struct SetPost(PhantomData S>); - impl sealed::Sealed for SetPost {} - impl State for SetPost { - type OpThread = S::OpThread; type MoreReplies = S::MoreReplies; - type MoreParents = S::MoreParents; - type HiddenByThreadgate = S::HiddenByThreadgate; - type MutedByViewer = S::MutedByViewer; - type Post = Set; + type OpThread = S::OpThread; + type MoreParents = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `op_thread` field - pub struct op_thread(()); + ///Marker type for the `post` field + pub struct post(()); + ///Marker type for the `muted_by_viewer` field + pub struct muted_by_viewer(()); + ///Marker type for the `hidden_by_threadgate` field + pub struct hidden_by_threadgate(()); ///Marker type for the `more_replies` field pub struct more_replies(()); + ///Marker type for the `op_thread` field + pub struct op_thread(()); ///Marker type for the `more_parents` field pub struct more_parents(()); - ///Marker type for the `hidden_by_threadgate` field - pub struct hidden_by_threadgate(()); - ///Marker type for the `muted_by_viewer` field - pub struct muted_by_viewer(()); - ///Marker type for the `post` field - pub struct post(()); } } @@ -2573,12 +2573,12 @@ where impl<'a, S> ThreadItemPostBuilder<'a, S> where S: thread_item_post_state::State, - S::OpThread: thread_item_post_state::IsSet, + S::Post: thread_item_post_state::IsSet, + S::MutedByViewer: thread_item_post_state::IsSet, + S::HiddenByThreadgate: thread_item_post_state::IsSet, S::MoreReplies: thread_item_post_state::IsSet, + S::OpThread: thread_item_post_state::IsSet, S::MoreParents: thread_item_post_state::IsSet, - S::HiddenByThreadgate: thread_item_post_state::IsSet, - S::MutedByViewer: thread_item_post_state::IsSet, - S::Post: thread_item_post_state::IsSet, { /// Build the final struct pub fn build(self) -> ThreadItemPost<'a> { @@ -2669,105 +2669,105 @@ pub mod trend_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Link; - type Topic; type DisplayName; + type Link; + type Actors; type PostCount; type StartedAt; - type Actors; + type Topic; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Link = Unset; - type Topic = Unset; type DisplayName = Unset; + type Link = Unset; + type Actors = Unset; type PostCount = Unset; type StartedAt = Unset; - type Actors = Unset; + type Topic = Unset; + } + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData S>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { + type DisplayName = Set; + type Link = S::Link; + type Actors = S::Actors; + type PostCount = S::PostCount; + type StartedAt = S::StartedAt; + type Topic = S::Topic; } ///State transition - sets the `link` field to Set pub struct SetLink(PhantomData S>); impl sealed::Sealed for SetLink {} impl State for SetLink { - type Link = Set; - type Topic = S::Topic; type DisplayName = S::DisplayName; - type PostCount = S::PostCount; - type StartedAt = S::StartedAt; + type Link = Set; type Actors = S::Actors; - } - ///State transition - sets the `topic` field to Set - pub struct SetTopic(PhantomData S>); - impl sealed::Sealed for SetTopic {} - impl State for SetTopic { - type Link = S::Link; - type Topic = Set; - type DisplayName = S::DisplayName; type PostCount = S::PostCount; type StartedAt = S::StartedAt; - type Actors = S::Actors; + type Topic = S::Topic; } - ///State transition - sets the `display_name` field to Set - pub struct SetDisplayName(PhantomData S>); - impl sealed::Sealed for SetDisplayName {} - impl State for SetDisplayName { + ///State transition - sets the `actors` field to Set + pub struct SetActors(PhantomData S>); + impl sealed::Sealed for SetActors {} + impl State for SetActors { + type DisplayName = S::DisplayName; type Link = S::Link; - type Topic = S::Topic; - type DisplayName = Set; + type Actors = Set; type PostCount = S::PostCount; type StartedAt = S::StartedAt; - type Actors = S::Actors; + type Topic = S::Topic; } ///State transition - sets the `post_count` field to Set pub struct SetPostCount(PhantomData S>); impl sealed::Sealed for SetPostCount {} impl State for SetPostCount { - type Link = S::Link; - type Topic = S::Topic; type DisplayName = S::DisplayName; + type Link = S::Link; + type Actors = S::Actors; type PostCount = Set; type StartedAt = S::StartedAt; - type Actors = S::Actors; + type Topic = S::Topic; } ///State transition - sets the `started_at` field to Set pub struct SetStartedAt(PhantomData S>); impl sealed::Sealed for SetStartedAt {} impl State for SetStartedAt { - type Link = S::Link; - type Topic = S::Topic; type DisplayName = S::DisplayName; + type Link = S::Link; + type Actors = S::Actors; type PostCount = S::PostCount; type StartedAt = Set; - type Actors = S::Actors; - } - ///State transition - sets the `actors` field to Set - pub struct SetActors(PhantomData S>); - impl sealed::Sealed for SetActors {} - impl State for SetActors { - type Link = S::Link; type Topic = S::Topic; + } + ///State transition - sets the `topic` field to Set + pub struct SetTopic(PhantomData S>); + impl sealed::Sealed for SetTopic {} + impl State for SetTopic { type DisplayName = S::DisplayName; + type Link = S::Link; + type Actors = S::Actors; type PostCount = S::PostCount; type StartedAt = S::StartedAt; - type Actors = Set; + type Topic = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `link` field - pub struct link(()); - ///Marker type for the `topic` field - pub struct topic(()); ///Marker type for the `display_name` field pub struct display_name(()); + ///Marker type for the `link` field + pub struct link(()); + ///Marker type for the `actors` field + pub struct actors(()); ///Marker type for the `post_count` field pub struct post_count(()); ///Marker type for the `started_at` field pub struct started_at(()); - ///Marker type for the `actors` field - pub struct actors(()); + ///Marker type for the `topic` field + pub struct topic(()); } } @@ -2954,12 +2954,12 @@ where impl<'a, S> TrendViewBuilder<'a, S> where S: trend_view_state::State, - S::Link: trend_view_state::IsSet, - S::Topic: trend_view_state::IsSet, S::DisplayName: trend_view_state::IsSet, + S::Link: trend_view_state::IsSet, + S::Actors: trend_view_state::IsSet, S::PostCount: trend_view_state::IsSet, S::StartedAt: trend_view_state::IsSet, - S::Actors: trend_view_state::IsSet, + S::Topic: trend_view_state::IsSet, { /// Build the final struct pub fn build(self) -> TrendView<'a> { diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs index 752df1f..691dc9b 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs @@ -190,50 +190,50 @@ pub mod thread_item_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; - type Value; type Depth; + type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; - type Value = Unset; type Depth = Unset; + type Value = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Uri = Set; - type Value = S::Value; - type Depth = S::Depth; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type Uri = S::Uri; - type Value = Set; type Depth = S::Depth; + type Value = S::Value; } ///State transition - sets the `depth` field to Set pub struct SetDepth(PhantomData S>); impl sealed::Sealed for SetDepth {} impl State for SetDepth { type Uri = S::Uri; - type Value = S::Value; type Depth = Set; + type Value = S::Value; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Uri = S::Uri; + type Depth = S::Depth; + type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `value` field - pub struct value(()); ///Marker type for the `depth` field pub struct depth(()); + ///Marker type for the `value` field + pub struct value(()); } } @@ -327,8 +327,8 @@ impl<'a, S> ThreadItemBuilder<'a, S> where S: thread_item_state::State, S::Uri: thread_item_state::IsSet, - S::Value: thread_item_state::IsSet, S::Depth: thread_item_state::IsSet, + S::Value: thread_item_state::IsSet, { /// Build the final struct pub fn build(self) -> ThreadItem<'a> { diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs index 39bc068..7f475f3 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs @@ -265,51 +265,51 @@ pub mod thread_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Depth; type Uri; type Value; + type Depth; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Depth = Unset; type Uri = Unset; type Value = Unset; - } - ///State transition - sets the `depth` field to Set - pub struct SetDepth(PhantomData S>); - impl sealed::Sealed for SetDepth {} - impl State for SetDepth { - type Depth = Set; - type Uri = S::Uri; - type Value = S::Value; + type Depth = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Depth = S::Depth; type Uri = Set; type Value = S::Value; + type Depth = S::Depth; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Depth = S::Depth; type Uri = S::Uri; type Value = Set; + type Depth = S::Depth; + } + ///State transition - sets the `depth` field to Set + pub struct SetDepth(PhantomData S>); + impl sealed::Sealed for SetDepth {} + impl State for SetDepth { + type Uri = S::Uri; + type Value = S::Value; + type Depth = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `depth` field - pub struct depth(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `depth` field + pub struct depth(()); } } @@ -402,9 +402,9 @@ where impl<'a, S> ThreadItemBuilder<'a, S> where S: thread_item_state::State, - S::Depth: thread_item_state::IsSet, S::Uri: thread_item_state::IsSet, S::Value: thread_item_state::IsSet, + S::Depth: thread_item_state::IsSet, { /// Build the final struct pub fn build(self) -> ThreadItem<'a> { diff --git a/crates/weaver-api/src/app_bsky/video.rs b/crates/weaver-api/src/app_bsky/video.rs index 582ebf2..d7b5d3c 100644 --- a/crates/weaver-api/src/app_bsky/video.rs +++ b/crates/weaver-api/src/app_bsky/video.rs @@ -52,51 +52,51 @@ pub mod job_status_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type State; type JobId; type Did; - type State; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type State = Unset; type JobId = Unset; type Did = Unset; - type State = Unset; + } + ///State transition - sets the `state` field to Set + pub struct SetState(PhantomData S>); + impl sealed::Sealed for SetState {} + impl State for SetState { + type State = Set; + type JobId = S::JobId; + type Did = S::Did; } ///State transition - sets the `job_id` field to Set pub struct SetJobId(PhantomData S>); impl sealed::Sealed for SetJobId {} impl State for SetJobId { + type State = S::State; type JobId = Set; type Did = S::Did; - type State = S::State; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type JobId = S::JobId; - type Did = Set; type State = S::State; - } - ///State transition - sets the `state` field to Set - pub struct SetState(PhantomData S>); - impl sealed::Sealed for SetState {} - impl State for SetState { type JobId = S::JobId; - type Did = S::Did; - type State = Set; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `state` field + pub struct state(()); ///Marker type for the `job_id` field pub struct job_id(()); ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `state` field - pub struct state(()); } } @@ -257,9 +257,9 @@ where impl<'a, S> JobStatusBuilder<'a, S> where S: job_status_state::State, + S::State: job_status_state::IsSet, S::JobId: job_status_state::IsSet, S::Did: job_status_state::IsSet, - S::State: job_status_state::IsSet, { /// Build the final struct pub fn build(self) -> JobStatus<'a> { diff --git a/crates/weaver-api/src/chat_bsky/convo.rs b/crates/weaver-api/src/chat_bsky/convo.rs index abc7f8f..7a3d0b0 100644 --- a/crates/weaver-api/src/chat_bsky/convo.rs +++ b/crates/weaver-api/src/chat_bsky/convo.rs @@ -66,83 +66,83 @@ pub mod convo_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type UnreadCount; type Members; - type Rev; type Muted; - type UnreadCount; + type Rev; type Id; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type UnreadCount = Unset; type Members = Unset; - type Rev = Unset; type Muted = Unset; - type UnreadCount = Unset; + type Rev = Unset; type Id = Unset; } + ///State transition - sets the `unread_count` field to Set + pub struct SetUnreadCount(PhantomData S>); + impl sealed::Sealed for SetUnreadCount {} + impl State for SetUnreadCount { + type UnreadCount = Set; + type Members = S::Members; + type Muted = S::Muted; + type Rev = S::Rev; + type Id = S::Id; + } ///State transition - sets the `members` field to Set pub struct SetMembers(PhantomData S>); impl sealed::Sealed for SetMembers {} impl State for SetMembers { - type Members = Set; - type Rev = S::Rev; - type Muted = S::Muted; type UnreadCount = S::UnreadCount; - type Id = S::Id; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Members = S::Members; - type Rev = Set; + type Members = Set; type Muted = S::Muted; - type UnreadCount = S::UnreadCount; + type Rev = S::Rev; type Id = S::Id; } ///State transition - sets the `muted` field to Set pub struct SetMuted(PhantomData S>); impl sealed::Sealed for SetMuted {} impl State for SetMuted { + type UnreadCount = S::UnreadCount; type Members = S::Members; - type Rev = S::Rev; type Muted = Set; - type UnreadCount = S::UnreadCount; + type Rev = S::Rev; type Id = S::Id; } - ///State transition - sets the `unread_count` field to Set - pub struct SetUnreadCount(PhantomData S>); - impl sealed::Sealed for SetUnreadCount {} - impl State for SetUnreadCount { + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type UnreadCount = S::UnreadCount; type Members = S::Members; - type Rev = S::Rev; type Muted = S::Muted; - type UnreadCount = Set; + type Rev = Set; type Id = S::Id; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { + type UnreadCount = S::UnreadCount; type Members = S::Members; - type Rev = S::Rev; type Muted = S::Muted; - type UnreadCount = S::UnreadCount; + type Rev = S::Rev; type Id = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `unread_count` field + pub struct unread_count(()); ///Marker type for the `members` field pub struct members(()); - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `muted` field pub struct muted(()); - ///Marker type for the `unread_count` field - pub struct unread_count(()); + ///Marker type for the `rev` field + pub struct rev(()); ///Marker type for the `id` field pub struct id(()); } @@ -334,10 +334,10 @@ where impl<'a, S> ConvoViewBuilder<'a, S> where S: convo_view_state::State, + S::UnreadCount: convo_view_state::IsSet, S::Members: convo_view_state::IsSet, - S::Rev: convo_view_state::IsSet, S::Muted: convo_view_state::IsSet, - S::UnreadCount: convo_view_state::IsSet, + S::Rev: convo_view_state::IsSet, S::Id: convo_view_state::IsSet, { /// Build the final struct @@ -1648,65 +1648,65 @@ pub mod deleted_message_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Sender; type Rev; type Id; - type Sender; type SentAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Sender = Unset; type Rev = Unset; type Id = Unset; - type Sender = Unset; type SentAt = Unset; } + ///State transition - sets the `sender` field to Set + pub struct SetSender(PhantomData S>); + impl sealed::Sealed for SetSender {} + impl State for SetSender { + type Sender = Set; + type Rev = S::Rev; + type Id = S::Id; + type SentAt = S::SentAt; + } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { + type Sender = S::Sender; type Rev = Set; type Id = S::Id; - type Sender = S::Sender; type SentAt = S::SentAt; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type Rev = S::Rev; - type Id = Set; type Sender = S::Sender; - type SentAt = S::SentAt; - } - ///State transition - sets the `sender` field to Set - pub struct SetSender(PhantomData S>); - impl sealed::Sealed for SetSender {} - impl State for SetSender { type Rev = S::Rev; - type Id = S::Id; - type Sender = Set; + type Id = Set; type SentAt = S::SentAt; } ///State transition - sets the `sent_at` field to Set pub struct SetSentAt(PhantomData S>); impl sealed::Sealed for SetSentAt {} impl State for SetSentAt { + type Sender = S::Sender; type Rev = S::Rev; type Id = S::Id; - type Sender = S::Sender; type SentAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `sender` field + pub struct sender(()); ///Marker type for the `rev` field pub struct rev(()); ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `sender` field - pub struct sender(()); ///Marker type for the `sent_at` field pub struct sent_at(()); } @@ -1821,9 +1821,9 @@ where impl<'a, S> DeletedMessageViewBuilder<'a, S> where S: deleted_message_view_state::State, + S::Sender: deleted_message_view_state::IsSet, S::Rev: deleted_message_view_state::IsSet, S::Id: deleted_message_view_state::IsSet, - S::Sender: deleted_message_view_state::IsSet, S::SentAt: deleted_message_view_state::IsSet, { /// Build the final struct @@ -1939,67 +1939,67 @@ pub mod log_add_reaction_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Message; - type Rev; type ConvoId; type Reaction; + type Rev; + type Message; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Message = Unset; - type Rev = Unset; type ConvoId = Unset; type Reaction = Unset; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData S>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type Message = Set; - type Rev = S::Rev; - type ConvoId = S::ConvoId; - type Reaction = S::Reaction; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Message = S::Message; - type Rev = Set; - type ConvoId = S::ConvoId; - type Reaction = S::Reaction; + type Rev = Unset; + type Message = Unset; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Message = S::Message; - type Rev = S::Rev; type ConvoId = Set; type Reaction = S::Reaction; + type Rev = S::Rev; + type Message = S::Message; } ///State transition - sets the `reaction` field to Set pub struct SetReaction(PhantomData S>); impl sealed::Sealed for SetReaction {} impl State for SetReaction { - type Message = S::Message; - type Rev = S::Rev; type ConvoId = S::ConvoId; type Reaction = Set; + type Rev = S::Rev; + type Message = S::Message; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type ConvoId = S::ConvoId; + type Reaction = S::Reaction; + type Rev = Set; + type Message = S::Message; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData S>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type ConvoId = S::ConvoId; + type Reaction = S::Reaction; + type Rev = S::Rev; + type Message = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `message` field - pub struct message(()); - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `convo_id` field pub struct convo_id(()); ///Marker type for the `reaction` field pub struct reaction(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `message` field + pub struct message(()); } } @@ -2112,10 +2112,10 @@ where impl<'a, S> LogAddReactionBuilder<'a, S> where S: log_add_reaction_state::State, - S::Message: log_add_reaction_state::IsSet, - S::Rev: log_add_reaction_state::IsSet, S::ConvoId: log_add_reaction_state::IsSet, S::Reaction: log_add_reaction_state::IsSet, + S::Rev: log_add_reaction_state::IsSet, + S::Message: log_add_reaction_state::IsSet, { /// Build the final struct pub fn build(self) -> LogAddReaction<'a> { @@ -2247,49 +2247,49 @@ pub mod log_create_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; type Message; + type Rev; type ConvoId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rev = Unset; type Message = Unset; + type Rev = Unset; type ConvoId = Unset; } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Rev = Set; - type Message = S::Message; - type ConvoId = S::ConvoId; - } ///State transition - sets the `message` field to Set pub struct SetMessage(PhantomData S>); impl sealed::Sealed for SetMessage {} impl State for SetMessage { - type Rev = S::Rev; type Message = Set; + type Rev = S::Rev; + type ConvoId = S::ConvoId; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Message = S::Message; + type Rev = Set; type ConvoId = S::ConvoId; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Rev = S::Rev; type Message = S::Message; + type Rev = S::Rev; type ConvoId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `message` field pub struct message(()); + ///Marker type for the `rev` field + pub struct rev(()); ///Marker type for the `convo_id` field pub struct convo_id(()); } @@ -2384,8 +2384,8 @@ where impl<'a, S> LogCreateMessageBuilder<'a, S> where S: log_create_message_state::State, - S::Rev: log_create_message_state::IsSet, S::Message: log_create_message_state::IsSet, + S::Rev: log_create_message_state::IsSet, S::ConvoId: log_create_message_state::IsSet, { /// Build the final struct @@ -2480,51 +2480,51 @@ pub mod log_delete_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Message; type Rev; type ConvoId; + type Message; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Message = Unset; type Rev = Unset; type ConvoId = Unset; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData S>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type Message = Set; - type Rev = S::Rev; - type ConvoId = S::ConvoId; + type Message = Unset; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Message = S::Message; type Rev = Set; type ConvoId = S::ConvoId; + type Message = S::Message; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Message = S::Message; type Rev = S::Rev; type ConvoId = Set; + type Message = S::Message; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData S>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Rev = S::Rev; + type ConvoId = S::ConvoId; + type Message = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `message` field - pub struct message(()); ///Marker type for the `rev` field pub struct rev(()); ///Marker type for the `convo_id` field pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); } } @@ -2617,9 +2617,9 @@ where impl<'a, S> LogDeleteMessageBuilder<'a, S> where S: log_delete_message_state::State, - S::Message: log_delete_message_state::IsSet, S::Rev: log_delete_message_state::IsSet, S::ConvoId: log_delete_message_state::IsSet, + S::Message: log_delete_message_state::IsSet, { /// Build the final struct pub fn build(self) -> LogDeleteMessage<'a> { @@ -2785,51 +2785,51 @@ pub mod log_read_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; type ConvoId; type Message; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rev = Unset; type ConvoId = Unset; type Message = Unset; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Rev = Set; - type ConvoId = S::ConvoId; - type Message = S::Message; + type Rev = Unset; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Rev = S::Rev; type ConvoId = Set; type Message = S::Message; + type Rev = S::Rev; } ///State transition - sets the `message` field to Set pub struct SetMessage(PhantomData S>); impl sealed::Sealed for SetMessage {} impl State for SetMessage { - type Rev = S::Rev; type ConvoId = S::ConvoId; type Message = Set; + type Rev = S::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type ConvoId = S::ConvoId; + type Message = S::Message; + type Rev = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `convo_id` field pub struct convo_id(()); ///Marker type for the `message` field pub struct message(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -2922,9 +2922,9 @@ where impl<'a, S> LogReadMessageBuilder<'a, S> where S: log_read_message_state::State, - S::Rev: log_read_message_state::IsSet, S::ConvoId: log_read_message_state::IsSet, S::Message: log_read_message_state::IsSet, + S::Rev: log_read_message_state::IsSet, { /// Build the final struct pub fn build(self) -> LogReadMessage<'a> { @@ -3021,66 +3021,66 @@ pub mod log_remove_reaction_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Rev; - type ConvoId; type Message; type Reaction; + type ConvoId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Rev = Unset; - type ConvoId = Unset; type Message = Unset; type Reaction = Unset; + type ConvoId = Unset; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { type Rev = Set; - type ConvoId = S::ConvoId; - type Message = S::Message; - type Reaction = S::Reaction; - } - ///State transition - sets the `convo_id` field to Set - pub struct SetConvoId(PhantomData S>); - impl sealed::Sealed for SetConvoId {} - impl State for SetConvoId { - type Rev = S::Rev; - type ConvoId = Set; type Message = S::Message; type Reaction = S::Reaction; + type ConvoId = S::ConvoId; } ///State transition - sets the `message` field to Set pub struct SetMessage(PhantomData S>); impl sealed::Sealed for SetMessage {} impl State for SetMessage { type Rev = S::Rev; - type ConvoId = S::ConvoId; type Message = Set; type Reaction = S::Reaction; + type ConvoId = S::ConvoId; } ///State transition - sets the `reaction` field to Set pub struct SetReaction(PhantomData S>); impl sealed::Sealed for SetReaction {} impl State for SetReaction { type Rev = S::Rev; - type ConvoId = S::ConvoId; type Message = S::Message; type Reaction = Set; + type ConvoId = S::ConvoId; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData S>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Rev = S::Rev; + type Message = S::Message; + type Reaction = S::Reaction; + type ConvoId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `rev` field pub struct rev(()); - ///Marker type for the `convo_id` field - pub struct convo_id(()); ///Marker type for the `message` field pub struct message(()); ///Marker type for the `reaction` field pub struct reaction(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); } } @@ -3194,9 +3194,9 @@ impl<'a, S> LogRemoveReactionBuilder<'a, S> where S: log_remove_reaction_state::State, S::Rev: log_remove_reaction_state::IsSet, - S::ConvoId: log_remove_reaction_state::IsSet, S::Message: log_remove_reaction_state::IsSet, S::Reaction: log_remove_reaction_state::IsSet, + S::ConvoId: log_remove_reaction_state::IsSet, { /// Build the final struct pub fn build(self) -> LogRemoveReaction<'a> { @@ -3326,37 +3326,37 @@ pub mod message_and_reaction_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reaction; type Message; + type Reaction; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Reaction = Unset; type Message = Unset; - } - ///State transition - sets the `reaction` field to Set - pub struct SetReaction(PhantomData S>); - impl sealed::Sealed for SetReaction {} - impl State for SetReaction { - type Reaction = Set; - type Message = S::Message; + type Reaction = Unset; } ///State transition - sets the `message` field to Set pub struct SetMessage(PhantomData S>); impl sealed::Sealed for SetMessage {} impl State for SetMessage { - type Reaction = S::Reaction; type Message = Set; + type Reaction = S::Reaction; + } + ///State transition - sets the `reaction` field to Set + pub struct SetReaction(PhantomData S>); + impl sealed::Sealed for SetReaction {} + impl State for SetReaction { + type Message = S::Message; + type Reaction = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reaction` field - pub struct reaction(()); ///Marker type for the `message` field pub struct message(()); + ///Marker type for the `reaction` field + pub struct reaction(()); } } @@ -3438,8 +3438,8 @@ where impl<'a, S> MessageAndReactionViewBuilder<'a, S> where S: message_and_reaction_view_state::State, - S::Reaction: message_and_reaction_view_state::IsSet, S::Message: message_and_reaction_view_state::IsSet, + S::Reaction: message_and_reaction_view_state::IsSet, { /// Build the final struct pub fn build(self) -> MessageAndReactionView<'a> { @@ -3585,49 +3585,49 @@ pub mod message_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type ConvoId; + type Did; type MessageId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type ConvoId = Unset; + type Did = Unset; type MessageId = Unset; } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type ConvoId = S::ConvoId; - type MessageId = S::MessageId; - } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Did = S::Did; type ConvoId = Set; + type Did = S::Did; + type MessageId = S::MessageId; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type ConvoId = S::ConvoId; + type Did = Set; type MessageId = S::MessageId; } ///State transition - sets the `message_id` field to Set pub struct SetMessageId(PhantomData S>); impl sealed::Sealed for SetMessageId {} impl State for SetMessageId { - type Did = S::Did; type ConvoId = S::ConvoId; + type Did = S::Did; type MessageId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `convo_id` field pub struct convo_id(()); + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `message_id` field pub struct message_id(()); } @@ -3722,8 +3722,8 @@ where impl<'a, S> MessageRefBuilder<'a, S> where S: message_ref_state::State, - S::Did: message_ref_state::IsSet, S::ConvoId: message_ref_state::IsSet, + S::Did: message_ref_state::IsSet, S::MessageId: message_ref_state::IsSet, { /// Build the final struct @@ -3814,84 +3814,84 @@ pub mod message_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Text; - type SentAt; type Rev; type Id; type Sender; + type SentAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Text = Unset; - type SentAt = Unset; type Rev = Unset; type Id = Unset; type Sender = Unset; + type SentAt = Unset; } ///State transition - sets the `text` field to Set pub struct SetText(PhantomData S>); impl sealed::Sealed for SetText {} impl State for SetText { type Text = Set; - type SentAt = S::SentAt; - type Rev = S::Rev; - type Id = S::Id; - type Sender = S::Sender; - } - ///State transition - sets the `sent_at` field to Set - pub struct SetSentAt(PhantomData S>); - impl sealed::Sealed for SetSentAt {} - impl State for SetSentAt { - type Text = S::Text; - type SentAt = Set; type Rev = S::Rev; type Id = S::Id; type Sender = S::Sender; + type SentAt = S::SentAt; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { type Text = S::Text; - type SentAt = S::SentAt; type Rev = Set; type Id = S::Id; type Sender = S::Sender; + type SentAt = S::SentAt; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { type Text = S::Text; - type SentAt = S::SentAt; type Rev = S::Rev; type Id = Set; type Sender = S::Sender; + type SentAt = S::SentAt; } ///State transition - sets the `sender` field to Set pub struct SetSender(PhantomData S>); impl sealed::Sealed for SetSender {} impl State for SetSender { type Text = S::Text; - type SentAt = S::SentAt; type Rev = S::Rev; type Id = S::Id; type Sender = Set; + type SentAt = S::SentAt; + } + ///State transition - sets the `sent_at` field to Set + pub struct SetSentAt(PhantomData S>); + impl sealed::Sealed for SetSentAt {} + impl State for SetSentAt { + type Text = S::Text; + type Rev = S::Rev; + type Id = S::Id; + type Sender = S::Sender; + type SentAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `text` field pub struct text(()); - ///Marker type for the `sent_at` field - pub struct sent_at(()); ///Marker type for the `rev` field pub struct rev(()); ///Marker type for the `id` field pub struct id(()); ///Marker type for the `sender` field pub struct sender(()); + ///Marker type for the `sent_at` field + pub struct sent_at(()); } } @@ -4085,10 +4085,10 @@ impl<'a, S> MessageViewBuilder<'a, S> where S: message_view_state::State, S::Text: message_view_state::IsSet, - S::SentAt: message_view_state::IsSet, S::Rev: message_view_state::IsSet, S::Id: message_view_state::IsSet, S::Sender: message_view_state::IsSet, + S::SentAt: message_view_state::IsSet, { /// Build the final struct pub fn build(self) -> MessageView<'a> { @@ -4342,51 +4342,51 @@ pub mod reaction_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; - type Sender; type Value; + type Sender; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; - type Sender = Unset; type Value = Unset; + type Sender = Unset; + type CreatedAt = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Value = Set; type Sender = S::Sender; - type Value = S::Value; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `sender` field to Set pub struct SetSender(PhantomData S>); impl sealed::Sealed for SetSender {} impl State for SetSender { - type CreatedAt = S::CreatedAt; - type Sender = Set; type Value = S::Value; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { + type Sender = Set; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Value = S::Value; type Sender = S::Sender; - type Value = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `sender` field - pub struct sender(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `sender` field + pub struct sender(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -4479,9 +4479,9 @@ where impl<'a, S> ReactionViewBuilder<'a, S> where S: reaction_view_state::State, - S::CreatedAt: reaction_view_state::IsSet, - S::Sender: reaction_view_state::IsSet, S::Value: reaction_view_state::IsSet, + S::Sender: reaction_view_state::IsSet, + S::CreatedAt: reaction_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ReactionView<'a> { diff --git a/crates/weaver-api/src/chat_bsky/convo/send_message.rs b/crates/weaver-api/src/chat_bsky/convo/send_message.rs index a6b37be..5950b13 100644 --- a/crates/weaver-api/src/chat_bsky/convo/send_message.rs +++ b/crates/weaver-api/src/chat_bsky/convo/send_message.rs @@ -33,37 +33,37 @@ pub mod send_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Message; type ConvoId; + type Message; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Message = Unset; type ConvoId = Unset; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData S>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type Message = Set; - type ConvoId = S::ConvoId; + type Message = Unset; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Message = S::Message; type ConvoId = Set; + type Message = S::Message; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData S>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type ConvoId = S::ConvoId; + type Message = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `message` field - pub struct message(()); ///Marker type for the `convo_id` field pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> SendMessageBuilder<'a, S> where S: send_message_state::State, - S::Message: send_message_state::IsSet, S::ConvoId: send_message_state::IsSet, + S::Message: send_message_state::IsSet, { /// Build the final struct pub fn build(self) -> SendMessage<'a> { diff --git a/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs b/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs index 5199531..c8d52e9 100644 --- a/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs +++ b/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs @@ -186,66 +186,66 @@ pub mod metadata_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type MessagesReceived; + type ConvosStarted; type MessagesSent; type Convos; - type ConvosStarted; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type MessagesReceived = Unset; + type ConvosStarted = Unset; type MessagesSent = Unset; type Convos = Unset; - type ConvosStarted = Unset; } ///State transition - sets the `messages_received` field to Set pub struct SetMessagesReceived(PhantomData S>); impl sealed::Sealed for SetMessagesReceived {} impl State for SetMessagesReceived { type MessagesReceived = Set; + type ConvosStarted = S::ConvosStarted; + type MessagesSent = S::MessagesSent; + type Convos = S::Convos; + } + ///State transition - sets the `convos_started` field to Set + pub struct SetConvosStarted(PhantomData S>); + impl sealed::Sealed for SetConvosStarted {} + impl State for SetConvosStarted { + type MessagesReceived = S::MessagesReceived; + type ConvosStarted = Set; type MessagesSent = S::MessagesSent; type Convos = S::Convos; - type ConvosStarted = S::ConvosStarted; } ///State transition - sets the `messages_sent` field to Set pub struct SetMessagesSent(PhantomData S>); impl sealed::Sealed for SetMessagesSent {} impl State for SetMessagesSent { type MessagesReceived = S::MessagesReceived; + type ConvosStarted = S::ConvosStarted; type MessagesSent = Set; type Convos = S::Convos; - type ConvosStarted = S::ConvosStarted; } ///State transition - sets the `convos` field to Set pub struct SetConvos(PhantomData S>); impl sealed::Sealed for SetConvos {} impl State for SetConvos { type MessagesReceived = S::MessagesReceived; - type MessagesSent = S::MessagesSent; - type Convos = Set; type ConvosStarted = S::ConvosStarted; - } - ///State transition - sets the `convos_started` field to Set - pub struct SetConvosStarted(PhantomData S>); - impl sealed::Sealed for SetConvosStarted {} - impl State for SetConvosStarted { - type MessagesReceived = S::MessagesReceived; type MessagesSent = S::MessagesSent; - type Convos = S::Convos; - type ConvosStarted = Set; + type Convos = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `messages_received` field pub struct messages_received(()); + ///Marker type for the `convos_started` field + pub struct convos_started(()); ///Marker type for the `messages_sent` field pub struct messages_sent(()); ///Marker type for the `convos` field pub struct convos(()); - ///Marker type for the `convos_started` field - pub struct convos_started(()); } } @@ -359,9 +359,9 @@ impl<'a, S> MetadataBuilder<'a, S> where S: metadata_state::State, S::MessagesReceived: metadata_state::IsSet, + S::ConvosStarted: metadata_state::IsSet, S::MessagesSent: metadata_state::IsSet, S::Convos: metadata_state::IsSet, - S::ConvosStarted: metadata_state::IsSet, { /// Build the final struct pub fn build(self) -> Metadata<'a> { diff --git a/crates/weaver-api/src/chat_bsky/moderation/update_actor_access.rs b/crates/weaver-api/src/chat_bsky/moderation/update_actor_access.rs index ebdd92b..b93c5d1 100644 --- a/crates/weaver-api/src/chat_bsky/moderation/update_actor_access.rs +++ b/crates/weaver-api/src/chat_bsky/moderation/update_actor_access.rs @@ -35,37 +35,37 @@ pub mod update_actor_access_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Actor; type AllowAccess; + type Actor; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Actor = Unset; type AllowAccess = Unset; - } - ///State transition - sets the `actor` field to Set - pub struct SetActor(PhantomData S>); - impl sealed::Sealed for SetActor {} - impl State for SetActor { - type Actor = Set; - type AllowAccess = S::AllowAccess; + type Actor = Unset; } ///State transition - sets the `allow_access` field to Set pub struct SetAllowAccess(PhantomData S>); impl sealed::Sealed for SetAllowAccess {} impl State for SetAllowAccess { - type Actor = S::Actor; type AllowAccess = Set; + type Actor = S::Actor; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type AllowAccess = S::AllowAccess; + type Actor = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `actor` field - pub struct actor(()); ///Marker type for the `allow_access` field pub struct allow_access(()); + ///Marker type for the `actor` field + pub struct actor(()); } } @@ -155,8 +155,8 @@ impl<'a, S: update_actor_access_state::State> UpdateActorAccessBuilder<'a, S> { impl<'a, S> UpdateActorAccessBuilder<'a, S> where S: update_actor_access_state::State, - S::Actor: update_actor_access_state::IsSet, S::AllowAccess: update_actor_access_state::IsSet, + S::Actor: update_actor_access_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateActorAccess<'a> { diff --git a/crates/weaver-api/src/com_atproto/admin/send_email.rs b/crates/weaver-api/src/com_atproto/admin/send_email.rs index 47b3dfe..6a048cf 100644 --- a/crates/weaver-api/src/com_atproto/admin/send_email.rs +++ b/crates/weaver-api/src/com_atproto/admin/send_email.rs @@ -43,50 +43,50 @@ pub mod send_email_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type RecipientDid; - type Content; type SenderDid; + type Content; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type RecipientDid = Unset; - type Content = Unset; type SenderDid = Unset; + type Content = Unset; } ///State transition - sets the `recipient_did` field to Set pub struct SetRecipientDid(PhantomData S>); impl sealed::Sealed for SetRecipientDid {} impl State for SetRecipientDid { type RecipientDid = Set; - type Content = S::Content; - type SenderDid = S::SenderDid; - } - ///State transition - sets the `content` field to Set - pub struct SetContent(PhantomData S>); - impl sealed::Sealed for SetContent {} - impl State for SetContent { - type RecipientDid = S::RecipientDid; - type Content = Set; type SenderDid = S::SenderDid; + type Content = S::Content; } ///State transition - sets the `sender_did` field to Set pub struct SetSenderDid(PhantomData S>); impl sealed::Sealed for SetSenderDid {} impl State for SetSenderDid { type RecipientDid = S::RecipientDid; - type Content = S::Content; type SenderDid = Set; + type Content = S::Content; + } + ///State transition - sets the `content` field to Set + pub struct SetContent(PhantomData S>); + impl sealed::Sealed for SetContent {} + impl State for SetContent { + type RecipientDid = S::RecipientDid; + type SenderDid = S::SenderDid; + type Content = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `recipient_did` field pub struct recipient_did(()); - ///Marker type for the `content` field - pub struct content(()); ///Marker type for the `sender_did` field pub struct sender_did(()); + ///Marker type for the `content` field + pub struct content(()); } } @@ -214,8 +214,8 @@ impl<'a, S> SendEmailBuilder<'a, S> where S: send_email_state::State, S::RecipientDid: send_email_state::IsSet, - S::Content: send_email_state::IsSet, S::SenderDid: send_email_state::IsSet, + S::Content: send_email_state::IsSet, { /// Build the final struct pub fn build(self) -> SendEmail<'a> { diff --git a/crates/weaver-api/src/com_atproto/admin/update_account_email.rs b/crates/weaver-api/src/com_atproto/admin/update_account_email.rs index 24aebdc..cf27c63 100644 --- a/crates/weaver-api/src/com_atproto/admin/update_account_email.rs +++ b/crates/weaver-api/src/com_atproto/admin/update_account_email.rs @@ -34,37 +34,37 @@ pub mod update_account_email_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Email; type Account; + type Email; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Email = Unset; type Account = Unset; - } - ///State transition - sets the `email` field to Set - pub struct SetEmail(PhantomData S>); - impl sealed::Sealed for SetEmail {} - impl State for SetEmail { - type Email = Set; - type Account = S::Account; + type Email = Unset; } ///State transition - sets the `account` field to Set pub struct SetAccount(PhantomData S>); impl sealed::Sealed for SetAccount {} impl State for SetAccount { - type Email = S::Email; type Account = Set; + type Email = S::Email; + } + ///State transition - sets the `email` field to Set + pub struct SetEmail(PhantomData S>); + impl sealed::Sealed for SetEmail {} + impl State for SetEmail { + type Account = S::Account; + type Email = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `email` field - pub struct email(()); ///Marker type for the `account` field pub struct account(()); + ///Marker type for the `email` field + pub struct email(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> UpdateAccountEmailBuilder<'a, S> where S: update_account_email_state::State, - S::Email: update_account_email_state::IsSet, S::Account: update_account_email_state::IsSet, + S::Email: update_account_email_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateAccountEmail<'a> { diff --git a/crates/weaver-api/src/com_atproto/admin/update_account_handle.rs b/crates/weaver-api/src/com_atproto/admin/update_account_handle.rs index 021ff61..edb8971 100644 --- a/crates/weaver-api/src/com_atproto/admin/update_account_handle.rs +++ b/crates/weaver-api/src/com_atproto/admin/update_account_handle.rs @@ -33,37 +33,37 @@ pub mod update_account_handle_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Handle; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Handle = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Handle = S::Handle; + type Did = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Did = S::Did; type Handle = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = S::Handle; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> UpdateAccountHandleBuilder<'a, S> where S: update_account_handle_state::State, - S::Did: update_account_handle_state::IsSet, S::Handle: update_account_handle_state::IsSet, + S::Did: update_account_handle_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateAccountHandle<'a> { diff --git a/crates/weaver-api/src/com_atproto/identity.rs b/crates/weaver-api/src/com_atproto/identity.rs index ef51b79..9e1f260 100644 --- a/crates/weaver-api/src/com_atproto/identity.rs +++ b/crates/weaver-api/src/com_atproto/identity.rs @@ -47,51 +47,51 @@ pub mod identity_info_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; - type DidDoc; type Handle; + type DidDoc; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; - type DidDoc = Unset; type Handle = Unset; + type DidDoc = Unset; + type Did = Unset; } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Handle = Set; type DidDoc = S::DidDoc; - type Handle = S::Handle; + type Did = S::Did; } ///State transition - sets the `did_doc` field to Set pub struct SetDidDoc(PhantomData S>); impl sealed::Sealed for SetDidDoc {} impl State for SetDidDoc { - type Did = S::Did; - type DidDoc = Set; type Handle = S::Handle; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { + type DidDoc = Set; type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = S::Handle; type DidDoc = S::DidDoc; - type Handle = Set; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); - ///Marker type for the `did_doc` field - pub struct did_doc(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `did_doc` field + pub struct did_doc(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -184,9 +184,9 @@ where impl<'a, S> IdentityInfoBuilder<'a, S> where S: identity_info_state::State, - S::Did: identity_info_state::IsSet, - S::DidDoc: identity_info_state::IsSet, S::Handle: identity_info_state::IsSet, + S::DidDoc: identity_info_state::IsSet, + S::Did: identity_info_state::IsSet, { /// Build the final struct pub fn build(self) -> IdentityInfo<'a> { diff --git a/crates/weaver-api/src/com_atproto/label.rs b/crates/weaver-api/src/com_atproto/label.rs index 6790ce0..745b5f8 100644 --- a/crates/weaver-api/src/com_atproto/label.rs +++ b/crates/weaver-api/src/com_atproto/label.rs @@ -63,67 +63,67 @@ pub mod label_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Val; type Cts; - type Uri; type Src; + type Uri; + type Val; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Val = Unset; type Cts = Unset; - type Uri = Unset; type Src = Unset; - } - ///State transition - sets the `val` field to Set - pub struct SetVal(PhantomData S>); - impl sealed::Sealed for SetVal {} - impl State for SetVal { - type Val = Set; - type Cts = S::Cts; - type Uri = S::Uri; - type Src = S::Src; + type Uri = Unset; + type Val = Unset; } ///State transition - sets the `cts` field to Set pub struct SetCts(PhantomData S>); impl sealed::Sealed for SetCts {} impl State for SetCts { - type Val = S::Val; type Cts = Set; - type Uri = S::Uri; type Src = S::Src; + type Uri = S::Uri; + type Val = S::Val; + } + ///State transition - sets the `src` field to Set + pub struct SetSrc(PhantomData S>); + impl sealed::Sealed for SetSrc {} + impl State for SetSrc { + type Cts = S::Cts; + type Src = Set; + type Uri = S::Uri; + type Val = S::Val; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Val = S::Val; type Cts = S::Cts; - type Uri = Set; type Src = S::Src; - } - ///State transition - sets the `src` field to Set - pub struct SetSrc(PhantomData S>); - impl sealed::Sealed for SetSrc {} - impl State for SetSrc { + type Uri = Set; type Val = S::Val; + } + ///State transition - sets the `val` field to Set + pub struct SetVal(PhantomData S>); + impl sealed::Sealed for SetVal {} + impl State for SetVal { type Cts = S::Cts; + type Src = S::Src; type Uri = S::Uri; - type Src = Set; + type Val = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `val` field - pub struct val(()); ///Marker type for the `cts` field pub struct cts(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `src` field pub struct src(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `val` field + pub struct val(()); } } @@ -328,10 +328,10 @@ impl<'a, S: label_state::State> LabelBuilder<'a, S> { impl<'a, S> LabelBuilder<'a, S> where S: label_state::State, - S::Val: label_state::IsSet, S::Cts: label_state::IsSet, - S::Uri: label_state::IsSet, S::Src: label_state::IsSet, + S::Uri: label_state::IsSet, + S::Val: label_state::IsSet, { /// Build the final struct pub fn build(self) -> Label<'a> { @@ -1053,67 +1053,67 @@ pub mod label_value_definition_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Severity; - type Locales; type Identifier; + type Severity; type Blurs; + type Locales; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Severity = Unset; - type Locales = Unset; type Identifier = Unset; + type Severity = Unset; type Blurs = Unset; - } - ///State transition - sets the `severity` field to Set - pub struct SetSeverity(PhantomData S>); - impl sealed::Sealed for SetSeverity {} - impl State for SetSeverity { - type Severity = Set; - type Locales = S::Locales; - type Identifier = S::Identifier; - type Blurs = S::Blurs; - } - ///State transition - sets the `locales` field to Set - pub struct SetLocales(PhantomData S>); - impl sealed::Sealed for SetLocales {} - impl State for SetLocales { - type Severity = S::Severity; - type Locales = Set; - type Identifier = S::Identifier; - type Blurs = S::Blurs; + type Locales = Unset; } ///State transition - sets the `identifier` field to Set pub struct SetIdentifier(PhantomData S>); impl sealed::Sealed for SetIdentifier {} impl State for SetIdentifier { + type Identifier = Set; type Severity = S::Severity; + type Blurs = S::Blurs; type Locales = S::Locales; - type Identifier = Set; + } + ///State transition - sets the `severity` field to Set + pub struct SetSeverity(PhantomData S>); + impl sealed::Sealed for SetSeverity {} + impl State for SetSeverity { + type Identifier = S::Identifier; + type Severity = Set; type Blurs = S::Blurs; + type Locales = S::Locales; } ///State transition - sets the `blurs` field to Set pub struct SetBlurs(PhantomData S>); impl sealed::Sealed for SetBlurs {} impl State for SetBlurs { + type Identifier = S::Identifier; type Severity = S::Severity; + type Blurs = Set; type Locales = S::Locales; + } + ///State transition - sets the `locales` field to Set + pub struct SetLocales(PhantomData S>); + impl sealed::Sealed for SetLocales {} + impl State for SetLocales { type Identifier = S::Identifier; - type Blurs = Set; + type Severity = S::Severity; + type Blurs = S::Blurs; + type Locales = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `severity` field - pub struct severity(()); - ///Marker type for the `locales` field - pub struct locales(()); ///Marker type for the `identifier` field pub struct identifier(()); + ///Marker type for the `severity` field + pub struct severity(()); ///Marker type for the `blurs` field pub struct blurs(()); + ///Marker type for the `locales` field + pub struct locales(()); } } @@ -1268,10 +1268,10 @@ where impl<'a, S> LabelValueDefinitionBuilder<'a, S> where S: label_value_definition_state::State, - S::Severity: label_value_definition_state::IsSet, - S::Locales: label_value_definition_state::IsSet, S::Identifier: label_value_definition_state::IsSet, + S::Severity: label_value_definition_state::IsSet, S::Blurs: label_value_definition_state::IsSet, + S::Locales: label_value_definition_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelValueDefinition<'a> { @@ -1387,51 +1387,51 @@ pub mod label_value_definition_strings_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Lang; type Name; type Description; - type Lang; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Lang = Unset; type Name = Unset; type Description = Unset; - type Lang = Unset; + } + ///State transition - sets the `lang` field to Set + pub struct SetLang(PhantomData S>); + impl sealed::Sealed for SetLang {} + impl State for SetLang { + type Lang = Set; + type Name = S::Name; + type Description = S::Description; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { + type Lang = S::Lang; type Name = Set; type Description = S::Description; - type Lang = S::Lang; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData S>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { - type Name = S::Name; - type Description = Set; type Lang = S::Lang; - } - ///State transition - sets the `lang` field to Set - pub struct SetLang(PhantomData S>); - impl sealed::Sealed for SetLang {} - impl State for SetLang { type Name = S::Name; - type Description = S::Description; - type Lang = Set; + type Description = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `lang` field + pub struct lang(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `description` field pub struct description(()); - ///Marker type for the `lang` field - pub struct lang(()); } } @@ -1541,9 +1541,9 @@ where impl<'a, S> LabelValueDefinitionStringsBuilder<'a, S> where S: label_value_definition_strings_state::State, + S::Lang: label_value_definition_strings_state::IsSet, S::Name: label_value_definition_strings_state::IsSet, S::Description: label_value_definition_strings_state::IsSet, - S::Lang: label_value_definition_strings_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelValueDefinitionStrings<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo.rs b/crates/weaver-api/src/com_atproto/repo.rs index fe41eba..c4326dc 100644 --- a/crates/weaver-api/src/com_atproto/repo.rs +++ b/crates/weaver-api/src/com_atproto/repo.rs @@ -44,37 +44,37 @@ pub mod commit_meta_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; type Cid; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rev = Unset; type Cid = Unset; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Rev = Set; - type Cid = S::Cid; + type Rev = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Rev = S::Rev; type Cid = Set; + type Rev = S::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Cid = S::Cid; + type Rev = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -147,8 +147,8 @@ where impl<'a, S> CommitMetaBuilder<'a, S> where S: commit_meta_state::State, - S::Rev: commit_meta_state::IsSet, S::Cid: commit_meta_state::IsSet, + S::Rev: commit_meta_state::IsSet, { /// Build the final struct pub fn build(self) -> CommitMeta<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/apply_writes.rs b/crates/weaver-api/src/com_atproto/repo/apply_writes.rs index a21d55a..d69bda4 100644 --- a/crates/weaver-api/src/com_atproto/repo/apply_writes.rs +++ b/crates/weaver-api/src/com_atproto/repo/apply_writes.rs @@ -728,37 +728,37 @@ pub mod create_result_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Cid; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Cid = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Cid = S::Cid; + type Uri = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Uri = S::Uri; type Cid = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Cid = S::Cid; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -851,8 +851,8 @@ impl<'a, S: create_result_state::State> CreateResultBuilder<'a, S> { impl<'a, S> CreateResultBuilder<'a, S> where S: create_result_state::State, - S::Uri: create_result_state::IsSet, S::Cid: create_result_state::IsSet, + S::Uri: create_result_state::IsSet, { /// Build the final struct pub fn build(self) -> CreateResult<'a> { @@ -1476,51 +1476,51 @@ pub mod update_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Value; type Collection; type Rkey; - type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Value = Unset; type Collection = Unset; type Rkey = Unset; - type Value = Unset; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Value = Set; + type Collection = S::Collection; + type Rkey = S::Rkey; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { + type Value = S::Value; type Collection = Set; type Rkey = S::Rkey; - type Value = S::Value; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Collection = S::Collection; - type Rkey = Set; type Value = S::Value; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { type Collection = S::Collection; - type Rkey = S::Rkey; - type Value = Set; + type Rkey = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `collection` field pub struct collection(()); ///Marker type for the `rkey` field pub struct rkey(()); - ///Marker type for the `value` field - pub struct value(()); } } @@ -1621,9 +1621,9 @@ where impl<'a, S> UpdateBuilder<'a, S> where S: update_state::State, + S::Value: update_state::IsSet, S::Collection: update_state::IsSet, S::Rkey: update_state::IsSet, - S::Value: update_state::IsSet, { /// Build the final struct pub fn build(self) -> Update<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/create_record.rs b/crates/weaver-api/src/com_atproto/repo/create_record.rs index 5382176..6e91b26 100644 --- a/crates/weaver-api/src/com_atproto/repo/create_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/create_record.rs @@ -53,51 +53,51 @@ pub mod create_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; - type Collection; type Repo; + type Collection; + type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Record = Unset; - type Collection = Unset; type Repo = Unset; + type Collection = Unset; + type Record = Unset; } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Record = Set; + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Repo = Set; type Collection = S::Collection; - type Repo = S::Repo; + type Record = S::Record; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { - type Record = S::Record; - type Collection = Set; type Repo = S::Repo; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { + type Collection = Set; type Record = S::Record; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Repo = S::Repo; type Collection = S::Collection; - type Repo = Set; + type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `collection` field - pub struct collection(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `collection` field + pub struct collection(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -258,9 +258,9 @@ impl<'a, S: create_record_state::State> CreateRecordBuilder<'a, S> { impl<'a, S> CreateRecordBuilder<'a, S> where S: create_record_state::State, - S::Record: create_record_state::IsSet, - S::Collection: create_record_state::IsSet, S::Repo: create_record_state::IsSet, + S::Collection: create_record_state::IsSet, + S::Record: create_record_state::IsSet, { /// Build the final struct pub fn build(self) -> CreateRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/delete_record.rs b/crates/weaver-api/src/com_atproto/repo/delete_record.rs index dfad98a..dcd1553 100644 --- a/crates/weaver-api/src/com_atproto/repo/delete_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/delete_record.rs @@ -48,51 +48,51 @@ pub mod delete_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Collection; - type Rkey; type Repo; + type Rkey; + type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Collection = Unset; - type Rkey = Unset; type Repo = Unset; + type Rkey = Unset; + type Collection = Unset; } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData S>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { - type Collection = Set; + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Repo = Set; type Rkey = S::Rkey; - type Repo = S::Repo; + type Collection = S::Collection; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Collection = S::Collection; - type Rkey = Set; type Repo = S::Repo; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { + type Rkey = Set; type Collection = S::Collection; + } + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData S>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Repo = S::Repo; type Rkey = S::Rkey; - type Repo = Set; + type Collection = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `collection` field - pub struct collection(()); - ///Marker type for the `rkey` field - pub struct rkey(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `rkey` field + pub struct rkey(()); + ///Marker type for the `collection` field + pub struct collection(()); } } @@ -233,9 +233,9 @@ impl<'a, S: delete_record_state::State> DeleteRecordBuilder<'a, S> { impl<'a, S> DeleteRecordBuilder<'a, S> where S: delete_record_state::State, - S::Collection: delete_record_state::IsSet, - S::Rkey: delete_record_state::IsSet, S::Repo: delete_record_state::IsSet, + S::Rkey: delete_record_state::IsSet, + S::Collection: delete_record_state::IsSet, { /// Build the final struct pub fn build(self) -> DeleteRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/get_record.rs b/crates/weaver-api/src/com_atproto/repo/get_record.rs index a6e7059..7cc233f 100644 --- a/crates/weaver-api/src/com_atproto/repo/get_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/get_record.rs @@ -39,51 +39,51 @@ pub mod get_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rkey; type Collection; type Repo; + type Rkey; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rkey = Unset; type Collection = Unset; type Repo = Unset; - } - ///State transition - sets the `rkey` field to Set - pub struct SetRkey(PhantomData S>); - impl sealed::Sealed for SetRkey {} - impl State for SetRkey { - type Rkey = Set; - type Collection = S::Collection; - type Repo = S::Repo; + type Rkey = Unset; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { - type Rkey = S::Rkey; type Collection = Set; type Repo = S::Repo; + type Rkey = S::Rkey; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Rkey = S::Rkey; type Collection = S::Collection; type Repo = Set; + type Rkey = S::Rkey; + } + ///State transition - sets the `rkey` field to Set + pub struct SetRkey(PhantomData S>); + impl sealed::Sealed for SetRkey {} + impl State for SetRkey { + type Collection = S::Collection; + type Repo = S::Repo; + type Rkey = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rkey` field - pub struct rkey(()); ///Marker type for the `collection` field pub struct collection(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `rkey` field + pub struct rkey(()); } } @@ -204,9 +204,9 @@ where impl<'a, S> GetRecordBuilder<'a, S> where S: get_record_state::State, - S::Rkey: get_record_state::IsSet, S::Collection: get_record_state::IsSet, S::Repo: get_record_state::IsSet, + S::Rkey: get_record_state::IsSet, { /// Build the final struct pub fn build(self) -> GetRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/list_records.rs b/crates/weaver-api/src/com_atproto/repo/list_records.rs index 664a243..16572ca 100644 --- a/crates/weaver-api/src/com_atproto/repo/list_records.rs +++ b/crates/weaver-api/src/com_atproto/repo/list_records.rs @@ -278,51 +278,51 @@ pub mod record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Value; type Cid; type Uri; + type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Value = Unset; type Cid = Unset; type Uri = Unset; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type Value = Set; - type Cid = S::Cid; - type Uri = S::Uri; + type Value = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Value = S::Value; type Cid = Set; type Uri = S::Uri; + type Value = S::Value; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Value = S::Value; type Cid = S::Cid; type Uri = Set; + type Value = S::Value; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Cid = S::Cid; + type Uri = S::Uri; + type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `value` field - pub struct value(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `value` field + pub struct value(()); } } @@ -415,9 +415,9 @@ where impl<'a, S> RecordBuilder<'a, S> where S: record_state::State, - S::Value: record_state::IsSet, S::Cid: record_state::IsSet, S::Uri: record_state::IsSet, + S::Value: record_state::IsSet, { /// Build the final struct pub fn build(self) -> Record<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/put_record.rs b/crates/weaver-api/src/com_atproto/repo/put_record.rs index 5da28ae..33fd008 100644 --- a/crates/weaver-api/src/com_atproto/repo/put_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/put_record.rs @@ -55,66 +55,66 @@ pub mod put_record_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Collection; + type Rkey; type Repo; type Record; - type Rkey; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Collection = Unset; + type Rkey = Unset; type Repo = Unset; type Record = Unset; - type Rkey = Unset; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { type Collection = Set; + type Rkey = S::Rkey; + type Repo = S::Repo; + type Record = S::Record; + } + ///State transition - sets the `rkey` field to Set + pub struct SetRkey(PhantomData S>); + impl sealed::Sealed for SetRkey {} + impl State for SetRkey { + type Collection = S::Collection; + type Rkey = Set; type Repo = S::Repo; type Record = S::Record; - type Rkey = S::Rkey; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { type Collection = S::Collection; + type Rkey = S::Rkey; type Repo = Set; type Record = S::Record; - type Rkey = S::Rkey; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Collection = S::Collection; - type Repo = S::Repo; - type Record = Set; type Rkey = S::Rkey; - } - ///State transition - sets the `rkey` field to Set - pub struct SetRkey(PhantomData S>); - impl sealed::Sealed for SetRkey {} - impl State for SetRkey { - type Collection = S::Collection; type Repo = S::Repo; - type Record = S::Record; - type Rkey = Set; + type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `collection` field pub struct collection(()); + ///Marker type for the `rkey` field + pub struct rkey(()); ///Marker type for the `repo` field pub struct repo(()); ///Marker type for the `record` field pub struct record(()); - ///Marker type for the `rkey` field - pub struct rkey(()); } } @@ -290,9 +290,9 @@ impl<'a, S> PutRecordBuilder<'a, S> where S: put_record_state::State, S::Collection: put_record_state::IsSet, + S::Rkey: put_record_state::IsSet, S::Repo: put_record_state::IsSet, S::Record: put_record_state::IsSet, - S::Rkey: put_record_state::IsSet, { /// Build the final struct pub fn build(self) -> PutRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/strong_ref.rs b/crates/weaver-api/src/com_atproto/repo/strong_ref.rs index dc0555c..9a034c1 100644 --- a/crates/weaver-api/src/com_atproto/repo/strong_ref.rs +++ b/crates/weaver-api/src/com_atproto/repo/strong_ref.rs @@ -33,37 +33,37 @@ pub mod strong_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Cid; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Cid = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Cid = S::Cid; + type Uri = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Uri = S::Uri; type Cid = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Cid = S::Cid; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> StrongRefBuilder<'a, S> where S: strong_ref_state::State, - S::Uri: strong_ref_state::IsSet, S::Cid: strong_ref_state::IsSet, + S::Uri: strong_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> StrongRef<'a> { diff --git a/crates/weaver-api/src/com_atproto/server.rs b/crates/weaver-api/src/com_atproto/server.rs index f8c1f1c..8e0a1ff 100644 --- a/crates/weaver-api/src/com_atproto/server.rs +++ b/crates/weaver-api/src/com_atproto/server.rs @@ -66,127 +66,127 @@ pub mod invite_code_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uses; - type Available; + type CreatedAt; type ForAccount; - type Code; + type Uses; type CreatedBy; - type CreatedAt; type Disabled; + type Available; + type Code; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uses = Unset; - type Available = Unset; + type CreatedAt = Unset; type ForAccount = Unset; - type Code = Unset; + type Uses = Unset; type CreatedBy = Unset; - type CreatedAt = Unset; type Disabled = Unset; + type Available = Unset; + type Code = Unset; } - ///State transition - sets the `uses` field to Set - pub struct SetUses(PhantomData S>); - impl sealed::Sealed for SetUses {} - impl State for SetUses { - type Uses = Set; - type Available = S::Available; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; type ForAccount = S::ForAccount; - type Code = S::Code; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Disabled = S::Disabled; - } - ///State transition - sets the `available` field to Set - pub struct SetAvailable(PhantomData S>); - impl sealed::Sealed for SetAvailable {} - impl State for SetAvailable { type Uses = S::Uses; - type Available = Set; - type ForAccount = S::ForAccount; - type Code = S::Code; type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; type Disabled = S::Disabled; + type Available = S::Available; + type Code = S::Code; } ///State transition - sets the `for_account` field to Set pub struct SetForAccount(PhantomData S>); impl sealed::Sealed for SetForAccount {} impl State for SetForAccount { - type Uses = S::Uses; - type Available = S::Available; + type CreatedAt = S::CreatedAt; type ForAccount = Set; - type Code = S::Code; + type Uses = S::Uses; type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; type Disabled = S::Disabled; - } - ///State transition - sets the `code` field to Set - pub struct SetCode(PhantomData S>); - impl sealed::Sealed for SetCode {} - impl State for SetCode { - type Uses = S::Uses; type Available = S::Available; + type Code = S::Code; + } + ///State transition - sets the `uses` field to Set + pub struct SetUses(PhantomData S>); + impl sealed::Sealed for SetUses {} + impl State for SetUses { + type CreatedAt = S::CreatedAt; type ForAccount = S::ForAccount; - type Code = Set; + type Uses = Set; type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; type Disabled = S::Disabled; + type Available = S::Available; + type Code = S::Code; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type Uses = S::Uses; - type Available = S::Available; + type CreatedAt = S::CreatedAt; type ForAccount = S::ForAccount; - type Code = S::Code; + type Uses = S::Uses; type CreatedBy = Set; - type CreatedAt = S::CreatedAt; type Disabled = S::Disabled; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Uses = S::Uses; type Available = S::Available; - type ForAccount = S::ForAccount; type Code = S::Code; - type CreatedBy = S::CreatedBy; - type CreatedAt = Set; - type Disabled = S::Disabled; } ///State transition - sets the `disabled` field to Set pub struct SetDisabled(PhantomData S>); impl sealed::Sealed for SetDisabled {} impl State for SetDisabled { + type CreatedAt = S::CreatedAt; + type ForAccount = S::ForAccount; type Uses = S::Uses; + type CreatedBy = S::CreatedBy; + type Disabled = Set; type Available = S::Available; - type ForAccount = S::ForAccount; type Code = S::Code; + } + ///State transition - sets the `available` field to Set + pub struct SetAvailable(PhantomData S>); + impl sealed::Sealed for SetAvailable {} + impl State for SetAvailable { + type CreatedAt = S::CreatedAt; + type ForAccount = S::ForAccount; + type Uses = S::Uses; type CreatedBy = S::CreatedBy; + type Disabled = S::Disabled; + type Available = Set; + type Code = S::Code; + } + ///State transition - sets the `code` field to Set + pub struct SetCode(PhantomData S>); + impl sealed::Sealed for SetCode {} + impl State for SetCode { type CreatedAt = S::CreatedAt; - type Disabled = Set; + type ForAccount = S::ForAccount; + type Uses = S::Uses; + type CreatedBy = S::CreatedBy; + type Disabled = S::Disabled; + type Available = S::Available; + type Code = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uses` field - pub struct uses(()); - ///Marker type for the `available` field - pub struct available(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `for_account` field pub struct for_account(()); - ///Marker type for the `code` field - pub struct code(()); + ///Marker type for the `uses` field + pub struct uses(()); ///Marker type for the `created_by` field pub struct created_by(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `disabled` field pub struct disabled(()); + ///Marker type for the `available` field + pub struct available(()); + ///Marker type for the `code` field + pub struct code(()); } } @@ -359,13 +359,13 @@ where impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, - S::Uses: invite_code_state::IsSet, - S::Available: invite_code_state::IsSet, + S::CreatedAt: invite_code_state::IsSet, S::ForAccount: invite_code_state::IsSet, - S::Code: invite_code_state::IsSet, + S::Uses: invite_code_state::IsSet, S::CreatedBy: invite_code_state::IsSet, - S::CreatedAt: invite_code_state::IsSet, S::Disabled: invite_code_state::IsSet, + S::Available: invite_code_state::IsSet, + S::Code: invite_code_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteCode<'a> { @@ -638,37 +638,37 @@ pub mod invite_code_use_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type UsedAt; type UsedBy; + type UsedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type UsedAt = Unset; type UsedBy = Unset; - } - ///State transition - sets the `used_at` field to Set - pub struct SetUsedAt(PhantomData S>); - impl sealed::Sealed for SetUsedAt {} - impl State for SetUsedAt { - type UsedAt = Set; - type UsedBy = S::UsedBy; + type UsedAt = Unset; } ///State transition - sets the `used_by` field to Set pub struct SetUsedBy(PhantomData S>); impl sealed::Sealed for SetUsedBy {} impl State for SetUsedBy { - type UsedAt = S::UsedAt; type UsedBy = Set; + type UsedAt = S::UsedAt; + } + ///State transition - sets the `used_at` field to Set + pub struct SetUsedAt(PhantomData S>); + impl sealed::Sealed for SetUsedAt {} + impl State for SetUsedAt { + type UsedBy = S::UsedBy; + type UsedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `used_at` field - pub struct used_at(()); ///Marker type for the `used_by` field pub struct used_by(()); + ///Marker type for the `used_at` field + pub struct used_at(()); } } @@ -741,8 +741,8 @@ where impl<'a, S> InviteCodeUseBuilder<'a, S> where S: invite_code_use_state::State, - S::UsedAt: invite_code_use_state::IsSet, S::UsedBy: invite_code_use_state::IsSet, + S::UsedAt: invite_code_use_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteCodeUse<'a> { diff --git a/crates/weaver-api/src/com_atproto/server/create_app_password.rs b/crates/weaver-api/src/com_atproto/server/create_app_password.rs index 112e670..20fc73c 100644 --- a/crates/weaver-api/src/com_atproto/server/create_app_password.rs +++ b/crates/weaver-api/src/com_atproto/server/create_app_password.rs @@ -36,51 +36,51 @@ pub mod app_password_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; - type CreatedAt; type Password; + type CreatedAt; + type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Name = Unset; - type CreatedAt = Unset; type Password = Unset; + type CreatedAt = Unset; + type Name = Unset; } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Name = Set; + ///State transition - sets the `password` field to Set + pub struct SetPassword(PhantomData S>); + impl sealed::Sealed for SetPassword {} + impl State for SetPassword { + type Password = Set; type CreatedAt = S::CreatedAt; - type Password = S::Password; + type Name = S::Name; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Name = S::Name; - type CreatedAt = Set; type Password = S::Password; - } - ///State transition - sets the `password` field to Set - pub struct SetPassword(PhantomData S>); - impl sealed::Sealed for SetPassword {} - impl State for SetPassword { + type CreatedAt = Set; type Name = S::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Password = S::Password; type CreatedAt = S::CreatedAt; - type Password = Set; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `name` field - pub struct name(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `password` field pub struct password(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -187,9 +187,9 @@ impl<'a, S: app_password_state::State> AppPasswordBuilder<'a, S> { impl<'a, S> AppPasswordBuilder<'a, S> where S: app_password_state::State, - S::Name: app_password_state::IsSet, - S::CreatedAt: app_password_state::IsSet, S::Password: app_password_state::IsSet, + S::CreatedAt: app_password_state::IsSet, + S::Name: app_password_state::IsSet, { /// Build the final struct pub fn build(self) -> AppPassword<'a> { diff --git a/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs b/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs index 4eb9651..829d545 100644 --- a/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs +++ b/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs @@ -361,37 +361,37 @@ pub mod create_invite_codes_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CodeCount; type UseCount; + type CodeCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CodeCount = Unset; type UseCount = Unset; - } - ///State transition - sets the `code_count` field to Set - pub struct SetCodeCount(PhantomData S>); - impl sealed::Sealed for SetCodeCount {} - impl State for SetCodeCount { - type CodeCount = Set; - type UseCount = S::UseCount; + type CodeCount = Unset; } ///State transition - sets the `use_count` field to Set pub struct SetUseCount(PhantomData S>); impl sealed::Sealed for SetUseCount {} impl State for SetUseCount { - type CodeCount = S::CodeCount; type UseCount = Set; + type CodeCount = S::CodeCount; + } + ///State transition - sets the `code_count` field to Set + pub struct SetCodeCount(PhantomData S>); + impl sealed::Sealed for SetCodeCount {} + impl State for SetCodeCount { + type UseCount = S::UseCount; + type CodeCount = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `code_count` field - pub struct code_count(()); ///Marker type for the `use_count` field pub struct use_count(()); + ///Marker type for the `code_count` field + pub struct code_count(()); } } @@ -484,8 +484,8 @@ where impl<'a, S> CreateInviteCodesBuilder<'a, S> where S: create_invite_codes_state::State, - S::CodeCount: create_invite_codes_state::IsSet, S::UseCount: create_invite_codes_state::IsSet, + S::CodeCount: create_invite_codes_state::IsSet, { /// Build the final struct pub fn build(self) -> CreateInviteCodes<'a> { diff --git a/crates/weaver-api/src/com_atproto/server/delete_account.rs b/crates/weaver-api/src/com_atproto/server/delete_account.rs index 15f1dfe..9805d89 100644 --- a/crates/weaver-api/src/com_atproto/server/delete_account.rs +++ b/crates/weaver-api/src/com_atproto/server/delete_account.rs @@ -35,51 +35,51 @@ pub mod delete_account_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Token; - type Password; type Did; + type Password; + type Token; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Token = Unset; - type Password = Unset; type Did = Unset; + type Password = Unset; + type Token = Unset; } - ///State transition - sets the `token` field to Set - pub struct SetToken(PhantomData S>); - impl sealed::Sealed for SetToken {} - impl State for SetToken { - type Token = Set; + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; type Password = S::Password; - type Did = S::Did; + type Token = S::Token; } ///State transition - sets the `password` field to Set pub struct SetPassword(PhantomData S>); impl sealed::Sealed for SetPassword {} impl State for SetPassword { - type Token = S::Token; - type Password = Set; type Did = S::Did; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { + type Password = Set; type Token = S::Token; + } + ///State transition - sets the `token` field to Set + pub struct SetToken(PhantomData S>); + impl sealed::Sealed for SetToken {} + impl State for SetToken { + type Did = S::Did; type Password = S::Password; - type Did = Set; + type Token = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `token` field - pub struct token(()); - ///Marker type for the `password` field - pub struct password(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `password` field + pub struct password(()); + ///Marker type for the `token` field + pub struct token(()); } } @@ -172,9 +172,9 @@ where impl<'a, S> DeleteAccountBuilder<'a, S> where S: delete_account_state::State, - S::Token: delete_account_state::IsSet, - S::Password: delete_account_state::IsSet, S::Did: delete_account_state::IsSet, + S::Password: delete_account_state::IsSet, + S::Token: delete_account_state::IsSet, { /// Build the final struct pub fn build(self) -> DeleteAccount<'a> { diff --git a/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs b/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs index 905d864..0500c91 100644 --- a/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs +++ b/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs @@ -34,37 +34,37 @@ pub mod app_password_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Name; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Name = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Name = S::Name; + type CreatedAt = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type CreatedAt = S::CreatedAt; type Name = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Name = S::Name; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -151,8 +151,8 @@ impl<'a, S: app_password_state::State> AppPasswordBuilder<'a, S> { impl<'a, S> AppPasswordBuilder<'a, S> where S: app_password_state::State, - S::CreatedAt: app_password_state::IsSet, S::Name: app_password_state::IsSet, + S::CreatedAt: app_password_state::IsSet, { /// Build the final struct pub fn build(self) -> AppPassword<'a> { diff --git a/crates/weaver-api/src/com_atproto/sync/get_blob.rs b/crates/weaver-api/src/com_atproto/sync/get_blob.rs index 549b7a1..e7c670d 100644 --- a/crates/weaver-api/src/com_atproto/sync/get_blob.rs +++ b/crates/weaver-api/src/com_atproto/sync/get_blob.rs @@ -32,37 +32,37 @@ pub mod get_blob_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Cid; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Cid = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Cid = S::Cid; + type Did = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Did = S::Did; type Cid = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Cid = S::Cid; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> GetBlobBuilder<'a, S> where S: get_blob_state::State, - S::Did: get_blob_state::IsSet, S::Cid: get_blob_state::IsSet, + S::Did: get_blob_state::IsSet, { /// Build the final struct pub fn build(self) -> GetBlob<'a> { diff --git a/crates/weaver-api/src/com_atproto/sync/get_blocks.rs b/crates/weaver-api/src/com_atproto/sync/get_blocks.rs index 3022ba6..4c82750 100644 --- a/crates/weaver-api/src/com_atproto/sync/get_blocks.rs +++ b/crates/weaver-api/src/com_atproto/sync/get_blocks.rs @@ -32,37 +32,37 @@ pub mod get_blocks_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Cids; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Cids = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Cids = S::Cids; + type Did = Unset; } ///State transition - sets the `cids` field to Set pub struct SetCids(PhantomData S>); impl sealed::Sealed for SetCids {} impl State for SetCids { - type Did = S::Did; type Cids = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Cids = S::Cids; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `cids` field pub struct cids(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> GetBlocksBuilder<'a, S> where S: get_blocks_state::State, - S::Did: get_blocks_state::IsSet, S::Cids: get_blocks_state::IsSet, + S::Did: get_blocks_state::IsSet, { /// Build the final struct pub fn build(self) -> GetBlocks<'a> { diff --git a/crates/weaver-api/src/com_atproto/sync/get_record.rs b/crates/weaver-api/src/com_atproto/sync/get_record.rs index 03e0cca..6706fc9 100644 --- a/crates/weaver-api/src/com_atproto/sync/get_record.rs +++ b/crates/weaver-api/src/com_atproto/sync/get_record.rs @@ -36,51 +36,51 @@ pub mod get_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rkey; - type Collection; type Did; + type Collection; + type Rkey; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rkey = Unset; - type Collection = Unset; type Did = Unset; + type Collection = Unset; + type Rkey = Unset; } - ///State transition - sets the `rkey` field to Set - pub struct SetRkey(PhantomData S>); - impl sealed::Sealed for SetRkey {} - impl State for SetRkey { - type Rkey = Set; + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; type Collection = S::Collection; - type Did = S::Did; + type Rkey = S::Rkey; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { - type Rkey = S::Rkey; - type Collection = Set; type Did = S::Did; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { + type Collection = Set; type Rkey = S::Rkey; + } + ///State transition - sets the `rkey` field to Set + pub struct SetRkey(PhantomData S>); + impl sealed::Sealed for SetRkey {} + impl State for SetRkey { + type Did = S::Did; type Collection = S::Collection; - type Did = Set; + type Rkey = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rkey` field - pub struct rkey(()); - ///Marker type for the `collection` field - pub struct collection(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `collection` field + pub struct collection(()); + ///Marker type for the `rkey` field + pub struct rkey(()); } } @@ -181,9 +181,9 @@ where impl<'a, S> GetRecordBuilder<'a, S> where S: get_record_state::State, - S::Rkey: get_record_state::IsSet, - S::Collection: get_record_state::IsSet, S::Did: get_record_state::IsSet, + S::Collection: get_record_state::IsSet, + S::Rkey: get_record_state::IsSet, { /// Build the final struct pub fn build(self) -> GetRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs b/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs index e17767b..af8340d 100644 --- a/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs +++ b/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs @@ -42,8 +42,8 @@ pub mod account_state { pub trait State: sealed::Sealed { type Time; type Seq; - type Did; type Active; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -51,8 +51,8 @@ pub mod account_state { impl State for Empty { type Time = Unset; type Seq = Unset; - type Did = Unset; type Active = Unset; + type Did = Unset; } ///State transition - sets the `time` field to Set pub struct SetTime(PhantomData S>); @@ -60,8 +60,8 @@ pub mod account_state { impl State for SetTime { type Time = Set; type Seq = S::Seq; - type Did = S::Did; type Active = S::Active; + type Did = S::Did; } ///State transition - sets the `seq` field to Set pub struct SetSeq(PhantomData S>); @@ -69,17 +69,8 @@ pub mod account_state { impl State for SetSeq { type Time = S::Time; type Seq = Set; - type Did = S::Did; - type Active = S::Active; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Time = S::Time; - type Seq = S::Seq; - type Did = Set; type Active = S::Active; + type Did = S::Did; } ///State transition - sets the `active` field to Set pub struct SetActive(PhantomData S>); @@ -87,8 +78,17 @@ pub mod account_state { impl State for SetActive { type Time = S::Time; type Seq = S::Seq; - type Did = S::Did; type Active = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Time = S::Time; + type Seq = S::Seq; + type Active = S::Active; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -97,10 +97,10 @@ pub mod account_state { pub struct time(()); ///Marker type for the `seq` field pub struct seq(()); - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `active` field pub struct active(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -232,8 +232,8 @@ where S: account_state::State, S::Time: account_state::IsSet, S::Seq: account_state::IsSet, - S::Did: account_state::IsSet, S::Active: account_state::IsSet, + S::Did: account_state::IsSet, { /// Build the final struct pub fn build(self) -> Account<'a> { @@ -967,205 +967,205 @@ pub mod commit_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Seq; - type Blocks; + type Rebase; + type Repo; + type TooBig; type Commit; type Blobs; type Ops; - type Rev; type Time; - type TooBig; - type Rebase; - type Repo; + type Blocks; + type Seq; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Seq = Unset; - type Blocks = Unset; + type Rebase = Unset; + type Repo = Unset; + type TooBig = Unset; type Commit = Unset; type Blobs = Unset; type Ops = Unset; - type Rev = Unset; type Time = Unset; - type TooBig = Unset; - type Rebase = Unset; - type Repo = Unset; + type Blocks = Unset; + type Seq = Unset; + type Rev = Unset; } - ///State transition - sets the `seq` field to Set - pub struct SetSeq(PhantomData S>); - impl sealed::Sealed for SetSeq {} - impl State for SetSeq { - type Seq = Set; - type Blocks = S::Blocks; + ///State transition - sets the `rebase` field to Set + pub struct SetRebase(PhantomData S>); + impl sealed::Sealed for SetRebase {} + impl State for SetRebase { + type Rebase = Set; + type Repo = S::Repo; + type TooBig = S::TooBig; type Commit = S::Commit; type Blobs = S::Blobs; type Ops = S::Ops; - type Rev = S::Rev; type Time = S::Time; - type TooBig = S::TooBig; - type Rebase = S::Rebase; - type Repo = S::Repo; - } - ///State transition - sets the `blocks` field to Set - pub struct SetBlocks(PhantomData S>); - impl sealed::Sealed for SetBlocks {} - impl State for SetBlocks { + type Blocks = S::Blocks; type Seq = S::Seq; - type Blocks = Set; + type Rev = S::Rev; + } + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Rebase = S::Rebase; + type Repo = Set; + type TooBig = S::TooBig; type Commit = S::Commit; type Blobs = S::Blobs; type Ops = S::Ops; - type Rev = S::Rev; type Time = S::Time; - type TooBig = S::TooBig; + type Blocks = S::Blocks; + type Seq = S::Seq; + type Rev = S::Rev; + } + ///State transition - sets the `too_big` field to Set + pub struct SetTooBig(PhantomData S>); + impl sealed::Sealed for SetTooBig {} + impl State for SetTooBig { type Rebase = S::Rebase; type Repo = S::Repo; + type TooBig = Set; + type Commit = S::Commit; + type Blobs = S::Blobs; + type Ops = S::Ops; + type Time = S::Time; + type Blocks = S::Blocks; + type Seq = S::Seq; + type Rev = S::Rev; } ///State transition - sets the `commit` field to Set pub struct SetCommit(PhantomData S>); impl sealed::Sealed for SetCommit {} impl State for SetCommit { - type Seq = S::Seq; - type Blocks = S::Blocks; + type Rebase = S::Rebase; + type Repo = S::Repo; + type TooBig = S::TooBig; type Commit = Set; type Blobs = S::Blobs; type Ops = S::Ops; - type Rev = S::Rev; type Time = S::Time; - type TooBig = S::TooBig; - type Rebase = S::Rebase; - type Repo = S::Repo; + type Blocks = S::Blocks; + type Seq = S::Seq; + type Rev = S::Rev; } ///State transition - sets the `blobs` field to Set pub struct SetBlobs(PhantomData S>); impl sealed::Sealed for SetBlobs {} impl State for SetBlobs { - type Seq = S::Seq; - type Blocks = S::Blocks; + type Rebase = S::Rebase; + type Repo = S::Repo; + type TooBig = S::TooBig; type Commit = S::Commit; type Blobs = Set; type Ops = S::Ops; - type Rev = S::Rev; type Time = S::Time; - type TooBig = S::TooBig; - type Rebase = S::Rebase; - type Repo = S::Repo; + type Blocks = S::Blocks; + type Seq = S::Seq; + type Rev = S::Rev; } ///State transition - sets the `ops` field to Set pub struct SetOps(PhantomData S>); impl sealed::Sealed for SetOps {} impl State for SetOps { - type Seq = S::Seq; - type Blocks = S::Blocks; - type Commit = S::Commit; - type Blobs = S::Blobs; - type Ops = Set; - type Rev = S::Rev; - type Time = S::Time; - type TooBig = S::TooBig; type Rebase = S::Rebase; type Repo = S::Repo; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Seq = S::Seq; - type Blocks = S::Blocks; + type TooBig = S::TooBig; type Commit = S::Commit; type Blobs = S::Blobs; - type Ops = S::Ops; - type Rev = Set; + type Ops = Set; type Time = S::Time; - type TooBig = S::TooBig; - type Rebase = S::Rebase; - type Repo = S::Repo; + type Blocks = S::Blocks; + type Seq = S::Seq; + type Rev = S::Rev; } ///State transition - sets the `time` field to Set pub struct SetTime(PhantomData S>); impl sealed::Sealed for SetTime {} impl State for SetTime { - type Seq = S::Seq; - type Blocks = S::Blocks; + type Rebase = S::Rebase; + type Repo = S::Repo; + type TooBig = S::TooBig; type Commit = S::Commit; type Blobs = S::Blobs; type Ops = S::Ops; - type Rev = S::Rev; type Time = Set; - type TooBig = S::TooBig; + type Blocks = S::Blocks; + type Seq = S::Seq; + type Rev = S::Rev; + } + ///State transition - sets the `blocks` field to Set + pub struct SetBlocks(PhantomData S>); + impl sealed::Sealed for SetBlocks {} + impl State for SetBlocks { type Rebase = S::Rebase; type Repo = S::Repo; - } - ///State transition - sets the `too_big` field to Set - pub struct SetTooBig(PhantomData S>); - impl sealed::Sealed for SetTooBig {} - impl State for SetTooBig { - type Seq = S::Seq; - type Blocks = S::Blocks; + type TooBig = S::TooBig; type Commit = S::Commit; type Blobs = S::Blobs; type Ops = S::Ops; - type Rev = S::Rev; type Time = S::Time; - type TooBig = Set; + type Blocks = Set; + type Seq = S::Seq; + type Rev = S::Rev; + } + ///State transition - sets the `seq` field to Set + pub struct SetSeq(PhantomData S>); + impl sealed::Sealed for SetSeq {} + impl State for SetSeq { type Rebase = S::Rebase; type Repo = S::Repo; - } - ///State transition - sets the `rebase` field to Set - pub struct SetRebase(PhantomData S>); - impl sealed::Sealed for SetRebase {} - impl State for SetRebase { - type Seq = S::Seq; - type Blocks = S::Blocks; + type TooBig = S::TooBig; type Commit = S::Commit; type Blobs = S::Blobs; type Ops = S::Ops; - type Rev = S::Rev; type Time = S::Time; - type TooBig = S::TooBig; - type Rebase = Set; - type Repo = S::Repo; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { - type Seq = S::Seq; type Blocks = S::Blocks; + type Seq = Set; + type Rev = S::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Rebase = S::Rebase; + type Repo = S::Repo; + type TooBig = S::TooBig; type Commit = S::Commit; type Blobs = S::Blobs; type Ops = S::Ops; - type Rev = S::Rev; type Time = S::Time; - type TooBig = S::TooBig; - type Rebase = S::Rebase; - type Repo = Set; + type Blocks = S::Blocks; + type Seq = S::Seq; + type Rev = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `seq` field - pub struct seq(()); - ///Marker type for the `blocks` field - pub struct blocks(()); + ///Marker type for the `rebase` field + pub struct rebase(()); + ///Marker type for the `repo` field + pub struct repo(()); + ///Marker type for the `too_big` field + pub struct too_big(()); ///Marker type for the `commit` field pub struct commit(()); ///Marker type for the `blobs` field pub struct blobs(()); ///Marker type for the `ops` field pub struct ops(()); - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `time` field pub struct time(()); - ///Marker type for the `too_big` field - pub struct too_big(()); - ///Marker type for the `rebase` field - pub struct rebase(()); - ///Marker type for the `repo` field - pub struct repo(()); + ///Marker type for the `blocks` field + pub struct blocks(()); + ///Marker type for the `seq` field + pub struct seq(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -1453,16 +1453,16 @@ where impl<'a, S> CommitBuilder<'a, S> where S: commit_state::State, - S::Seq: commit_state::IsSet, - S::Blocks: commit_state::IsSet, + S::Rebase: commit_state::IsSet, + S::Repo: commit_state::IsSet, + S::TooBig: commit_state::IsSet, S::Commit: commit_state::IsSet, S::Blobs: commit_state::IsSet, S::Ops: commit_state::IsSet, - S::Rev: commit_state::IsSet, S::Time: commit_state::IsSet, - S::TooBig: commit_state::IsSet, - S::Rebase: commit_state::IsSet, - S::Repo: commit_state::IsSet, + S::Blocks: commit_state::IsSet, + S::Seq: commit_state::IsSet, + S::Rev: commit_state::IsSet, { /// Build the final struct pub fn build(self) -> Commit<'a> { @@ -1571,49 +1571,49 @@ pub mod identity_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Time; type Did; + type Time; type Seq; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Time = Unset; type Did = Unset; + type Time = Unset; type Seq = Unset; } - ///State transition - sets the `time` field to Set - pub struct SetTime(PhantomData S>); - impl sealed::Sealed for SetTime {} - impl State for SetTime { - type Time = Set; - type Did = S::Did; - type Seq = S::Seq; - } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Time = S::Time; type Did = Set; + type Time = S::Time; + type Seq = S::Seq; + } + ///State transition - sets the `time` field to Set + pub struct SetTime(PhantomData S>); + impl sealed::Sealed for SetTime {} + impl State for SetTime { + type Did = S::Did; + type Time = Set; type Seq = S::Seq; } ///State transition - sets the `seq` field to Set pub struct SetSeq(PhantomData S>); impl sealed::Sealed for SetSeq {} impl State for SetSeq { - type Time = S::Time; type Did = S::Did; + type Time = S::Time; type Seq = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `time` field - pub struct time(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `time` field + pub struct time(()); ///Marker type for the `seq` field pub struct seq(()); } @@ -1728,8 +1728,8 @@ where impl<'a, S> IdentityBuilder<'a, S> where S: identity_state::State, - S::Time: identity_state::IsSet, S::Did: identity_state::IsSet, + S::Time: identity_state::IsSet, S::Seq: identity_state::IsSet, { /// Build the final struct @@ -2297,85 +2297,85 @@ pub mod sync_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Did; type Seq; type Blocks; - type Did; - type Rev; type Time; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Did = Unset; type Seq = Unset; type Blocks = Unset; - type Did = Unset; - type Rev = Unset; type Time = Unset; + type Rev = Unset; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; + type Seq = S::Seq; + type Blocks = S::Blocks; + type Time = S::Time; + type Rev = S::Rev; } ///State transition - sets the `seq` field to Set pub struct SetSeq(PhantomData S>); impl sealed::Sealed for SetSeq {} impl State for SetSeq { + type Did = S::Did; type Seq = Set; type Blocks = S::Blocks; - type Did = S::Did; - type Rev = S::Rev; type Time = S::Time; + type Rev = S::Rev; } ///State transition - sets the `blocks` field to Set pub struct SetBlocks(PhantomData S>); impl sealed::Sealed for SetBlocks {} impl State for SetBlocks { + type Did = S::Did; type Seq = S::Seq; type Blocks = Set; - type Did = S::Did; - type Rev = S::Rev; type Time = S::Time; + type Rev = S::Rev; } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { + ///State transition - sets the `time` field to Set + pub struct SetTime(PhantomData S>); + impl sealed::Sealed for SetTime {} + impl State for SetTime { + type Did = S::Did; type Seq = S::Seq; type Blocks = S::Blocks; - type Did = Set; + type Time = Set; type Rev = S::Rev; - type Time = S::Time; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Seq = S::Seq; - type Blocks = S::Blocks; type Did = S::Did; - type Rev = Set; - type Time = S::Time; - } - ///State transition - sets the `time` field to Set - pub struct SetTime(PhantomData S>); - impl sealed::Sealed for SetTime {} - impl State for SetTime { type Seq = S::Seq; type Blocks = S::Blocks; - type Did = S::Did; - type Rev = S::Rev; - type Time = Set; + type Time = S::Time; + type Rev = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `seq` field pub struct seq(()); ///Marker type for the `blocks` field pub struct blocks(()); - ///Marker type for the `did` field - pub struct did(()); - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `time` field pub struct time(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -2508,11 +2508,11 @@ where impl<'a, S> SyncBuilder<'a, S> where S: sync_state::State, + S::Did: sync_state::IsSet, S::Seq: sync_state::IsSet, S::Blocks: sync_state::IsSet, - S::Did: sync_state::IsSet, - S::Rev: sync_state::IsSet, S::Time: sync_state::IsSet, + S::Rev: sync_state::IsSet, { /// Build the final struct pub fn build(self) -> Sync<'a> { diff --git a/crates/weaver-api/src/sh_weaver/actor.rs b/crates/weaver-api/src/sh_weaver/actor.rs index c46adc9..e4b89f9 100644 --- a/crates/weaver-api/src/sh_weaver/actor.rs +++ b/crates/weaver-api/src/sh_weaver/actor.rs @@ -1979,37 +1979,37 @@ pub mod profile_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Handle; type Did; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Handle = Unset; type Did = Unset; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type Handle = Set; - type Did = S::Did; + type Handle = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Handle = S::Handle; type Did = Set; + type Handle = S::Handle; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Did = S::Did; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -2388,8 +2388,8 @@ impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { impl<'a, S> ProfileViewBuilder<'a, S> where S: profile_view_state::State, - S::Handle: profile_view_state::IsSet, S::Did: profile_view_state::IsSet, + S::Handle: profile_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ProfileView<'a> { @@ -2623,37 +2623,37 @@ pub mod profile_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Handle; type Did; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Handle = Unset; type Did = Unset; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type Handle = Set; - type Did = S::Did; + type Handle = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Handle = S::Handle; type Did = Set; + type Handle = S::Handle; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Did = S::Did; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -2846,8 +2846,8 @@ impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { impl<'a, S> ProfileViewBasicBuilder<'a, S> where S: profile_view_basic_state::State, - S::Handle: profile_view_basic_state::IsSet, S::Did: profile_view_basic_state::IsSet, + S::Handle: profile_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> ProfileViewBasic<'a> { @@ -3166,49 +3166,49 @@ pub mod tangled_profile_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Bluesky; + type Did; type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Bluesky = Unset; + type Did = Unset; type Handle = Unset; } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Bluesky = S::Bluesky; - type Handle = S::Handle; - } ///State transition - sets the `bluesky` field to Set pub struct SetBluesky(PhantomData S>); impl sealed::Sealed for SetBluesky {} impl State for SetBluesky { - type Did = S::Did; type Bluesky = Set; + type Did = S::Did; + type Handle = S::Handle; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Bluesky = S::Bluesky; + type Did = Set; type Handle = S::Handle; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Did = S::Did; type Bluesky = S::Bluesky; + type Did = S::Did; type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `bluesky` field pub struct bluesky(()); + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); } @@ -3400,8 +3400,8 @@ impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> impl<'a, S> TangledProfileViewBuilder<'a, S> where S: tangled_profile_view_state::State, - S::Did: tangled_profile_view_state::IsSet, S::Bluesky: tangled_profile_view_state::IsSet, + S::Did: tangled_profile_view_state::IsSet, S::Handle: tangled_profile_view_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/collab.rs b/crates/weaver-api/src/sh_weaver/collab.rs index a2ba006..b408fe4 100644 --- a/crates/weaver-api/src/sh_weaver/collab.rs +++ b/crates/weaver-api/src/sh_weaver/collab.rs @@ -94,49 +94,49 @@ pub mod collaboration_state_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Participants; type Resource; + type Participants; type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Participants = Unset; type Resource = Unset; + type Participants = Unset; type Status = Unset; } - ///State transition - sets the `participants` field to Set - pub struct SetParticipants(PhantomData S>); - impl sealed::Sealed for SetParticipants {} - impl State for SetParticipants { - type Participants = Set; - type Resource = S::Resource; - type Status = S::Status; - } ///State transition - sets the `resource` field to Set pub struct SetResource(PhantomData S>); impl sealed::Sealed for SetResource {} impl State for SetResource { - type Participants = S::Participants; type Resource = Set; + type Participants = S::Participants; + type Status = S::Status; + } + ///State transition - sets the `participants` field to Set + pub struct SetParticipants(PhantomData S>); + impl sealed::Sealed for SetParticipants {} + impl State for SetParticipants { + type Resource = S::Resource; + type Participants = Set; type Status = S::Status; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type Participants = S::Participants; type Resource = S::Resource; + type Participants = S::Participants; type Status = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `participants` field - pub struct participants(()); ///Marker type for the `resource` field pub struct resource(()); + ///Marker type for the `participants` field + pub struct participants(()); ///Marker type for the `status` field pub struct status(()); } @@ -426,8 +426,8 @@ where impl<'a, S> CollaborationStateViewBuilder<'a, S> where S: collaboration_state_view_state::State, - S::Participants: collaboration_state_view_state::IsSet, S::Resource: collaboration_state_view_state::IsSet, + S::Participants: collaboration_state_view_state::IsSet, S::Status: collaboration_state_view_state::IsSet, { /// Build the final struct @@ -1505,67 +1505,67 @@ pub mod former_collaborator_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type WasActiveUntil; - type EndReason; type WasActiveFrom; type User; + type EndReason; + type WasActiveUntil; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type WasActiveUntil = Unset; - type EndReason = Unset; type WasActiveFrom = Unset; type User = Unset; - } - ///State transition - sets the `was_active_until` field to Set - pub struct SetWasActiveUntil(PhantomData S>); - impl sealed::Sealed for SetWasActiveUntil {} - impl State for SetWasActiveUntil { - type WasActiveUntil = Set; - type EndReason = S::EndReason; - type WasActiveFrom = S::WasActiveFrom; - type User = S::User; - } - ///State transition - sets the `end_reason` field to Set - pub struct SetEndReason(PhantomData S>); - impl sealed::Sealed for SetEndReason {} - impl State for SetEndReason { - type WasActiveUntil = S::WasActiveUntil; - type EndReason = Set; - type WasActiveFrom = S::WasActiveFrom; - type User = S::User; + type EndReason = Unset; + type WasActiveUntil = Unset; } ///State transition - sets the `was_active_from` field to Set pub struct SetWasActiveFrom(PhantomData S>); impl sealed::Sealed for SetWasActiveFrom {} impl State for SetWasActiveFrom { - type WasActiveUntil = S::WasActiveUntil; - type EndReason = S::EndReason; type WasActiveFrom = Set; type User = S::User; + type EndReason = S::EndReason; + type WasActiveUntil = S::WasActiveUntil; } ///State transition - sets the `user` field to Set pub struct SetUser(PhantomData S>); impl sealed::Sealed for SetUser {} impl State for SetUser { - type WasActiveUntil = S::WasActiveUntil; - type EndReason = S::EndReason; type WasActiveFrom = S::WasActiveFrom; type User = Set; + type EndReason = S::EndReason; + type WasActiveUntil = S::WasActiveUntil; + } + ///State transition - sets the `end_reason` field to Set + pub struct SetEndReason(PhantomData S>); + impl sealed::Sealed for SetEndReason {} + impl State for SetEndReason { + type WasActiveFrom = S::WasActiveFrom; + type User = S::User; + type EndReason = Set; + type WasActiveUntil = S::WasActiveUntil; + } + ///State transition - sets the `was_active_until` field to Set + pub struct SetWasActiveUntil(PhantomData S>); + impl sealed::Sealed for SetWasActiveUntil {} + impl State for SetWasActiveUntil { + type WasActiveFrom = S::WasActiveFrom; + type User = S::User; + type EndReason = S::EndReason; + type WasActiveUntil = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `was_active_until` field - pub struct was_active_until(()); - ///Marker type for the `end_reason` field - pub struct end_reason(()); ///Marker type for the `was_active_from` field pub struct was_active_from(()); ///Marker type for the `user` field pub struct user(()); + ///Marker type for the `end_reason` field + pub struct end_reason(()); + ///Marker type for the `was_active_until` field + pub struct was_active_until(()); } } @@ -1738,10 +1738,10 @@ where impl<'a, S> FormerCollaboratorViewBuilder<'a, S> where S: former_collaborator_view_state::State, - S::WasActiveUntil: former_collaborator_view_state::IsSet, - S::EndReason: former_collaborator_view_state::IsSet, S::WasActiveFrom: former_collaborator_view_state::IsSet, S::User: former_collaborator_view_state::IsSet, + S::EndReason: former_collaborator_view_state::IsSet, + S::WasActiveUntil: former_collaborator_view_state::IsSet, { /// Build the final struct pub fn build(self) -> FormerCollaboratorView<'a> { @@ -1848,127 +1848,127 @@ pub mod invite_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; + type Resource; + type Status; + type Inviter; type Uri; + type Cid; type Invitee; - type Inviter; - type Resource; type CreatedAt; - type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; + type Resource = Unset; + type Status = Unset; + type Inviter = Unset; type Uri = Unset; + type Cid = Unset; type Invitee = Unset; - type Inviter = Unset; - type Resource = Unset; type CreatedAt = Unset; - type Status = Unset; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Resource = Set; + type Status = S::Status; + type Inviter = S::Inviter; type Uri = S::Uri; + type Cid = S::Cid; type Invitee = S::Invitee; - type Inviter = S::Inviter; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { type Resource = S::Resource; + type Status = Set; + type Inviter = S::Inviter; + type Uri = S::Uri; + type Cid = S::Cid; + type Invitee = S::Invitee; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `inviter` field to Set + pub struct SetInviter(PhantomData S>); + impl sealed::Sealed for SetInviter {} + impl State for SetInviter { + type Resource = S::Resource; type Status = S::Status; + type Inviter = Set; + type Uri = S::Uri; + type Cid = S::Cid; + type Invitee = S::Invitee; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = S::Cid; + type Resource = S::Resource; + type Status = S::Status; + type Inviter = S::Inviter; type Uri = Set; + type Cid = S::Cid; type Invitee = S::Invitee; - type Inviter = S::Inviter; - type Resource = S::Resource; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Resource = S::Resource; type Status = S::Status; + type Inviter = S::Inviter; + type Uri = S::Uri; + type Cid = Set; + type Invitee = S::Invitee; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `invitee` field to Set pub struct SetInvitee(PhantomData S>); impl sealed::Sealed for SetInvitee {} impl State for SetInvitee { - type Cid = S::Cid; - type Uri = S::Uri; - type Invitee = Set; - type Inviter = S::Inviter; type Resource = S::Resource; - type CreatedAt = S::CreatedAt; type Status = S::Status; - } - ///State transition - sets the `inviter` field to Set - pub struct SetInviter(PhantomData S>); - impl sealed::Sealed for SetInviter {} - impl State for SetInviter { - type Cid = S::Cid; + type Inviter = S::Inviter; type Uri = S::Uri; - type Invitee = S::Invitee; - type Inviter = Set; - type Resource = S::Resource; - type CreatedAt = S::CreatedAt; - type Status = S::Status; - } - ///State transition - sets the `resource` field to Set - pub struct SetResource(PhantomData S>); - impl sealed::Sealed for SetResource {} - impl State for SetResource { type Cid = S::Cid; - type Uri = S::Uri; - type Invitee = S::Invitee; - type Inviter = S::Inviter; - type Resource = Set; + type Invitee = Set; type CreatedAt = S::CreatedAt; - type Status = S::Status; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Cid = S::Cid; - type Uri = S::Uri; - type Invitee = S::Invitee; - type Inviter = S::Inviter; type Resource = S::Resource; - type CreatedAt = Set; type Status = S::Status; - } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData S>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { - type Cid = S::Cid; + type Inviter = S::Inviter; type Uri = S::Uri; + type Cid = S::Cid; type Invitee = S::Invitee; - type Inviter = S::Inviter; - type Resource = S::Resource; - type CreatedAt = S::CreatedAt; - type Status = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); + ///Marker type for the `resource` field + pub struct resource(()); + ///Marker type for the `status` field + pub struct status(()); + ///Marker type for the `inviter` field + pub struct inviter(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `invitee` field pub struct invitee(()); - ///Marker type for the `inviter` field - pub struct inviter(()); - ///Marker type for the `resource` field - pub struct resource(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `status` field - pub struct status(()); } } @@ -2269,13 +2269,13 @@ where impl<'a, S> InviteViewBuilder<'a, S> where S: invite_view_state::State, - S::Cid: invite_view_state::IsSet, + S::Resource: invite_view_state::IsSet, + S::Status: invite_view_state::IsSet, + S::Inviter: invite_view_state::IsSet, S::Uri: invite_view_state::IsSet, + S::Cid: invite_view_state::IsSet, S::Invitee: invite_view_state::IsSet, - S::Inviter: invite_view_state::IsSet, - S::Resource: invite_view_state::IsSet, S::CreatedAt: invite_view_state::IsSet, - S::Status: invite_view_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteView<'a> { @@ -2420,51 +2420,51 @@ pub mod participant_state_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type User; - type Role; type Status; + type Role; + type User; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type User = Unset; - type Role = Unset; type Status = Unset; + type Role = Unset; + type User = Unset; } - ///State transition - sets the `user` field to Set - pub struct SetUser(PhantomData S>); - impl sealed::Sealed for SetUser {} - impl State for SetUser { - type User = Set; + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type Status = Set; type Role = S::Role; - type Status = S::Status; + type User = S::User; } ///State transition - sets the `role` field to Set pub struct SetRole(PhantomData S>); impl sealed::Sealed for SetRole {} impl State for SetRole { - type User = S::User; - type Role = Set; type Status = S::Status; - } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData S>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { + type Role = Set; type User = S::User; + } + ///State transition - sets the `user` field to Set + pub struct SetUser(PhantomData S>); + impl sealed::Sealed for SetUser {} + impl State for SetUser { + type Status = S::Status; type Role = S::Role; - type Status = Set; + type User = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `user` field - pub struct user(()); - ///Marker type for the `role` field - pub struct role(()); ///Marker type for the `status` field pub struct status(()); + ///Marker type for the `role` field + pub struct role(()); + ///Marker type for the `user` field + pub struct user(()); } } @@ -2726,9 +2726,9 @@ impl<'a, S: participant_state_view_state::State> ParticipantStateViewBuilder<'a, impl<'a, S> ParticipantStateViewBuilder<'a, S> where S: participant_state_view_state::State, - S::User: participant_state_view_state::IsSet, - S::Role: participant_state_view_state::IsSet, S::Status: participant_state_view_state::IsSet, + S::Role: participant_state_view_state::IsSet, + S::User: participant_state_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ParticipantStateView<'a> { @@ -2828,85 +2828,85 @@ pub mod session_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Uri; + type User; type Resource; type NodeId; type CreatedAt; - type Uri; - type User; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Uri = Unset; + type User = Unset; type Resource = Unset; type NodeId = Unset; type CreatedAt = Unset; - type Uri = Unset; - type User = Unset; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + type User = S::User; + type Resource = S::Resource; + type NodeId = S::NodeId; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `user` field to Set + pub struct SetUser(PhantomData S>); + impl sealed::Sealed for SetUser {} + impl State for SetUser { + type Uri = S::Uri; + type User = Set; + type Resource = S::Resource; + type NodeId = S::NodeId; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `resource` field to Set pub struct SetResource(PhantomData S>); impl sealed::Sealed for SetResource {} impl State for SetResource { + type Uri = S::Uri; + type User = S::User; type Resource = Set; type NodeId = S::NodeId; type CreatedAt = S::CreatedAt; - type Uri = S::Uri; - type User = S::User; } ///State transition - sets the `node_id` field to Set pub struct SetNodeId(PhantomData S>); impl sealed::Sealed for SetNodeId {} impl State for SetNodeId { + type Uri = S::Uri; + type User = S::User; type Resource = S::Resource; type NodeId = Set; type CreatedAt = S::CreatedAt; - type Uri = S::Uri; - type User = S::User; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Resource = S::Resource; - type NodeId = S::NodeId; - type CreatedAt = Set; type Uri = S::Uri; type User = S::User; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Resource = S::Resource; - type NodeId = S::NodeId; - type CreatedAt = S::CreatedAt; - type Uri = Set; - type User = S::User; - } - ///State transition - sets the `user` field to Set - pub struct SetUser(PhantomData S>); - impl sealed::Sealed for SetUser {} - impl State for SetUser { type Resource = S::Resource; type NodeId = S::NodeId; - type CreatedAt = S::CreatedAt; - type Uri = S::Uri; - type User = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `user` field + pub struct user(()); ///Marker type for the `resource` field pub struct resource(()); ///Marker type for the `node_id` field pub struct node_id(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `uri` field - pub struct uri(()); - ///Marker type for the `user` field - pub struct user(()); } } @@ -3079,11 +3079,11 @@ where impl<'a, S> SessionViewBuilder<'a, S> where S: session_view_state::State, + S::Uri: session_view_state::IsSet, + S::User: session_view_state::IsSet, S::Resource: session_view_state::IsSet, S::NodeId: session_view_state::IsSet, S::CreatedAt: session_view_state::IsSet, - S::Uri: session_view_state::IsSet, - S::User: session_view_state::IsSet, { /// Build the final struct pub fn build(self) -> SessionView<'a> { diff --git a/crates/weaver-api/src/sh_weaver/collab/accept.rs b/crates/weaver-api/src/sh_weaver/collab/accept.rs index 0684118..d347076 100644 --- a/crates/weaver-api/src/sh_weaver/collab/accept.rs +++ b/crates/weaver-api/src/sh_weaver/collab/accept.rs @@ -37,51 +37,51 @@ pub mod accept_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Invite; type Resource; type CreatedAt; - type Invite; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Invite = Unset; type Resource = Unset; type CreatedAt = Unset; - type Invite = Unset; + } + ///State transition - sets the `invite` field to Set + pub struct SetInvite(PhantomData S>); + impl sealed::Sealed for SetInvite {} + impl State for SetInvite { + type Invite = Set; + type Resource = S::Resource; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `resource` field to Set pub struct SetResource(PhantomData S>); impl sealed::Sealed for SetResource {} impl State for SetResource { + type Invite = S::Invite; type Resource = Set; type CreatedAt = S::CreatedAt; - type Invite = S::Invite; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Resource = S::Resource; - type CreatedAt = Set; type Invite = S::Invite; - } - ///State transition - sets the `invite` field to Set - pub struct SetInvite(PhantomData S>); - impl sealed::Sealed for SetInvite {} - impl State for SetInvite { type Resource = S::Resource; - type CreatedAt = S::CreatedAt; - type Invite = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `invite` field + pub struct invite(()); ///Marker type for the `resource` field pub struct resource(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `invite` field - pub struct invite(()); } } @@ -174,9 +174,9 @@ where impl<'a, S> AcceptBuilder<'a, S> where S: accept_state::State, + S::Invite: accept_state::IsSet, S::Resource: accept_state::IsSet, S::CreatedAt: accept_state::IsSet, - S::Invite: accept_state::IsSet, { /// Build the final struct pub fn build(self) -> Accept<'a> { diff --git a/crates/weaver-api/src/sh_weaver/collab/session.rs b/crates/weaver-api/src/sh_weaver/collab/session.rs index 1fb3e66..f1b894d 100644 --- a/crates/weaver-api/src/sh_weaver/collab/session.rs +++ b/crates/weaver-api/src/sh_weaver/collab/session.rs @@ -44,49 +44,49 @@ pub mod session_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Resource; type CreatedAt; + type Resource; type NodeId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Resource = Unset; type CreatedAt = Unset; + type Resource = Unset; type NodeId = Unset; } - ///State transition - sets the `resource` field to Set - pub struct SetResource(PhantomData S>); - impl sealed::Sealed for SetResource {} - impl State for SetResource { - type Resource = Set; - type CreatedAt = S::CreatedAt; - type NodeId = S::NodeId; - } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Resource = S::Resource; type CreatedAt = Set; + type Resource = S::Resource; + type NodeId = S::NodeId; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type CreatedAt = S::CreatedAt; + type Resource = Set; type NodeId = S::NodeId; } ///State transition - sets the `node_id` field to Set pub struct SetNodeId(PhantomData S>); impl sealed::Sealed for SetNodeId {} impl State for SetNodeId { - type Resource = S::Resource; type CreatedAt = S::CreatedAt; + type Resource = S::Resource; type NodeId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `resource` field - pub struct resource(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `resource` field + pub struct resource(()); ///Marker type for the `node_id` field pub struct node_id(()); } @@ -221,8 +221,8 @@ where impl<'a, S> SessionBuilder<'a, S> where S: session_state::State, - S::Resource: session_state::IsSet, S::CreatedAt: session_state::IsSet, + S::Resource: session_state::IsSet, S::NodeId: session_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/edit.rs b/crates/weaver-api/src/sh_weaver/edit.rs index afa065c..a5e4a56 100644 --- a/crates/weaver-api/src/sh_weaver/edit.rs +++ b/crates/weaver-api/src/sh_weaver/edit.rs @@ -9,8 +9,10 @@ pub mod cursor; pub mod diff; pub mod draft; pub mod get_branch; +pub mod get_contributors; pub mod get_edit_history; pub mod get_edit_tree; +pub mod list_drafts; pub mod root; #[jacquard_derive::lexicon] @@ -720,8 +722,8 @@ pub mod edit_branch_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Head; - type Length; type Author; + type Length; type LastUpdated; } /// Empty state - all required fields are unset @@ -729,8 +731,8 @@ pub mod edit_branch_view_state { impl sealed::Sealed for Empty {} impl State for Empty { type Head = Unset; - type Length = Unset; type Author = Unset; + type Length = Unset; type LastUpdated = Unset; } ///State transition - sets the `head` field to Set @@ -738,17 +740,8 @@ pub mod edit_branch_view_state { impl sealed::Sealed for SetHead {} impl State for SetHead { type Head = Set; - type Length = S::Length; - type Author = S::Author; - type LastUpdated = S::LastUpdated; - } - ///State transition - sets the `length` field to Set - pub struct SetLength(PhantomData S>); - impl sealed::Sealed for SetLength {} - impl State for SetLength { - type Head = S::Head; - type Length = Set; type Author = S::Author; + type Length = S::Length; type LastUpdated = S::LastUpdated; } ///State transition - sets the `author` field to Set @@ -756,8 +749,17 @@ pub mod edit_branch_view_state { impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Head = S::Head; - type Length = S::Length; type Author = Set; + type Length = S::Length; + type LastUpdated = S::LastUpdated; + } + ///State transition - sets the `length` field to Set + pub struct SetLength(PhantomData S>); + impl sealed::Sealed for SetLength {} + impl State for SetLength { + type Head = S::Head; + type Author = S::Author; + type Length = Set; type LastUpdated = S::LastUpdated; } ///State transition - sets the `last_updated` field to Set @@ -765,8 +767,8 @@ pub mod edit_branch_view_state { impl sealed::Sealed for SetLastUpdated {} impl State for SetLastUpdated { type Head = S::Head; - type Length = S::Length; type Author = S::Author; + type Length = S::Length; type LastUpdated = Set; } /// Marker types for field names @@ -774,10 +776,10 @@ pub mod edit_branch_view_state { pub mod members { ///Marker type for the `head` field pub struct head(()); - ///Marker type for the `length` field - pub struct length(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `length` field + pub struct length(()); ///Marker type for the `last_updated` field pub struct last_updated(()); } @@ -947,8 +949,8 @@ impl<'a, S> EditBranchViewBuilder<'a, S> where S: edit_branch_view_state::State, S::Head: edit_branch_view_state::IsSet, - S::Length: edit_branch_view_state::IsSet, S::Author: edit_branch_view_state::IsSet, + S::Length: edit_branch_view_state::IsSet, S::LastUpdated: edit_branch_view_state::IsSet, { /// Build the final struct @@ -1052,84 +1054,84 @@ pub mod edit_history_entry_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Cid; - type Author; - type Uri; type CreatedAt; type Type; + type Author; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Cid = Unset; - type Author = Unset; - type Uri = Unset; type CreatedAt = Unset; type Type = Unset; + type Author = Unset; + type Uri = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Cid = Set; - type Author = S::Author; - type Uri = S::Uri; - type CreatedAt = S::CreatedAt; - type Type = S::Type; - } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData S>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { - type Cid = S::Cid; - type Author = Set; - type Uri = S::Uri; type CreatedAt = S::CreatedAt; type Type = S::Type; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Cid = S::Cid; type Author = S::Author; - type Uri = Set; - type CreatedAt = S::CreatedAt; - type Type = S::Type; + type Uri = S::Uri; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type Cid = S::Cid; - type Author = S::Author; - type Uri = S::Uri; type CreatedAt = Set; type Type = S::Type; + type Author = S::Author; + type Uri = S::Uri; } ///State transition - sets the `type` field to Set pub struct SetType(PhantomData S>); impl sealed::Sealed for SetType {} impl State for SetType { type Cid = S::Cid; + type CreatedAt = S::CreatedAt; + type Type = Set; type Author = S::Author; type Uri = S::Uri; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type Cid = S::Cid; type CreatedAt = S::CreatedAt; - type Type = Set; + type Type = S::Type; + type Author = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Cid = S::Cid; + type CreatedAt = S::CreatedAt; + type Type = S::Type; + type Author = S::Author; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `author` field - pub struct author(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `type` field pub struct r#type(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1347,10 +1349,10 @@ impl<'a, S> EditHistoryEntryBuilder<'a, S> where S: edit_history_entry_state::State, S::Cid: edit_history_entry_state::IsSet, - S::Author: edit_history_entry_state::IsSet, - S::Uri: edit_history_entry_state::IsSet, S::CreatedAt: edit_history_entry_state::IsSet, S::Type: edit_history_entry_state::IsSet, + S::Author: edit_history_entry_state::IsSet, + S::Uri: edit_history_entry_state::IsSet, { /// Build the final struct pub fn build(self) -> EditHistoryEntry<'a> { @@ -1447,37 +1449,37 @@ pub mod edit_tree_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Resource; type Branches; + type Resource; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Resource = Unset; type Branches = Unset; - } - ///State transition - sets the `resource` field to Set - pub struct SetResource(PhantomData S>); - impl sealed::Sealed for SetResource {} - impl State for SetResource { - type Resource = Set; - type Branches = S::Branches; + type Resource = Unset; } ///State transition - sets the `branches` field to Set pub struct SetBranches(PhantomData S>); impl sealed::Sealed for SetBranches {} impl State for SetBranches { - type Resource = S::Resource; type Branches = Set; + type Resource = S::Resource; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Branches = S::Branches; + type Resource = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `resource` field - pub struct resource(()); ///Marker type for the `branches` field pub struct branches(()); + ///Marker type for the `resource` field + pub struct resource(()); } } @@ -1606,8 +1608,8 @@ where impl<'a, S> EditTreeViewBuilder<'a, S> where S: edit_tree_view_state::State, - S::Resource: edit_tree_view_state::IsSet, S::Branches: edit_tree_view_state::IsSet, + S::Resource: edit_tree_view_state::IsSet, { /// Build the final struct pub fn build(self) -> EditTreeView<'a> { diff --git a/crates/weaver-api/src/sh_weaver/edit/cursor.rs b/crates/weaver-api/src/sh_weaver/edit/cursor.rs index 2861a92..28d639a 100644 --- a/crates/weaver-api/src/sh_weaver/edit/cursor.rs +++ b/crates/weaver-api/src/sh_weaver/edit/cursor.rs @@ -1017,51 +1017,51 @@ pub mod normal_container_id_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Counter; - type ContainerType; type Peer; + type ContainerType; + type Counter; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Counter = Unset; - type ContainerType = Unset; type Peer = Unset; + type ContainerType = Unset; + type Counter = Unset; } - ///State transition - sets the `counter` field to Set - pub struct SetCounter(PhantomData S>); - impl sealed::Sealed for SetCounter {} - impl State for SetCounter { - type Counter = Set; + ///State transition - sets the `peer` field to Set + pub struct SetPeer(PhantomData S>); + impl sealed::Sealed for SetPeer {} + impl State for SetPeer { + type Peer = Set; type ContainerType = S::ContainerType; - type Peer = S::Peer; + type Counter = S::Counter; } ///State transition - sets the `container_type` field to Set pub struct SetContainerType(PhantomData S>); impl sealed::Sealed for SetContainerType {} impl State for SetContainerType { - type Counter = S::Counter; - type ContainerType = Set; type Peer = S::Peer; - } - ///State transition - sets the `peer` field to Set - pub struct SetPeer(PhantomData S>); - impl sealed::Sealed for SetPeer {} - impl State for SetPeer { + type ContainerType = Set; type Counter = S::Counter; + } + ///State transition - sets the `counter` field to Set + pub struct SetCounter(PhantomData S>); + impl sealed::Sealed for SetCounter {} + impl State for SetCounter { + type Peer = S::Peer; type ContainerType = S::ContainerType; - type Peer = Set; + type Counter = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `counter` field - pub struct counter(()); - ///Marker type for the `container_type` field - pub struct container_type(()); ///Marker type for the `peer` field pub struct peer(()); + ///Marker type for the `container_type` field + pub struct container_type(()); + ///Marker type for the `counter` field + pub struct counter(()); } } @@ -1154,9 +1154,9 @@ where impl<'a, S> NormalContainerIdBuilder<'a, S> where S: normal_container_id_state::State, - S::Counter: normal_container_id_state::IsSet, - S::ContainerType: normal_container_id_state::IsSet, S::Peer: normal_container_id_state::IsSet, + S::ContainerType: normal_container_id_state::IsSet, + S::Counter: normal_container_id_state::IsSet, { /// Build the final struct pub fn build(self) -> NormalContainerId<'a> { diff --git a/crates/weaver-api/src/sh_weaver/edit/get_contributors.rs b/crates/weaver-api/src/sh_weaver/edit/get_contributors.rs new file mode 100644 index 0000000..c45e91f --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/edit/get_contributors.rs @@ -0,0 +1,172 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.edit.getContributors +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetContributors<'a> { + /// (default: true) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub include_cascaded: std::option::Option, + #[serde(borrow)] + pub resource: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_contributors_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Resource; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Resource = Unset; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Resource = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `resource` field + pub struct resource(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetContributorsBuilder<'a, S: get_contributors_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetContributors<'a> { + /// Create a new builder for this type + pub fn new() -> GetContributorsBuilder<'a, get_contributors_state::Empty> { + GetContributorsBuilder::new() + } +} + +impl<'a> GetContributorsBuilder<'a, get_contributors_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetContributorsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_contributors_state::State> GetContributorsBuilder<'a, S> { + /// Set the `includeCascaded` field (optional) + pub fn include_cascaded(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `includeCascaded` field to an Option value (optional) + pub fn maybe_include_cascaded(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> GetContributorsBuilder<'a, S> +where + S: get_contributors_state::State, + S::Resource: get_contributors_state::IsUnset, +{ + /// Set the `resource` field (required) + pub fn resource( + mut self, + value: impl Into>, + ) -> GetContributorsBuilder<'a, get_contributors_state::SetResource> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetContributorsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetContributorsBuilder<'a, S> +where + S: get_contributors_state::State, + S::Resource: get_contributors_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetContributors<'a> { + GetContributors { + include_cascaded: self.__unsafe_private_named.0, + resource: self.__unsafe_private_named.1.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetContributorsOutput<'a> { + #[serde(borrow)] + pub contributors: Vec>, +} + +/// Response type for +///sh.weaver.edit.getContributors +pub struct GetContributorsResponse; +impl jacquard_common::xrpc::XrpcResp for GetContributorsResponse { + const NSID: &'static str = "sh.weaver.edit.getContributors"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetContributorsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetContributors<'a> { + const NSID: &'static str = "sh.weaver.edit.getContributors"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetContributorsResponse; +} + +/// Endpoint type for +///sh.weaver.edit.getContributors +pub struct GetContributorsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetContributorsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.edit.getContributors"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetContributors<'de>; + type Response = GetContributorsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/edit/list_drafts.rs b/crates/weaver-api/src/sh_weaver/edit/list_drafts.rs new file mode 100644 index 0000000..817f0f0 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/edit/list_drafts.rs @@ -0,0 +1,693 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.edit.listDrafts +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Hydrated view of a draft with edit state. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct DraftView<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + pub created_at: jacquard_common::types::string::Datetime, + /// Associated edit root if one exists + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub edit_root: std::option::Option< + crate::com_atproto::repo::strong_ref::StrongRef<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub last_edit_at: std::option::Option, + /// Extracted title if available from edit state + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub title: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod draft_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type CreatedAt; + type Uri; + type Cid; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type CreatedAt = Unset; + type Uri = Unset; + type Cid = Unset; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type Uri = S::Uri; + type Cid = S::Cid; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type CreatedAt = S::CreatedAt; + type Uri = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type CreatedAt = S::CreatedAt; + type Uri = S::Uri; + type Cid = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DraftViewBuilder<'a, S: draft_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DraftView<'a> { + /// Create a new builder for this type + pub fn new() -> DraftViewBuilder<'a, draft_view_state::Empty> { + DraftViewBuilder::new() + } +} + +impl<'a> DraftViewBuilder<'a, draft_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DraftViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DraftViewBuilder<'a, S> +where + S: draft_view_state::State, + S::Cid: draft_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> DraftViewBuilder<'a, draft_view_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DraftViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DraftViewBuilder<'a, S> +where + S: draft_view_state::State, + S::CreatedAt: draft_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> DraftViewBuilder<'a, draft_view_state::SetCreatedAt> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + DraftViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: draft_view_state::State> DraftViewBuilder<'a, S> { + /// Set the `editRoot` field (optional) + pub fn edit_root( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `editRoot` field to an Option value (optional) + pub fn maybe_edit_root( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: draft_view_state::State> DraftViewBuilder<'a, S> { + /// Set the `lastEditAt` field (optional) + pub fn last_edit_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `lastEditAt` field to an Option value (optional) + pub fn maybe_last_edit_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: draft_view_state::State> DraftViewBuilder<'a, S> { + /// Set the `title` field (optional) + pub fn title( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `title` field to an Option value (optional) + pub fn maybe_title(mut self, value: Option>) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> DraftViewBuilder<'a, S> +where + S: draft_view_state::State, + S::Uri: draft_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> DraftViewBuilder<'a, draft_view_state::SetUri> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + DraftViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DraftViewBuilder<'a, S> +where + S: draft_view_state::State, + S::CreatedAt: draft_view_state::IsSet, + S::Uri: draft_view_state::IsSet, + S::Cid: draft_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DraftView<'a> { + DraftView { + cid: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + edit_root: self.__unsafe_private_named.2, + last_edit_at: self.__unsafe_private_named.3, + title: self.__unsafe_private_named.4, + uri: self.__unsafe_private_named.5.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> DraftView<'a> { + DraftView { + cid: self.__unsafe_private_named.0.unwrap(), + created_at: self.__unsafe_private_named.1.unwrap(), + edit_root: self.__unsafe_private_named.2, + last_edit_at: self.__unsafe_private_named.3, + title: self.__unsafe_private_named.4, + uri: self.__unsafe_private_named.5.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_sh_weaver_edit_listDrafts() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.edit.listDrafts"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("draftView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Hydrated view of a draft with edit state.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("editRoot"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "lastEditAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Extracted title if available from edit state", + ), + ), + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcQuery(::jacquard_lexicon::lexicon::LexXrpcQuery { + description: None, + parameters: Some( + ::jacquard_lexicon::lexicon::LexXrpcQueryParameter::Params(::jacquard_lexicon::lexicon::LexXrpcParameters { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("actor") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("actor"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID or handle of the actor", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtIdentifier, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cursor"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("limit"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map + }, + }), + ), + output: None, + errors: None, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DraftView<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.listDrafts" + } + fn def_name() -> &'static str { + "draftView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_listDrafts() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ListDrafts<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod list_drafts_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ListDraftsBuilder<'a, S: list_drafts_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ListDrafts<'a> { + /// Create a new builder for this type + pub fn new() -> ListDraftsBuilder<'a, list_drafts_state::Empty> { + ListDraftsBuilder::new() + } +} + +impl<'a> ListDraftsBuilder<'a, list_drafts_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ListDraftsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ListDraftsBuilder<'a, S> +where + S: list_drafts_state::State, + S::Actor: list_drafts_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> ListDraftsBuilder<'a, list_drafts_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ListDraftsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: list_drafts_state::State> ListDraftsBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: list_drafts_state::State> ListDraftsBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ListDraftsBuilder<'a, S> +where + S: list_drafts_state::State, + S::Actor: list_drafts_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ListDrafts<'a> { + ListDrafts { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ListDraftsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub drafts: Vec>, +} + +/// Response type for +///sh.weaver.edit.listDrafts +pub struct ListDraftsResponse; +impl jacquard_common::xrpc::XrpcResp for ListDraftsResponse { + const NSID: &'static str = "sh.weaver.edit.listDrafts"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListDraftsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ListDrafts<'a> { + const NSID: &'static str = "sh.weaver.edit.listDrafts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListDraftsResponse; +} + +/// Endpoint type for +///sh.weaver.edit.listDrafts +pub struct ListDraftsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListDraftsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.edit.listDrafts"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListDrafts<'de>; + type Response = ListDraftsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/edit/root.rs b/crates/weaver-api/src/sh_weaver/edit/root.rs index b53c569..f51bd45 100644 --- a/crates/weaver-api/src/sh_weaver/edit/root.rs +++ b/crates/weaver-api/src/sh_weaver/edit/root.rs @@ -34,37 +34,37 @@ pub mod root_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Doc; type Snapshot; + type Doc; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Doc = Unset; type Snapshot = Unset; - } - ///State transition - sets the `doc` field to Set - pub struct SetDoc(PhantomData S>); - impl sealed::Sealed for SetDoc {} - impl State for SetDoc { - type Doc = Set; - type Snapshot = S::Snapshot; + type Doc = Unset; } ///State transition - sets the `snapshot` field to Set pub struct SetSnapshot(PhantomData S>); impl sealed::Sealed for SetSnapshot {} impl State for SetSnapshot { - type Doc = S::Doc; type Snapshot = Set; + type Doc = S::Doc; + } + ///State transition - sets the `doc` field to Set + pub struct SetDoc(PhantomData S>); + impl sealed::Sealed for SetDoc {} + impl State for SetDoc { + type Snapshot = S::Snapshot; + type Doc = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `doc` field - pub struct doc(()); ///Marker type for the `snapshot` field pub struct snapshot(()); + ///Marker type for the `doc` field + pub struct doc(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> RootBuilder<'a, S> where S: root_state::State, - S::Doc: root_state::IsSet, S::Snapshot: root_state::IsSet, + S::Doc: root_state::IsSet, { /// Build the final struct pub fn build(self) -> Root<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/external.rs b/crates/weaver-api/src/sh_weaver/embed/external.rs index a8621b7..49b4af9 100644 --- a/crates/weaver-api/src/sh_weaver/embed/external.rs +++ b/crates/weaver-api/src/sh_weaver/embed/external.rs @@ -39,50 +39,50 @@ pub mod external_embed_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; - type Title; type Description; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; - type Title = Unset; type Description = Unset; + type Title = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Uri = Set; - type Title = S::Title; - type Description = S::Description; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Uri = S::Uri; - type Title = Set; type Description = S::Description; + type Title = S::Title; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData S>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { type Uri = S::Uri; - type Title = S::Title; type Description = Set; + type Title = S::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Uri = S::Uri; + type Description = S::Description; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `title` field - pub struct title(()); ///Marker type for the `description` field pub struct description(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -196,8 +196,8 @@ impl<'a, S> ExternalEmbedBuilder<'a, S> where S: external_embed_state::State, S::Uri: external_embed_state::IsSet, - S::Title: external_embed_state::IsSet, S::Description: external_embed_state::IsSet, + S::Title: external_embed_state::IsSet, { /// Build the final struct pub fn build(self) -> ExternalEmbed<'a> { @@ -817,51 +817,51 @@ pub mod view_external_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; - type Description; type Uri; + type Description; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Title = Unset; - type Description = Unset; type Uri = Unset; + type Description = Unset; + type Title = Unset; } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; type Description = S::Description; - type Uri = S::Uri; + type Title = S::Title; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData S>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { - type Title = S::Title; - type Description = Set; type Uri = S::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + type Description = Set; type Title = S::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Uri = S::Uri; type Description = S::Description; - type Uri = Set; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `title` field - pub struct title(()); - ///Marker type for the `description` field - pub struct description(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `description` field + pub struct description(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -974,9 +974,9 @@ where impl<'a, S> ViewExternalBuilder<'a, S> where S: view_external_state::State, - S::Title: view_external_state::IsSet, - S::Description: view_external_state::IsSet, S::Uri: view_external_state::IsSet, + S::Description: view_external_state::IsSet, + S::Title: view_external_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewExternal<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/images.rs b/crates/weaver-api/src/sh_weaver/embed/images.rs index aa61830..08a08c2 100644 --- a/crates/weaver-api/src/sh_weaver/embed/images.rs +++ b/crates/weaver-api/src/sh_weaver/embed/images.rs @@ -44,37 +44,37 @@ pub mod image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Image; type Alt; + type Image; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Image = Unset; type Alt = Unset; - } - ///State transition - sets the `image` field to Set - pub struct SetImage(PhantomData S>); - impl sealed::Sealed for SetImage {} - impl State for SetImage { - type Image = Set; - type Alt = S::Alt; + type Image = Unset; } ///State transition - sets the `alt` field to Set pub struct SetAlt(PhantomData S>); impl sealed::Sealed for SetAlt {} impl State for SetAlt { - type Image = S::Image; type Alt = Set; + type Image = S::Image; + } + ///State transition - sets the `image` field to Set + pub struct SetImage(PhantomData S>); + impl sealed::Sealed for SetImage {} + impl State for SetImage { + type Alt = S::Alt; + type Image = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `image` field - pub struct image(()); ///Marker type for the `alt` field pub struct alt(()); + ///Marker type for the `image` field + pub struct image(()); } } @@ -195,8 +195,8 @@ impl<'a, S: image_state::State> ImageBuilder<'a, S> { impl<'a, S> ImageBuilder<'a, S> where S: image_state::State, - S::Image: image_state::IsSet, S::Alt: image_state::IsSet, + S::Image: image_state::IsSet, { /// Build the final struct pub fn build(self) -> Image<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs b/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs index a286344..9da6986 100644 --- a/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs +++ b/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs @@ -323,37 +323,37 @@ pub mod view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Media; type Record; + type Media; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Media = Unset; type Record = Unset; - } - ///State transition - sets the `media` field to Set - pub struct SetMedia(PhantomData S>); - impl sealed::Sealed for SetMedia {} - impl State for SetMedia { - type Media = Set; - type Record = S::Record; + type Media = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Media = S::Media; type Record = Set; + type Media = S::Media; + } + ///State transition - sets the `media` field to Set + pub struct SetMedia(PhantomData S>); + impl sealed::Sealed for SetMedia {} + impl State for SetMedia { + type Record = S::Record; + type Media = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `media` field - pub struct media(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `media` field + pub struct media(()); } } @@ -426,8 +426,8 @@ impl<'a, S: view_state::State> ViewBuilder<'a, S> { impl<'a, S> ViewBuilder<'a, S> where S: view_state::State, - S::Media: view_state::IsSet, S::Record: view_state::IsSet, + S::Media: view_state::IsSet, { /// Build the final struct pub fn build(self) -> View<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/records.rs b/crates/weaver-api/src/sh_weaver/embed/records.rs index baccf06..83469cd 100644 --- a/crates/weaver-api/src/sh_weaver/embed/records.rs +++ b/crates/weaver-api/src/sh_weaver/embed/records.rs @@ -1187,49 +1187,49 @@ pub mod view_blocked_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Author; + type Uri; type Blocked; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Author = Unset; + type Uri = Unset; type Blocked = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Author = S::Author; - type Blocked = S::Blocked; - } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Uri = S::Uri; type Author = Set; + type Uri = S::Uri; + type Blocked = S::Blocked; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Author = S::Author; + type Uri = Set; type Blocked = S::Blocked; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData S>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { - type Uri = S::Uri; type Author = S::Author; + type Uri = S::Uri; type Blocked = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `blocked` field pub struct blocked(()); } @@ -1324,8 +1324,8 @@ where impl<'a, S> ViewBlockedBuilder<'a, S> where S: view_blocked_state::State, - S::Uri: view_blocked_state::IsSet, S::Author: view_blocked_state::IsSet, + S::Uri: view_blocked_state::IsSet, S::Blocked: view_blocked_state::IsSet, { /// Build the final struct @@ -1398,37 +1398,37 @@ pub mod view_detached_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Detached; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Detached = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Detached = S::Detached; + type Uri = Unset; } ///State transition - sets the `detached` field to Set pub struct SetDetached(PhantomData S>); impl sealed::Sealed for SetDetached {} impl State for SetDetached { - type Uri = S::Uri; type Detached = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Detached = S::Detached; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `detached` field pub struct detached(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1501,8 +1501,8 @@ where impl<'a, S> ViewDetachedBuilder<'a, S> where S: view_detached_state::State, - S::Uri: view_detached_state::IsSet, S::Detached: view_detached_state::IsSet, + S::Uri: view_detached_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewDetached<'a> { @@ -1770,9 +1770,9 @@ pub mod view_record_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Value; + type Uri; type Author; type IndexedAt; - type Uri; type Cid; } /// Empty state - all required fields are unset @@ -1780,9 +1780,9 @@ pub mod view_record_state { impl sealed::Sealed for Empty {} impl State for Empty { type Value = Unset; + type Uri = Unset; type Author = Unset; type IndexedAt = Unset; - type Uri = Unset; type Cid = Unset; } ///State transition - sets the `value` field to Set @@ -1790,9 +1790,19 @@ pub mod view_record_state { impl sealed::Sealed for SetValue {} impl State for SetValue { type Value = Set; + type Uri = S::Uri; + type Author = S::Author; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Value = S::Value; + type Uri = Set; type Author = S::Author; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; type Cid = S::Cid; } ///State transition - sets the `author` field to Set @@ -1800,9 +1810,9 @@ pub mod view_record_state { impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Value = S::Value; + type Uri = S::Uri; type Author = Set; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; type Cid = S::Cid; } ///State transition - sets the `indexed_at` field to Set @@ -1810,19 +1820,9 @@ pub mod view_record_state { impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Value = S::Value; - type Author = S::Author; - type IndexedAt = Set; type Uri = S::Uri; - type Cid = S::Cid; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Value = S::Value; type Author = S::Author; - type IndexedAt = S::IndexedAt; - type Uri = Set; + type IndexedAt = Set; type Cid = S::Cid; } ///State transition - sets the `cid` field to Set @@ -1830,9 +1830,9 @@ pub mod view_record_state { impl sealed::Sealed for SetCid {} impl State for SetCid { type Value = S::Value; + type Uri = S::Uri; type Author = S::Author; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; type Cid = Set; } /// Marker types for field names @@ -1840,12 +1840,12 @@ pub mod view_record_state { pub mod members { ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `author` field pub struct author(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); } @@ -2093,9 +2093,9 @@ impl<'a, S> ViewRecordBuilder<'a, S> where S: view_record_state::State, S::Value: view_record_state::IsSet, + S::Uri: view_record_state::IsSet, S::Author: view_record_state::IsSet, S::IndexedAt: view_record_state::IsSet, - S::Uri: view_record_state::IsSet, S::Cid: view_record_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/embed/video.rs b/crates/weaver-api/src/sh_weaver/embed/video.rs index c4629c2..c81e035 100644 --- a/crates/weaver-api/src/sh_weaver/embed/video.rs +++ b/crates/weaver-api/src/sh_weaver/embed/video.rs @@ -940,37 +940,37 @@ pub mod view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Playlist; type Cid; + type Playlist; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Playlist = Unset; type Cid = Unset; - } - ///State transition - sets the `playlist` field to Set - pub struct SetPlaylist(PhantomData S>); - impl sealed::Sealed for SetPlaylist {} - impl State for SetPlaylist { - type Playlist = Set; - type Cid = S::Cid; + type Playlist = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Playlist = S::Playlist; type Cid = Set; + type Playlist = S::Playlist; + } + ///State transition - sets the `playlist` field to Set + pub struct SetPlaylist(PhantomData S>); + impl sealed::Sealed for SetPlaylist {} + impl State for SetPlaylist { + type Cid = S::Cid; + type Playlist = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `playlist` field - pub struct playlist(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `playlist` field + pub struct playlist(()); } } @@ -1108,8 +1108,8 @@ impl<'a, S: view_state::State> ViewBuilder<'a, S> { impl<'a, S> ViewBuilder<'a, S> where S: view_state::State, - S::Playlist: view_state::IsSet, S::Cid: view_state::IsSet, + S::Playlist: view_state::IsSet, { /// Build the final struct pub fn build(self) -> View<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/follow.rs b/crates/weaver-api/src/sh_weaver/graph/follow.rs index f618fef..c20dc16 100644 --- a/crates/weaver-api/src/sh_weaver/graph/follow.rs +++ b/crates/weaver-api/src/sh_weaver/graph/follow.rs @@ -34,37 +34,37 @@ pub mod follow_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = S::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = S::CreatedAt; type Subject = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> FollowBuilder<'a, S> where S: follow_state::State, - S::CreatedAt: follow_state::IsSet, S::Subject: follow_state::IsSet, + S::CreatedAt: follow_state::IsSet, { /// Build the final struct pub fn build(self) -> Follow<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs b/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs index 19d3517..f92a05f 100644 --- a/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs +++ b/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs @@ -34,37 +34,37 @@ pub mod follow_accept_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Follow; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Follow = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Follow = S::Follow; + type CreatedAt = Unset; } ///State transition - sets the `follow` field to Set pub struct SetFollow(PhantomData S>); impl sealed::Sealed for SetFollow {} impl State for SetFollow { - type CreatedAt = S::CreatedAt; type Follow = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Follow = S::Follow; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `follow` field pub struct follow(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> FollowAcceptBuilder<'a, S> where S: follow_accept_state::State, - S::CreatedAt: follow_accept_state::IsSet, S::Follow: follow_accept_state::IsSet, + S::CreatedAt: follow_accept_state::IsSet, { /// Build the final struct pub fn build(self) -> FollowAccept<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/listitem.rs b/crates/weaver-api/src/sh_weaver/graph/listitem.rs index 07064c0..114f355 100644 --- a/crates/weaver-api/src/sh_weaver/graph/listitem.rs +++ b/crates/weaver-api/src/sh_weaver/graph/listitem.rs @@ -37,49 +37,49 @@ pub mod listitem_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type List; type Subject; + type List; type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type List = Unset; type Subject = Unset; + type List = Unset; type CreatedAt = Unset; } - ///State transition - sets the `list` field to Set - pub struct SetList(PhantomData S>); - impl sealed::Sealed for SetList {} - impl State for SetList { - type List = Set; - type Subject = S::Subject; - type CreatedAt = S::CreatedAt; - } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type List = S::List; type Subject = Set; + type List = S::List; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `list` field to Set + pub struct SetList(PhantomData S>); + impl sealed::Sealed for SetList {} + impl State for SetList { + type Subject = S::Subject; + type List = Set; type CreatedAt = S::CreatedAt; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type List = S::List; type Subject = S::Subject; + type List = S::List; type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `list` field - pub struct list(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `list` field + pub struct list(()); ///Marker type for the `created_at` field pub struct created_at(()); } @@ -174,8 +174,8 @@ where impl<'a, S> ListitemBuilder<'a, S> where S: listitem_state::State, - S::List: listitem_state::IsSet, S::Subject: listitem_state::IsSet, + S::List: listitem_state::IsSet, S::CreatedAt: listitem_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/graph/subscribe.rs b/crates/weaver-api/src/sh_weaver/graph/subscribe.rs index 88e2b72..eae9514 100644 --- a/crates/weaver-api/src/sh_weaver/graph/subscribe.rs +++ b/crates/weaver-api/src/sh_weaver/graph/subscribe.rs @@ -34,37 +34,37 @@ pub mod subscribe_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Notebook; type CreatedAt; + type Notebook; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Notebook = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `notebook` field to Set - pub struct SetNotebook(PhantomData S>); - impl sealed::Sealed for SetNotebook {} - impl State for SetNotebook { - type Notebook = Set; - type CreatedAt = S::CreatedAt; + type Notebook = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Notebook = S::Notebook; type CreatedAt = Set; + type Notebook = S::Notebook; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type CreatedAt = S::CreatedAt; + type Notebook = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `notebook` field - pub struct notebook(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `notebook` field + pub struct notebook(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> SubscribeBuilder<'a, S> where S: subscribe_state::State, - S::Notebook: subscribe_state::IsSet, S::CreatedAt: subscribe_state::IsSet, + S::Notebook: subscribe_state::IsSet, { /// Build the final struct pub fn build(self) -> Subscribe<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/subscribe_accept.rs b/crates/weaver-api/src/sh_weaver/graph/subscribe_accept.rs index 0062a2b..79682a6 100644 --- a/crates/weaver-api/src/sh_weaver/graph/subscribe_accept.rs +++ b/crates/weaver-api/src/sh_weaver/graph/subscribe_accept.rs @@ -34,37 +34,37 @@ pub mod subscribe_accept_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subscribe; type CreatedAt; + type Subscribe; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subscribe = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `subscribe` field to Set - pub struct SetSubscribe(PhantomData S>); - impl sealed::Sealed for SetSubscribe {} - impl State for SetSubscribe { - type Subscribe = Set; - type CreatedAt = S::CreatedAt; + type Subscribe = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Subscribe = S::Subscribe; type CreatedAt = Set; + type Subscribe = S::Subscribe; + } + ///State transition - sets the `subscribe` field to Set + pub struct SetSubscribe(PhantomData S>); + impl sealed::Sealed for SetSubscribe {} + impl State for SetSubscribe { + type CreatedAt = S::CreatedAt; + type Subscribe = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subscribe` field - pub struct subscribe(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `subscribe` field + pub struct subscribe(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> SubscribeAcceptBuilder<'a, S> where S: subscribe_accept_state::State, - S::Subscribe: subscribe_accept_state::IsSet, S::CreatedAt: subscribe_accept_state::IsSet, + S::Subscribe: subscribe_accept_state::IsSet, { /// Build the final struct pub fn build(self) -> SubscribeAccept<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/tag.rs b/crates/weaver-api/src/sh_weaver/graph/tag.rs index fa3ca91..a967642 100644 --- a/crates/weaver-api/src/sh_weaver/graph/tag.rs +++ b/crates/weaver-api/src/sh_weaver/graph/tag.rs @@ -37,51 +37,51 @@ pub mod tag_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; - type Tag; type CreatedAt; + type Tag; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; - type Tag = Unset; type CreatedAt = Unset; + type Tag = Unset; + type Subject = Unset; } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; type Tag = S::Tag; - type CreatedAt = S::CreatedAt; + type Subject = S::Subject; } ///State transition - sets the `tag` field to Set pub struct SetTag(PhantomData S>); impl sealed::Sealed for SetTag {} impl State for SetTag { - type Subject = S::Subject; - type Tag = Set; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { + type Tag = Set; type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type CreatedAt = S::CreatedAt; type Tag = S::Tag; - type CreatedAt = Set; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); - ///Marker type for the `tag` field - pub struct tag(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `tag` field + pub struct tag(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -174,9 +174,9 @@ where impl<'a, S> TagBuilder<'a, S> where S: tag_state::State, - S::Subject: tag_state::IsSet, - S::Tag: tag_state::IsSet, S::CreatedAt: tag_state::IsSet, + S::Tag: tag_state::IsSet, + S::Subject: tag_state::IsSet, { /// Build the final struct pub fn build(self) -> Tag<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook.rs b/crates/weaver-api/src/sh_weaver/notebook.rs index d7086dd..c3813f5 100644 --- a/crates/weaver-api/src/sh_weaver/notebook.rs +++ b/crates/weaver-api/src/sh_weaver/notebook.rs @@ -17,6 +17,7 @@ pub mod get_entry; pub mod get_entry_by_title; pub mod get_entry_detail; pub mod get_entry_feed; +pub mod get_entry_notebooks; pub mod get_notebook; pub mod get_notebook_by_title; pub mod get_notebook_chapters; @@ -2464,37 +2465,37 @@ pub mod chapter_entry_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Index; type Entry; + type Index; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Index = Unset; type Entry = Unset; - } - ///State transition - sets the `index` field to Set - pub struct SetIndex(PhantomData S>); - impl sealed::Sealed for SetIndex {} - impl State for SetIndex { - type Index = Set; - type Entry = S::Entry; + type Index = Unset; } ///State transition - sets the `entry` field to Set pub struct SetEntry(PhantomData S>); impl sealed::Sealed for SetEntry {} impl State for SetEntry { - type Index = S::Index; type Entry = Set; + type Index = S::Index; + } + ///State transition - sets the `index` field to Set + pub struct SetIndex(PhantomData S>); + impl sealed::Sealed for SetIndex {} + impl State for SetIndex { + type Entry = S::Entry; + type Index = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `index` field - pub struct index(()); ///Marker type for the `entry` field pub struct entry(()); + ///Marker type for the `index` field + pub struct index(()); } } @@ -2607,8 +2608,8 @@ impl<'a, S: chapter_entry_view_state::State> ChapterEntryViewBuilder<'a, S> { impl<'a, S> ChapterEntryViewBuilder<'a, S> where S: chapter_entry_view_state::State, - S::Index: chapter_entry_view_state::IsSet, S::Entry: chapter_entry_view_state::IsSet, + S::Index: chapter_entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ChapterEntryView<'a> { @@ -2693,105 +2694,105 @@ pub mod chapter_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type IndexedAt; type Record; + type Authors; type Uri; - type Notebook; type Cid; - type Authors; - type IndexedAt; + type Notebook; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type IndexedAt = Unset; type Record = Unset; + type Authors = Unset; type Uri = Unset; - type Notebook = Unset; type Cid = Unset; - type Authors = Unset; - type IndexedAt = Unset; + type Notebook = Unset; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; + type Record = S::Record; + type Authors = S::Authors; + type Uri = S::Uri; + type Cid = S::Cid; + type Notebook = S::Notebook; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { + type IndexedAt = S::IndexedAt; type Record = Set; + type Authors = S::Authors; type Uri = S::Uri; - type Notebook = S::Notebook; type Cid = S::Cid; - type Authors = S::Authors; + type Notebook = S::Notebook; + } + ///State transition - sets the `authors` field to Set + pub struct SetAuthors(PhantomData S>); + impl sealed::Sealed for SetAuthors {} + impl State for SetAuthors { type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Authors = Set; + type Uri = S::Uri; + type Cid = S::Cid; + type Notebook = S::Notebook; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Record = S::Record; - type Uri = Set; - type Notebook = S::Notebook; - type Cid = S::Cid; - type Authors = S::Authors; type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `notebook` field to Set - pub struct SetNotebook(PhantomData S>); - impl sealed::Sealed for SetNotebook {} - impl State for SetNotebook { type Record = S::Record; - type Uri = S::Uri; - type Notebook = Set; - type Cid = S::Cid; type Authors = S::Authors; - type IndexedAt = S::IndexedAt; + type Uri = Set; + type Cid = S::Cid; + type Notebook = S::Notebook; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Record = S::Record; - type Uri = S::Uri; - type Notebook = S::Notebook; - type Cid = Set; - type Authors = S::Authors; type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `authors` field to Set - pub struct SetAuthors(PhantomData S>); - impl sealed::Sealed for SetAuthors {} - impl State for SetAuthors { type Record = S::Record; + type Authors = S::Authors; type Uri = S::Uri; + type Cid = Set; type Notebook = S::Notebook; - type Cid = S::Cid; - type Authors = Set; - type IndexedAt = S::IndexedAt; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type IndexedAt = S::IndexedAt; type Record = S::Record; + type Authors = S::Authors; type Uri = S::Uri; - type Notebook = S::Notebook; type Cid = S::Cid; - type Authors = S::Authors; - type IndexedAt = Set; + type Notebook = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `authors` field + pub struct authors(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `notebook` field - pub struct notebook(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `authors` field - pub struct authors(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `notebook` field + pub struct notebook(()); } } @@ -2989,12 +2990,12 @@ where impl<'a, S> ChapterViewBuilder<'a, S> where S: chapter_view_state::State, + S::IndexedAt: chapter_view_state::IsSet, S::Record: chapter_view_state::IsSet, + S::Authors: chapter_view_state::IsSet, S::Uri: chapter_view_state::IsSet, - S::Notebook: chapter_view_state::IsSet, S::Cid: chapter_view_state::IsSet, - S::Authors: chapter_view_state::IsSet, - S::IndexedAt: chapter_view_state::IsSet, + S::Notebook: chapter_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ChapterView<'a> { @@ -3355,85 +3356,85 @@ pub mod entry_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Authors; type Uri; type Cid; - type Authors; - type Record; type IndexedAt; + type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Authors = Unset; type Uri = Unset; type Cid = Unset; - type Authors = Unset; - type Record = Unset; type IndexedAt = Unset; + type Record = Unset; + } + ///State transition - sets the `authors` field to Set + pub struct SetAuthors(PhantomData S>); + impl sealed::Sealed for SetAuthors {} + impl State for SetAuthors { + type Authors = Set; + type Uri = S::Uri; + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Record = S::Record; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { + type Authors = S::Authors; type Uri = Set; type Cid = S::Cid; - type Authors = S::Authors; - type Record = S::Record; type IndexedAt = S::IndexedAt; + type Record = S::Record; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { + type Authors = S::Authors; type Uri = S::Uri; type Cid = Set; - type Authors = S::Authors; - type Record = S::Record; type IndexedAt = S::IndexedAt; + type Record = S::Record; } - ///State transition - sets the `authors` field to Set - pub struct SetAuthors(PhantomData S>); - impl sealed::Sealed for SetAuthors {} - impl State for SetAuthors { + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Authors = S::Authors; type Uri = S::Uri; type Cid = S::Cid; - type Authors = Set; + type IndexedAt = Set; type Record = S::Record; - type IndexedAt = S::IndexedAt; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Uri = S::Uri; - type Cid = S::Cid; type Authors = S::Authors; - type Record = Set; - type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { type Uri = S::Uri; type Cid = S::Cid; - type Authors = S::Authors; - type Record = S::Record; - type IndexedAt = Set; + type IndexedAt = S::IndexedAt; + type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `authors` field + pub struct authors(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `authors` field - pub struct authors(()); - ///Marker type for the `record` field - pub struct record(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -3742,11 +3743,11 @@ impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { impl<'a, S> EntryViewBuilder<'a, S> where S: entry_view_state::State, + S::Authors: entry_view_state::IsSet, S::Uri: entry_view_state::IsSet, S::Cid: entry_view_state::IsSet, - S::Authors: entry_view_state::IsSet, - S::Record: entry_view_state::IsSet, S::IndexedAt: entry_view_state::IsSet, + S::Record: entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> EntryView<'a> { @@ -4024,37 +4025,37 @@ pub mod feed_notebook_context_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; type Uri; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Title = Unset; type Uri = Unset; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; - type Uri = S::Uri; + type Title = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Title = S::Title; type Uri = Set; + type Title = S::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Uri = S::Uri; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `title` field - pub struct title(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -4141,8 +4142,8 @@ where impl<'a, S> FeedNotebookContextBuilder<'a, S> where S: feed_notebook_context_state::State, - S::Title: feed_notebook_context_state::IsSet, S::Uri: feed_notebook_context_state::IsSet, + S::Title: feed_notebook_context_state::IsSet, { /// Build the final struct pub fn build(self) -> FeedNotebookContext<'a> { @@ -4263,85 +4264,85 @@ pub mod notebook_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; - type Record; - type Authors; type IndexedAt; + type Record; type Cid; + type Authors; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; - type Record = Unset; - type Authors = Unset; type IndexedAt = Unset; + type Record = Unset; type Cid = Unset; + type Authors = Unset; + type Uri = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; type Record = S::Record; - type Authors = S::Authors; - type IndexedAt = S::IndexedAt; type Cid = S::Cid; + type Authors = S::Authors; + type Uri = S::Uri; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Uri = S::Uri; + type IndexedAt = S::IndexedAt; type Record = Set; + type Cid = S::Cid; type Authors = S::Authors; + type Uri = S::Uri; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type IndexedAt = S::IndexedAt; - type Cid = S::Cid; + type Record = S::Record; + type Cid = Set; + type Authors = S::Authors; + type Uri = S::Uri; } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { - type Uri = S::Uri; - type Record = S::Record; - type Authors = Set; type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Uri = S::Uri; type Record = S::Record; - type Authors = S::Authors; - type IndexedAt = Set; type Cid = S::Cid; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { + type Authors = Set; type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type IndexedAt = S::IndexedAt; type Record = S::Record; + type Cid = S::Cid; type Authors = S::Authors; - type IndexedAt = S::IndexedAt; - type Cid = Set; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `authors` field - pub struct authors(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `record` field + pub struct record(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `authors` field + pub struct authors(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -4678,11 +4679,11 @@ impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { impl<'a, S> NotebookViewBuilder<'a, S> where S: notebook_view_state::State, - S::Uri: notebook_view_state::IsSet, - S::Record: notebook_view_state::IsSet, - S::Authors: notebook_view_state::IsSet, S::IndexedAt: notebook_view_state::IsSet, + S::Record: notebook_view_state::IsSet, S::Cid: notebook_view_state::IsSet, + S::Authors: notebook_view_state::IsSet, + S::Uri: notebook_view_state::IsSet, { /// Build the final struct pub fn build(self) -> NotebookView<'a> { @@ -4791,85 +4792,85 @@ pub mod page_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; - type Uri; + type Notebook; type IndexedAt; + type Record; type Cid; - type Notebook; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Record = Unset; - type Uri = Unset; + type Notebook = Unset; type IndexedAt = Unset; + type Record = Unset; type Cid = Unset; - type Notebook = Unset; + type Uri = Unset; } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Record = Set; - type Uri = S::Uri; + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Notebook = Set; type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - type Notebook = S::Notebook; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { type Record = S::Record; - type Uri = Set; - type IndexedAt = S::IndexedAt; type Cid = S::Cid; - type Notebook = S::Notebook; + type Uri = S::Uri; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Record = S::Record; - type Uri = S::Uri; + type Notebook = S::Notebook; type IndexedAt = Set; + type Record = S::Record; type Cid = S::Cid; + type Uri = S::Uri; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { type Notebook = S::Notebook; + type IndexedAt = S::IndexedAt; + type Record = Set; + type Cid = S::Cid; + type Uri = S::Uri; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Record = S::Record; - type Uri = S::Uri; - type IndexedAt = S::IndexedAt; - type Cid = Set; type Notebook = S::Notebook; - } - ///State transition - sets the `notebook` field to Set - pub struct SetNotebook(PhantomData S>); - impl sealed::Sealed for SetNotebook {} - impl State for SetNotebook { + type IndexedAt = S::IndexedAt; type Record = S::Record; + type Cid = Set; type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Notebook = S::Notebook; type IndexedAt = S::IndexedAt; + type Record = S::Record; type Cid = S::Cid; - type Notebook = Set; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `notebook` field + pub struct notebook(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `record` field + pub struct record(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `notebook` field - pub struct notebook(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -5047,11 +5048,11 @@ where impl<'a, S> PageViewBuilder<'a, S> where S: page_view_state::State, - S::Record: page_view_state::IsSet, - S::Uri: page_view_state::IsSet, + S::Notebook: page_view_state::IsSet, S::IndexedAt: page_view_state::IsSet, + S::Record: page_view_state::IsSet, S::Cid: page_view_state::IsSet, - S::Notebook: page_view_state::IsSet, + S::Uri: page_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PageView<'a> { @@ -5137,67 +5138,67 @@ pub mod permission_grant_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Source; type GrantedAt; type Did; type Scope; - type Source; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Source = Unset; type GrantedAt = Unset; type Did = Unset; type Scope = Unset; - type Source = Unset; + } + ///State transition - sets the `source` field to Set + pub struct SetSource(PhantomData S>); + impl sealed::Sealed for SetSource {} + impl State for SetSource { + type Source = Set; + type GrantedAt = S::GrantedAt; + type Did = S::Did; + type Scope = S::Scope; } ///State transition - sets the `granted_at` field to Set pub struct SetGrantedAt(PhantomData S>); impl sealed::Sealed for SetGrantedAt {} impl State for SetGrantedAt { + type Source = S::Source; type GrantedAt = Set; type Did = S::Did; type Scope = S::Scope; - type Source = S::Source; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { + type Source = S::Source; type GrantedAt = S::GrantedAt; type Did = Set; type Scope = S::Scope; - type Source = S::Source; } ///State transition - sets the `scope` field to Set pub struct SetScope(PhantomData S>); impl sealed::Sealed for SetScope {} impl State for SetScope { - type GrantedAt = S::GrantedAt; - type Did = S::Did; - type Scope = Set; type Source = S::Source; - } - ///State transition - sets the `source` field to Set - pub struct SetSource(PhantomData S>); - impl sealed::Sealed for SetSource {} - impl State for SetSource { type GrantedAt = S::GrantedAt; type Did = S::Did; - type Scope = S::Scope; - type Source = Set; + type Scope = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `source` field + pub struct source(()); ///Marker type for the `granted_at` field pub struct granted_at(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `scope` field pub struct scope(()); - ///Marker type for the `source` field - pub struct source(()); } } @@ -5310,10 +5311,10 @@ where impl<'a, S> PermissionGrantBuilder<'a, S> where S: permission_grant_state::State, + S::Source: permission_grant_state::IsSet, S::GrantedAt: permission_grant_state::IsSet, S::Did: permission_grant_state::IsSet, S::Scope: permission_grant_state::IsSet, - S::Source: permission_grant_state::IsSet, { /// Build the final struct pub fn build(self) -> PermissionGrant<'a> { @@ -5555,67 +5556,67 @@ pub mod published_version_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Uri; - type Publisher; type PublishedAt; + type Publisher; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Uri = Unset; - type Publisher = Unset; type PublishedAt = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Uri = S::Uri; - type Publisher = S::Publisher; - type PublishedAt = S::PublishedAt; + type Publisher = Unset; + type Cid = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = S::Cid; type Uri = Set; - type Publisher = S::Publisher; type PublishedAt = S::PublishedAt; + type Publisher = S::Publisher; + type Cid = S::Cid; + } + ///State transition - sets the `published_at` field to Set + pub struct SetPublishedAt(PhantomData S>); + impl sealed::Sealed for SetPublishedAt {} + impl State for SetPublishedAt { + type Uri = S::Uri; + type PublishedAt = Set; + type Publisher = S::Publisher; + type Cid = S::Cid; } ///State transition - sets the `publisher` field to Set pub struct SetPublisher(PhantomData S>); impl sealed::Sealed for SetPublisher {} impl State for SetPublisher { - type Cid = S::Cid; type Uri = S::Uri; - type Publisher = Set; type PublishedAt = S::PublishedAt; - } - ///State transition - sets the `published_at` field to Set - pub struct SetPublishedAt(PhantomData S>); - impl sealed::Sealed for SetPublishedAt {} - impl State for SetPublishedAt { + type Publisher = Set; type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type Uri = S::Uri; + type PublishedAt = S::PublishedAt; type Publisher = S::Publisher; - type PublishedAt = Set; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `publisher` field - pub struct publisher(()); ///Marker type for the `published_at` field pub struct published_at(()); + ///Marker type for the `publisher` field + pub struct publisher(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -5782,10 +5783,10 @@ where impl<'a, S> PublishedVersionViewBuilder<'a, S> where S: published_version_view_state::State, - S::Cid: published_version_view_state::IsSet, S::Uri: published_version_view_state::IsSet, - S::Publisher: published_version_view_state::IsSet, S::PublishedAt: published_version_view_state::IsSet, + S::Publisher: published_version_view_state::IsSet, + S::Cid: published_version_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PublishedVersionView<'a> { @@ -5929,37 +5930,37 @@ pub mod reason_bookmark_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type By; type IndexedAt; + type By; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type By = Unset; type IndexedAt = Unset; - } - ///State transition - sets the `by` field to Set - pub struct SetBy(PhantomData S>); - impl sealed::Sealed for SetBy {} - impl State for SetBy { - type By = Set; - type IndexedAt = S::IndexedAt; + type By = Unset; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type By = S::By; type IndexedAt = Set; + type By = S::By; + } + ///State transition - sets the `by` field to Set + pub struct SetBy(PhantomData S>); + impl sealed::Sealed for SetBy {} + impl State for SetBy { + type IndexedAt = S::IndexedAt; + type By = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `by` field - pub struct by(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `by` field + pub struct by(()); } } @@ -6032,8 +6033,8 @@ where impl<'a, S> ReasonBookmarkBuilder<'a, S> where S: reason_bookmark_state::State, - S::By: reason_bookmark_state::IsSet, S::IndexedAt: reason_bookmark_state::IsSet, + S::By: reason_bookmark_state::IsSet, { /// Build the final struct pub fn build(self) -> ReasonBookmark<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/chapter.rs b/crates/weaver-api/src/sh_weaver/notebook/chapter.rs index dd59e10..46aa268 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/chapter.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/chapter.rs @@ -54,51 +54,51 @@ pub mod chapter_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Notebook; type Authors; type EntryList; + type Notebook; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Notebook = Unset; type Authors = Unset; type EntryList = Unset; - } - ///State transition - sets the `notebook` field to Set - pub struct SetNotebook(PhantomData S>); - impl sealed::Sealed for SetNotebook {} - impl State for SetNotebook { - type Notebook = Set; - type Authors = S::Authors; - type EntryList = S::EntryList; + type Notebook = Unset; } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { - type Notebook = S::Notebook; type Authors = Set; type EntryList = S::EntryList; + type Notebook = S::Notebook; } ///State transition - sets the `entry_list` field to Set pub struct SetEntryList(PhantomData S>); impl sealed::Sealed for SetEntryList {} impl State for SetEntryList { - type Notebook = S::Notebook; type Authors = S::Authors; type EntryList = Set; + type Notebook = S::Notebook; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Authors = S::Authors; + type EntryList = S::EntryList; + type Notebook = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `notebook` field - pub struct notebook(()); ///Marker type for the `authors` field pub struct authors(()); ///Marker type for the `entry_list` field pub struct entry_list(()); + ///Marker type for the `notebook` field + pub struct notebook(()); } } @@ -291,9 +291,9 @@ impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { impl<'a, S> ChapterBuilder<'a, S> where S: chapter_state::State, - S::Notebook: chapter_state::IsSet, S::Authors: chapter_state::IsSet, S::EntryList: chapter_state::IsSet, + S::Notebook: chapter_state::IsSet, { /// Build the final struct pub fn build(self) -> Chapter<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs b/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs index 1f3bee8..9e5d523 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs @@ -38,51 +38,51 @@ pub mod colour_scheme_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Variant; type Colours; type Name; + type Variant; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Variant = Unset; type Colours = Unset; type Name = Unset; - } - ///State transition - sets the `variant` field to Set - pub struct SetVariant(PhantomData S>); - impl sealed::Sealed for SetVariant {} - impl State for SetVariant { - type Variant = Set; - type Colours = S::Colours; - type Name = S::Name; + type Variant = Unset; } ///State transition - sets the `colours` field to Set pub struct SetColours(PhantomData S>); impl sealed::Sealed for SetColours {} impl State for SetColours { - type Variant = S::Variant; type Colours = Set; type Name = S::Name; + type Variant = S::Variant; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Variant = S::Variant; type Colours = S::Colours; type Name = Set; + type Variant = S::Variant; + } + ///State transition - sets the `variant` field to Set + pub struct SetVariant(PhantomData S>); + impl sealed::Sealed for SetVariant {} + impl State for SetVariant { + type Colours = S::Colours; + type Name = S::Name; + type Variant = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `variant` field - pub struct variant(()); ///Marker type for the `colours` field pub struct colours(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `variant` field + pub struct variant(()); } } @@ -175,9 +175,9 @@ where impl<'a, S> ColourSchemeBuilder<'a, S> where S: colour_scheme_state::State, - S::Variant: colour_scheme_state::IsSet, S::Colours: colour_scheme_state::IsSet, S::Name: colour_scheme_state::IsSet, + S::Variant: colour_scheme_state::IsSet, { /// Build the final struct pub fn build(self) -> ColourScheme<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/entry.rs b/crates/weaver-api/src/sh_weaver/notebook/entry.rs index c003c85..35f5848 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/entry.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/entry.rs @@ -61,8 +61,8 @@ pub mod entry_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Path; - type CreatedAt; type Title; + type CreatedAt; type Content; } /// Empty state - all required fields are unset @@ -70,8 +70,8 @@ pub mod entry_state { impl sealed::Sealed for Empty {} impl State for Empty { type Path = Unset; - type CreatedAt = Unset; type Title = Unset; + type CreatedAt = Unset; type Content = Unset; } ///State transition - sets the `path` field to Set @@ -79,17 +79,8 @@ pub mod entry_state { impl sealed::Sealed for SetPath {} impl State for SetPath { type Path = Set; - type CreatedAt = S::CreatedAt; - type Title = S::Title; - type Content = S::Content; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Path = S::Path; - type CreatedAt = Set; type Title = S::Title; + type CreatedAt = S::CreatedAt; type Content = S::Content; } ///State transition - sets the `title` field to Set @@ -97,8 +88,17 @@ pub mod entry_state { impl sealed::Sealed for SetTitle {} impl State for SetTitle { type Path = S::Path; - type CreatedAt = S::CreatedAt; type Title = Set; + type CreatedAt = S::CreatedAt; + type Content = S::Content; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Path = S::Path; + type Title = S::Title; + type CreatedAt = Set; type Content = S::Content; } ///State transition - sets the `content` field to Set @@ -106,8 +106,8 @@ pub mod entry_state { impl sealed::Sealed for SetContent {} impl State for SetContent { type Path = S::Path; - type CreatedAt = S::CreatedAt; type Title = S::Title; + type CreatedAt = S::CreatedAt; type Content = Set; } /// Marker types for field names @@ -115,10 +115,10 @@ pub mod entry_state { pub mod members { ///Marker type for the `path` field pub struct path(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `title` field pub struct title(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `content` field pub struct content(()); } @@ -359,8 +359,8 @@ impl<'a, S> EntryBuilder<'a, S> where S: entry_state::State, S::Path: entry_state::IsSet, - S::CreatedAt: entry_state::IsSet, S::Title: entry_state::IsSet, + S::CreatedAt: entry_state::IsSet, S::Content: entry_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_entry_by_title.rs b/crates/weaver-api/src/sh_weaver/notebook/get_entry_by_title.rs index 7ef15dc..d0bb77c 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/get_entry_by_title.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/get_entry_by_title.rs @@ -32,37 +32,37 @@ pub mod get_entry_by_title_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; type Notebook; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Title = Unset; type Notebook = Unset; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; - type Notebook = S::Notebook; + type Title = Unset; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { - type Title = S::Title; type Notebook = Set; + type Title = S::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Notebook = S::Notebook; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `title` field - pub struct title(()); ///Marker type for the `notebook` field pub struct notebook(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> GetEntryByTitleBuilder<'a, S> where S: get_entry_by_title_state::State, - S::Title: get_entry_by_title_state::IsSet, S::Notebook: get_entry_by_title_state::IsSet, + S::Title: get_entry_by_title_state::IsSet, { /// Build the final struct pub fn build(self) -> GetEntryByTitle<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_entry_notebooks.rs b/crates/weaver-api/src/sh_weaver/notebook/get_entry_notebooks.rs new file mode 100644 index 0000000..a5ee733 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_entry_notebooks.rs @@ -0,0 +1,516 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getEntryNotebooks +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetEntryNotebooks<'a> { + #[serde(borrow)] + pub entry: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_entry_notebooks_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Entry; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Entry = Unset; + } + ///State transition - sets the `entry` field to Set + pub struct SetEntry(PhantomData S>); + impl sealed::Sealed for SetEntry {} + impl State for SetEntry { + type Entry = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `entry` field + pub struct entry(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetEntryNotebooksBuilder<'a, S: get_entry_notebooks_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetEntryNotebooks<'a> { + /// Create a new builder for this type + pub fn new() -> GetEntryNotebooksBuilder<'a, get_entry_notebooks_state::Empty> { + GetEntryNotebooksBuilder::new() + } +} + +impl<'a> GetEntryNotebooksBuilder<'a, get_entry_notebooks_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetEntryNotebooksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetEntryNotebooksBuilder<'a, S> +where + S: get_entry_notebooks_state::State, + S::Entry: get_entry_notebooks_state::IsUnset, +{ + /// Set the `entry` field (required) + pub fn entry( + mut self, + value: impl Into>, + ) -> GetEntryNotebooksBuilder<'a, get_entry_notebooks_state::SetEntry> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetEntryNotebooksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetEntryNotebooksBuilder<'a, S> +where + S: get_entry_notebooks_state::State, + S::Entry: get_entry_notebooks_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetEntryNotebooks<'a> { + GetEntryNotebooks { + entry: self.__unsafe_private_named.0.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetEntryNotebooksOutput<'a> { + #[serde(borrow)] + pub notebooks: Vec>, +} + +/// Response type for +///sh.weaver.notebook.getEntryNotebooks +pub struct GetEntryNotebooksResponse; +impl jacquard_common::xrpc::XrpcResp for GetEntryNotebooksResponse { + const NSID: &'static str = "sh.weaver.notebook.getEntryNotebooks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetEntryNotebooksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetEntryNotebooks<'a> { + const NSID: &'static str = "sh.weaver.notebook.getEntryNotebooks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetEntryNotebooksResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getEntryNotebooks +pub struct GetEntryNotebooksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetEntryNotebooksRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getEntryNotebooks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetEntryNotebooks<'de>; + type Response = GetEntryNotebooksResponse; +} + +/// Reference to a notebook containing this entry. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct NotebookRef<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub owner: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub title: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod notebook_ref_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Uri; + type Cid; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + type Cid = Unset; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = S::Uri; + type Cid = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + } +} + +/// Builder for constructing an instance of this type +pub struct NotebookRefBuilder<'a, S: notebook_ref_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> NotebookRef<'a> { + /// Create a new builder for this type + pub fn new() -> NotebookRefBuilder<'a, notebook_ref_state::Empty> { + NotebookRefBuilder::new() + } +} + +impl<'a> NotebookRefBuilder<'a, notebook_ref_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + NotebookRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotebookRefBuilder<'a, S> +where + S: notebook_ref_state::State, + S::Cid: notebook_ref_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> NotebookRefBuilder<'a, notebook_ref_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + NotebookRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: notebook_ref_state::State> NotebookRefBuilder<'a, S> { + /// Set the `owner` field (optional) + pub fn owner( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `owner` field to an Option value (optional) + pub fn maybe_owner( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: notebook_ref_state::State> NotebookRefBuilder<'a, S> { + /// Set the `title` field (optional) + pub fn title( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `title` field to an Option value (optional) + pub fn maybe_title(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> NotebookRefBuilder<'a, S> +where + S: notebook_ref_state::State, + S::Uri: notebook_ref_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> NotebookRefBuilder<'a, notebook_ref_state::SetUri> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + NotebookRefBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotebookRefBuilder<'a, S> +where + S: notebook_ref_state::State, + S::Uri: notebook_ref_state::IsSet, + S::Cid: notebook_ref_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> NotebookRef<'a> { + NotebookRef { + cid: self.__unsafe_private_named.0.unwrap(), + owner: self.__unsafe_private_named.1, + title: self.__unsafe_private_named.2, + uri: self.__unsafe_private_named.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> NotebookRef<'a> { + NotebookRef { + cid: self.__unsafe_private_named.0.unwrap(), + owner: self.__unsafe_private_named.1, + title: self.__unsafe_private_named.2, + uri: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_sh_weaver_notebook_getEntryNotebooks() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.getEntryNotebooks", + ), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcQuery(::jacquard_lexicon::lexicon::LexXrpcQuery { + description: None, + parameters: Some( + ::jacquard_lexicon::lexicon::LexXrpcQueryParameter::Params(::jacquard_lexicon::lexicon::LexXrpcParameters { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("entry") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("entry"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static("AT URI of the entry"), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notebookRef"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reference to a notebook containing this entry.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("cid") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("owner"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotebookRef<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.getEntryNotebooks" + } + fn def_name() -> &'static str { + "notebookRef" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_getEntryNotebooks() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_notebook_by_title.rs b/crates/weaver-api/src/sh_weaver/notebook/get_notebook_by_title.rs index 28de921..8f82bfb 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/get_notebook_by_title.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/get_notebook_by_title.rs @@ -32,37 +32,37 @@ pub mod get_notebook_by_title_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Actor; type Title; + type Actor; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Actor = Unset; type Title = Unset; - } - ///State transition - sets the `actor` field to Set - pub struct SetActor(PhantomData S>); - impl sealed::Sealed for SetActor {} - impl State for SetActor { - type Actor = Set; - type Title = S::Title; + type Actor = Unset; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData S>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { - type Actor = S::Actor; type Title = Set; + type Actor = S::Actor; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Title = S::Title; + type Actor = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `actor` field - pub struct actor(()); ///Marker type for the `title` field pub struct title(()); + ///Marker type for the `actor` field + pub struct actor(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> GetNotebookByTitleBuilder<'a, S> where S: get_notebook_by_title_state::State, - S::Actor: get_notebook_by_title_state::IsSet, S::Title: get_notebook_by_title_state::IsSet, + S::Actor: get_notebook_by_title_state::IsSet, { /// Build the final struct pub fn build(self) -> GetNotebookByTitle<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/page.rs b/crates/weaver-api/src/sh_weaver/notebook/page.rs index f59c364..b3190f8 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/page.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/page.rs @@ -44,49 +44,49 @@ pub mod page_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Authors; type EntryList; + type Authors; type Notebook; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Authors = Unset; type EntryList = Unset; + type Authors = Unset; type Notebook = Unset; } - ///State transition - sets the `authors` field to Set - pub struct SetAuthors(PhantomData S>); - impl sealed::Sealed for SetAuthors {} - impl State for SetAuthors { - type Authors = Set; - type EntryList = S::EntryList; - type Notebook = S::Notebook; - } ///State transition - sets the `entry_list` field to Set pub struct SetEntryList(PhantomData S>); impl sealed::Sealed for SetEntryList {} impl State for SetEntryList { - type Authors = S::Authors; type EntryList = Set; + type Authors = S::Authors; + type Notebook = S::Notebook; + } + ///State transition - sets the `authors` field to Set + pub struct SetAuthors(PhantomData S>); + impl sealed::Sealed for SetAuthors {} + impl State for SetAuthors { + type EntryList = S::EntryList; + type Authors = Set; type Notebook = S::Notebook; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { - type Authors = S::Authors; type EntryList = S::EntryList; + type Authors = S::Authors; type Notebook = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `authors` field - pub struct authors(()); ///Marker type for the `entry_list` field pub struct entry_list(()); + ///Marker type for the `authors` field + pub struct authors(()); ///Marker type for the `notebook` field pub struct notebook(()); } @@ -221,8 +221,8 @@ impl<'a, S: page_state::State> PageBuilder<'a, S> { impl<'a, S> PageBuilder<'a, S> where S: page_state::State, - S::Authors: page_state::IsSet, S::EntryList: page_state::IsSet, + S::Authors: page_state::IsSet, S::Notebook: page_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs b/crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs index dc30001..ea873aa 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs @@ -34,51 +34,51 @@ pub mod resolve_entry_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Entry; - type Notebook; type Actor; + type Notebook; + type Entry; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Entry = Unset; - type Notebook = Unset; type Actor = Unset; + type Notebook = Unset; + type Entry = Unset; } - ///State transition - sets the `entry` field to Set - pub struct SetEntry(PhantomData S>); - impl sealed::Sealed for SetEntry {} - impl State for SetEntry { - type Entry = Set; + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; type Notebook = S::Notebook; - type Actor = S::Actor; + type Entry = S::Entry; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { - type Entry = S::Entry; - type Notebook = Set; type Actor = S::Actor; - } - ///State transition - sets the `actor` field to Set - pub struct SetActor(PhantomData S>); - impl sealed::Sealed for SetActor {} - impl State for SetActor { + type Notebook = Set; type Entry = S::Entry; + } + ///State transition - sets the `entry` field to Set + pub struct SetEntry(PhantomData S>); + impl sealed::Sealed for SetEntry {} + impl State for SetEntry { + type Actor = S::Actor; type Notebook = S::Notebook; - type Actor = Set; + type Entry = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `entry` field - pub struct entry(()); - ///Marker type for the `notebook` field - pub struct notebook(()); ///Marker type for the `actor` field pub struct actor(()); + ///Marker type for the `notebook` field + pub struct notebook(()); + ///Marker type for the `entry` field + pub struct entry(()); } } @@ -171,9 +171,9 @@ where impl<'a, S> ResolveEntryBuilder<'a, S> where S: resolve_entry_state::State, - S::Entry: resolve_entry_state::IsSet, - S::Notebook: resolve_entry_state::IsSet, S::Actor: resolve_entry_state::IsSet, + S::Notebook: resolve_entry_state::IsSet, + S::Entry: resolve_entry_state::IsSet, { /// Build the final struct pub fn build(self) -> ResolveEntry<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/theme.rs b/crates/weaver-api/src/sh_weaver/notebook/theme.rs index c0989a6..ba65767 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/theme.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/theme.rs @@ -36,51 +36,51 @@ pub mod code_theme_file_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Did; type Content; type Name; - type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Did = Unset; type Content = Unset; type Name = Unset; - type Did = Unset; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; + type Content = S::Content; + type Name = S::Name; } ///State transition - sets the `content` field to Set pub struct SetContent(PhantomData S>); impl sealed::Sealed for SetContent {} impl State for SetContent { + type Did = S::Did; type Content = Set; type Name = S::Name; - type Did = S::Did; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Content = S::Content; - type Name = Set; type Did = S::Did; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { type Content = S::Content; - type Name = S::Name; - type Did = Set; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `content` field pub struct content(()); ///Marker type for the `name` field pub struct name(()); - ///Marker type for the `did` field - pub struct did(()); } } @@ -173,9 +173,9 @@ where impl<'a, S> CodeThemeFileBuilder<'a, S> where S: code_theme_file_state::State, + S::Did: code_theme_file_state::IsSet, S::Content: code_theme_file_state::IsSet, S::Name: code_theme_file_state::IsSet, - S::Did: code_theme_file_state::IsSet, { /// Build the final struct pub fn build(self) -> CodeThemeFile<'a> { @@ -837,51 +837,51 @@ pub mod font_file_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Name; type Did; type Content; - type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Name = Unset; type Did = Unset; type Content = Unset; - type Name = Unset; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Name = Set; + type Did = S::Did; + type Content = S::Content; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { + type Name = S::Name; type Did = Set; type Content = S::Content; - type Name = S::Name; } ///State transition - sets the `content` field to Set pub struct SetContent(PhantomData S>); impl sealed::Sealed for SetContent {} impl State for SetContent { - type Did = S::Did; - type Content = Set; type Name = S::Name; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { type Did = S::Did; - type Content = S::Content; - type Name = Set; + type Content = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `name` field + pub struct name(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `content` field pub struct content(()); - ///Marker type for the `name` field - pub struct name(()); } } @@ -974,9 +974,9 @@ where impl<'a, S> FontFileBuilder<'a, S> where S: font_file_state::State, + S::Name: font_file_state::IsSet, S::Did: font_file_state::IsSet, S::Content: font_file_state::IsSet, - S::Name: font_file_state::IsSet, { /// Build the final struct pub fn build(self) -> FontFile<'a> { @@ -1067,105 +1067,105 @@ pub mod theme_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type LightScheme; - type DarkScheme; type DarkCodeTheme; - type LightCodeTheme; type Fonts; + type DarkScheme; type Spacing; + type LightCodeTheme; + type LightScheme; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type LightScheme = Unset; - type DarkScheme = Unset; type DarkCodeTheme = Unset; - type LightCodeTheme = Unset; type Fonts = Unset; + type DarkScheme = Unset; type Spacing = Unset; + type LightCodeTheme = Unset; + type LightScheme = Unset; } - ///State transition - sets the `light_scheme` field to Set - pub struct SetLightScheme(PhantomData S>); - impl sealed::Sealed for SetLightScheme {} - impl State for SetLightScheme { - type LightScheme = Set; + ///State transition - sets the `dark_code_theme` field to Set + pub struct SetDarkCodeTheme(PhantomData S>); + impl sealed::Sealed for SetDarkCodeTheme {} + impl State for SetDarkCodeTheme { + type DarkCodeTheme = Set; + type Fonts = S::Fonts; type DarkScheme = S::DarkScheme; - type DarkCodeTheme = S::DarkCodeTheme; + type Spacing = S::Spacing; type LightCodeTheme = S::LightCodeTheme; - type Fonts = S::Fonts; + type LightScheme = S::LightScheme; + } + ///State transition - sets the `fonts` field to Set + pub struct SetFonts(PhantomData S>); + impl sealed::Sealed for SetFonts {} + impl State for SetFonts { + type DarkCodeTheme = S::DarkCodeTheme; + type Fonts = Set; + type DarkScheme = S::DarkScheme; type Spacing = S::Spacing; + type LightCodeTheme = S::LightCodeTheme; + type LightScheme = S::LightScheme; } ///State transition - sets the `dark_scheme` field to Set pub struct SetDarkScheme(PhantomData S>); impl sealed::Sealed for SetDarkScheme {} impl State for SetDarkScheme { - type LightScheme = S::LightScheme; - type DarkScheme = Set; type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = S::LightCodeTheme; type Fonts = S::Fonts; + type DarkScheme = Set; type Spacing = S::Spacing; - } - ///State transition - sets the `dark_code_theme` field to Set - pub struct SetDarkCodeTheme(PhantomData S>); - impl sealed::Sealed for SetDarkCodeTheme {} - impl State for SetDarkCodeTheme { + type LightCodeTheme = S::LightCodeTheme; type LightScheme = S::LightScheme; + } + ///State transition - sets the `spacing` field to Set + pub struct SetSpacing(PhantomData S>); + impl sealed::Sealed for SetSpacing {} + impl State for SetSpacing { + type DarkCodeTheme = S::DarkCodeTheme; + type Fonts = S::Fonts; type DarkScheme = S::DarkScheme; - type DarkCodeTheme = Set; + type Spacing = Set; type LightCodeTheme = S::LightCodeTheme; - type Fonts = S::Fonts; - type Spacing = S::Spacing; + type LightScheme = S::LightScheme; } ///State transition - sets the `light_code_theme` field to Set pub struct SetLightCodeTheme(PhantomData S>); impl sealed::Sealed for SetLightCodeTheme {} impl State for SetLightCodeTheme { - type LightScheme = S::LightScheme; - type DarkScheme = S::DarkScheme; type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = Set; type Fonts = S::Fonts; - type Spacing = S::Spacing; - } - ///State transition - sets the `fonts` field to Set - pub struct SetFonts(PhantomData S>); - impl sealed::Sealed for SetFonts {} - impl State for SetFonts { - type LightScheme = S::LightScheme; type DarkScheme = S::DarkScheme; - type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = S::LightCodeTheme; - type Fonts = Set; type Spacing = S::Spacing; - } - ///State transition - sets the `spacing` field to Set - pub struct SetSpacing(PhantomData S>); - impl sealed::Sealed for SetSpacing {} - impl State for SetSpacing { + type LightCodeTheme = Set; type LightScheme = S::LightScheme; - type DarkScheme = S::DarkScheme; + } + ///State transition - sets the `light_scheme` field to Set + pub struct SetLightScheme(PhantomData S>); + impl sealed::Sealed for SetLightScheme {} + impl State for SetLightScheme { type DarkCodeTheme = S::DarkCodeTheme; - type LightCodeTheme = S::LightCodeTheme; type Fonts = S::Fonts; - type Spacing = Set; + type DarkScheme = S::DarkScheme; + type Spacing = S::Spacing; + type LightCodeTheme = S::LightCodeTheme; + type LightScheme = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `light_scheme` field - pub struct light_scheme(()); - ///Marker type for the `dark_scheme` field - pub struct dark_scheme(()); ///Marker type for the `dark_code_theme` field pub struct dark_code_theme(()); - ///Marker type for the `light_code_theme` field - pub struct light_code_theme(()); ///Marker type for the `fonts` field pub struct fonts(()); + ///Marker type for the `dark_scheme` field + pub struct dark_scheme(()); ///Marker type for the `spacing` field pub struct spacing(()); + ///Marker type for the `light_code_theme` field + pub struct light_code_theme(()); + ///Marker type for the `light_scheme` field + pub struct light_scheme(()); } } @@ -1338,12 +1338,12 @@ where impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, - S::LightScheme: theme_state::IsSet, - S::DarkScheme: theme_state::IsSet, S::DarkCodeTheme: theme_state::IsSet, - S::LightCodeTheme: theme_state::IsSet, S::Fonts: theme_state::IsSet, + S::DarkScheme: theme_state::IsSet, S::Spacing: theme_state::IsSet, + S::LightCodeTheme: theme_state::IsSet, + S::LightScheme: theme_state::IsSet, { /// Build the final struct pub fn build(self) -> Theme<'a> { @@ -1442,51 +1442,51 @@ pub mod theme_fonts_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Body; type Heading; type Monospace; + type Body; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Body = Unset; type Heading = Unset; type Monospace = Unset; - } - ///State transition - sets the `body` field to Set - pub struct SetBody(PhantomData S>); - impl sealed::Sealed for SetBody {} - impl State for SetBody { - type Body = Set; - type Heading = S::Heading; - type Monospace = S::Monospace; + type Body = Unset; } ///State transition - sets the `heading` field to Set pub struct SetHeading(PhantomData S>); impl sealed::Sealed for SetHeading {} impl State for SetHeading { - type Body = S::Body; type Heading = Set; type Monospace = S::Monospace; + type Body = S::Body; } ///State transition - sets the `monospace` field to Set pub struct SetMonospace(PhantomData S>); impl sealed::Sealed for SetMonospace {} impl State for SetMonospace { - type Body = S::Body; type Heading = S::Heading; type Monospace = Set; + type Body = S::Body; + } + ///State transition - sets the `body` field to Set + pub struct SetBody(PhantomData S>); + impl sealed::Sealed for SetBody {} + impl State for SetBody { + type Heading = S::Heading; + type Monospace = S::Monospace; + type Body = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `body` field - pub struct body(()); ///Marker type for the `heading` field pub struct heading(()); ///Marker type for the `monospace` field pub struct monospace(()); + ///Marker type for the `body` field + pub struct body(()); } } @@ -1579,9 +1579,9 @@ where impl<'a, S> ThemeFontsBuilder<'a, S> where S: theme_fonts_state::State, - S::Body: theme_fonts_state::IsSet, S::Heading: theme_fonts_state::IsSet, S::Monospace: theme_fonts_state::IsSet, + S::Body: theme_fonts_state::IsSet, { /// Build the final struct pub fn build(self) -> ThemeFonts<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notification.rs b/crates/weaver-api/src/sh_weaver/notification.rs index a1b3b3d..99b504a 100644 --- a/crates/weaver-api/src/sh_weaver/notification.rs +++ b/crates/weaver-api/src/sh_weaver/notification.rs @@ -51,103 +51,103 @@ pub mod notification_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Author; + type IsRead; type Cid; type Reason; - type Author; type Uri; - type IsRead; type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Author = Unset; + type IsRead = Unset; type Cid = Unset; type Reason = Unset; - type Author = Unset; type Uri = Unset; - type IsRead = Unset; type IndexedAt = Unset; } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type Author = Set; + type IsRead = S::IsRead; + type Cid = S::Cid; + type Reason = S::Reason; + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `is_read` field to Set + pub struct SetIsRead(PhantomData S>); + impl sealed::Sealed for SetIsRead {} + impl State for SetIsRead { + type Author = S::Author; + type IsRead = Set; + type Cid = S::Cid; + type Reason = S::Reason; + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { + type Author = S::Author; + type IsRead = S::IsRead; type Cid = Set; type Reason = S::Reason; - type Author = S::Author; type Uri = S::Uri; - type IsRead = S::IsRead; type IndexedAt = S::IndexedAt; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); impl sealed::Sealed for SetReason {} impl State for SetReason { - type Cid = S::Cid; - type Reason = Set; type Author = S::Author; - type Uri = S::Uri; type IsRead = S::IsRead; - type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData S>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { type Cid = S::Cid; - type Reason = S::Reason; - type Author = Set; + type Reason = Set; type Uri = S::Uri; - type IsRead = S::IsRead; type IndexedAt = S::IndexedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = S::Cid; - type Reason = S::Reason; type Author = S::Author; - type Uri = Set; type IsRead = S::IsRead; - type IndexedAt = S::IndexedAt; - } - ///State transition - sets the `is_read` field to Set - pub struct SetIsRead(PhantomData S>); - impl sealed::Sealed for SetIsRead {} - impl State for SetIsRead { type Cid = S::Cid; type Reason = S::Reason; - type Author = S::Author; - type Uri = S::Uri; - type IsRead = Set; + type Uri = Set; type IndexedAt = S::IndexedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { + type Author = S::Author; + type IsRead = S::IsRead; type Cid = S::Cid; type Reason = S::Reason; - type Author = S::Author; type Uri = S::Uri; - type IsRead = S::IsRead; type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `is_read` field + pub struct is_read(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `reason` field pub struct reason(()); - ///Marker type for the `author` field - pub struct author(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `is_read` field - pub struct is_read(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } @@ -342,11 +342,11 @@ where impl<'a, S> NotificationBuilder<'a, S> where S: notification_state::State, + S::Author: notification_state::IsSet, + S::IsRead: notification_state::IsSet, S::Cid: notification_state::IsSet, S::Reason: notification_state::IsSet, - S::Author: notification_state::IsSet, S::Uri: notification_state::IsSet, - S::IsRead: notification_state::IsSet, S::IndexedAt: notification_state::IsSet, { /// Build the final struct @@ -802,9 +802,9 @@ pub mod notification_group_state { pub trait State: sealed::Sealed { type Actors; type Subject; - type MostRecentAt; - type Reason; type Count; + type Reason; + type MostRecentAt; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -812,9 +812,9 @@ pub mod notification_group_state { impl State for Empty { type Actors = Unset; type Subject = Unset; - type MostRecentAt = Unset; - type Reason = Unset; type Count = Unset; + type Reason = Unset; + type MostRecentAt = Unset; } ///State transition - sets the `actors` field to Set pub struct SetActors(PhantomData S>); @@ -822,9 +822,9 @@ pub mod notification_group_state { impl State for SetActors { type Actors = Set; type Subject = S::Subject; - type MostRecentAt = S::MostRecentAt; - type Reason = S::Reason; type Count = S::Count; + type Reason = S::Reason; + type MostRecentAt = S::MostRecentAt; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); @@ -832,19 +832,19 @@ pub mod notification_group_state { impl State for SetSubject { type Actors = S::Actors; type Subject = Set; - type MostRecentAt = S::MostRecentAt; - type Reason = S::Reason; type Count = S::Count; + type Reason = S::Reason; + type MostRecentAt = S::MostRecentAt; } - ///State transition - sets the `most_recent_at` field to Set - pub struct SetMostRecentAt(PhantomData S>); - impl sealed::Sealed for SetMostRecentAt {} - impl State for SetMostRecentAt { + ///State transition - sets the `count` field to Set + pub struct SetCount(PhantomData S>); + impl sealed::Sealed for SetCount {} + impl State for SetCount { type Actors = S::Actors; type Subject = S::Subject; - type MostRecentAt = Set; + type Count = Set; type Reason = S::Reason; - type Count = S::Count; + type MostRecentAt = S::MostRecentAt; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); @@ -852,19 +852,19 @@ pub mod notification_group_state { impl State for SetReason { type Actors = S::Actors; type Subject = S::Subject; - type MostRecentAt = S::MostRecentAt; - type Reason = Set; type Count = S::Count; + type Reason = Set; + type MostRecentAt = S::MostRecentAt; } - ///State transition - sets the `count` field to Set - pub struct SetCount(PhantomData S>); - impl sealed::Sealed for SetCount {} - impl State for SetCount { + ///State transition - sets the `most_recent_at` field to Set + pub struct SetMostRecentAt(PhantomData S>); + impl sealed::Sealed for SetMostRecentAt {} + impl State for SetMostRecentAt { type Actors = S::Actors; type Subject = S::Subject; - type MostRecentAt = S::MostRecentAt; + type Count = S::Count; type Reason = S::Reason; - type Count = Set; + type MostRecentAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -873,12 +873,12 @@ pub mod notification_group_state { pub struct actors(()); ///Marker type for the `subject` field pub struct subject(()); - ///Marker type for the `most_recent_at` field - pub struct most_recent_at(()); - ///Marker type for the `reason` field - pub struct reason(()); ///Marker type for the `count` field pub struct count(()); + ///Marker type for the `reason` field + pub struct reason(()); + ///Marker type for the `most_recent_at` field + pub struct most_recent_at(()); } } @@ -1027,9 +1027,9 @@ where S: notification_group_state::State, S::Actors: notification_group_state::IsSet, S::Subject: notification_group_state::IsSet, - S::MostRecentAt: notification_group_state::IsSet, - S::Reason: notification_group_state::IsSet, S::Count: notification_group_state::IsSet, + S::Reason: notification_group_state::IsSet, + S::MostRecentAt: notification_group_state::IsSet, { /// Build the final struct pub fn build(self) -> NotificationGroup<'a> { @@ -1285,51 +1285,51 @@ pub mod subscription_update_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type NewEntries; type UpdatedAt; type Notebook; - type NewEntries; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type NewEntries = Unset; type UpdatedAt = Unset; type Notebook = Unset; - type NewEntries = Unset; + } + ///State transition - sets the `new_entries` field to Set + pub struct SetNewEntries(PhantomData S>); + impl sealed::Sealed for SetNewEntries {} + impl State for SetNewEntries { + type NewEntries = Set; + type UpdatedAt = S::UpdatedAt; + type Notebook = S::Notebook; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { + type NewEntries = S::NewEntries; type UpdatedAt = Set; type Notebook = S::Notebook; - type NewEntries = S::NewEntries; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { - type UpdatedAt = S::UpdatedAt; - type Notebook = Set; type NewEntries = S::NewEntries; - } - ///State transition - sets the `new_entries` field to Set - pub struct SetNewEntries(PhantomData S>); - impl sealed::Sealed for SetNewEntries {} - impl State for SetNewEntries { type UpdatedAt = S::UpdatedAt; - type Notebook = S::Notebook; - type NewEntries = Set; + type Notebook = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `new_entries` field + pub struct new_entries(()); ///Marker type for the `updated_at` field pub struct updated_at(()); ///Marker type for the `notebook` field pub struct notebook(()); - ///Marker type for the `new_entries` field - pub struct new_entries(()); } } @@ -1454,9 +1454,9 @@ impl<'a, S: subscription_update_view_state::State> SubscriptionUpdateViewBuilder impl<'a, S> SubscriptionUpdateViewBuilder<'a, S> where S: subscription_update_view_state::State, + S::NewEntries: subscription_update_view_state::IsSet, S::UpdatedAt: subscription_update_view_state::IsSet, S::Notebook: subscription_update_view_state::IsSet, - S::NewEntries: subscription_update_view_state::IsSet, { /// Build the final struct pub fn build(self) -> SubscriptionUpdateView<'a> { diff --git a/crates/weaver-api/src/sh_weaver/publish/blob.rs b/crates/weaver-api/src/sh_weaver/publish/blob.rs index a2623c4..c532043 100644 --- a/crates/weaver-api/src/sh_weaver/publish/blob.rs +++ b/crates/weaver-api/src/sh_weaver/publish/blob.rs @@ -36,37 +36,37 @@ pub mod blob_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Path; type Upload; + type Path; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Path = Unset; type Upload = Unset; - } - ///State transition - sets the `path` field to Set - pub struct SetPath(PhantomData S>); - impl sealed::Sealed for SetPath {} - impl State for SetPath { - type Path = Set; - type Upload = S::Upload; + type Path = Unset; } ///State transition - sets the `upload` field to Set pub struct SetUpload(PhantomData S>); impl sealed::Sealed for SetUpload {} impl State for SetUpload { - type Path = S::Path; type Upload = Set; + type Path = S::Path; + } + ///State transition - sets the `path` field to Set + pub struct SetPath(PhantomData S>); + impl sealed::Sealed for SetPath {} + impl State for SetPath { + type Upload = S::Upload; + type Path = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `path` field - pub struct path(()); ///Marker type for the `upload` field pub struct upload(()); + ///Marker type for the `path` field + pub struct path(()); } } @@ -139,8 +139,8 @@ where impl<'a, S> BlobBuilder<'a, S> where S: blob_state::State, - S::Path: blob_state::IsSet, S::Upload: blob_state::IsSet, + S::Path: blob_state::IsSet, { /// Build the final struct pub fn build(self) -> Blob<'a> { diff --git a/crates/weaver-api/src/tools_ozone/communication.rs b/crates/weaver-api/src/tools_ozone/communication.rs index 6231fa9..3e8e144 100644 --- a/crates/weaver-api/src/tools_ozone/communication.rs +++ b/crates/weaver-api/src/tools_ozone/communication.rs @@ -56,126 +56,126 @@ pub mod template_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Name; + type Disabled; type LastUpdatedBy; type UpdatedAt; - type Disabled; type Id; - type ContentMarkdown; type CreatedAt; + type ContentMarkdown; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Name = Unset; + type Disabled = Unset; type LastUpdatedBy = Unset; type UpdatedAt = Unset; - type Disabled = Unset; type Id = Unset; - type ContentMarkdown = Unset; type CreatedAt = Unset; + type ContentMarkdown = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { type Name = Set; + type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; type UpdatedAt = S::UpdatedAt; - type Disabled = S::Disabled; type Id = S::Id; + type CreatedAt = S::CreatedAt; type ContentMarkdown = S::ContentMarkdown; + } + ///State transition - sets the `disabled` field to Set + pub struct SetDisabled(PhantomData S>); + impl sealed::Sealed for SetDisabled {} + impl State for SetDisabled { + type Name = S::Name; + type Disabled = Set; + type LastUpdatedBy = S::LastUpdatedBy; + type UpdatedAt = S::UpdatedAt; + type Id = S::Id; type CreatedAt = S::CreatedAt; + type ContentMarkdown = S::ContentMarkdown; } ///State transition - sets the `last_updated_by` field to Set pub struct SetLastUpdatedBy(PhantomData S>); impl sealed::Sealed for SetLastUpdatedBy {} impl State for SetLastUpdatedBy { type Name = S::Name; + type Disabled = S::Disabled; type LastUpdatedBy = Set; type UpdatedAt = S::UpdatedAt; - type Disabled = S::Disabled; type Id = S::Id; - type ContentMarkdown = S::ContentMarkdown; type CreatedAt = S::CreatedAt; + type ContentMarkdown = S::ContentMarkdown; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { type Name = S::Name; + type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; type UpdatedAt = Set; - type Disabled = S::Disabled; type Id = S::Id; - type ContentMarkdown = S::ContentMarkdown; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `disabled` field to Set - pub struct SetDisabled(PhantomData S>); - impl sealed::Sealed for SetDisabled {} - impl State for SetDisabled { - type Name = S::Name; - type LastUpdatedBy = S::LastUpdatedBy; - type UpdatedAt = S::UpdatedAt; - type Disabled = Set; - type Id = S::Id; type ContentMarkdown = S::ContentMarkdown; - type CreatedAt = S::CreatedAt; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { type Name = S::Name; - type LastUpdatedBy = S::LastUpdatedBy; - type UpdatedAt = S::UpdatedAt; type Disabled = S::Disabled; - type Id = Set; - type ContentMarkdown = S::ContentMarkdown; - type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `content_markdown` field to Set - pub struct SetContentMarkdown(PhantomData S>); - impl sealed::Sealed for SetContentMarkdown {} - impl State for SetContentMarkdown { - type Name = S::Name; type LastUpdatedBy = S::LastUpdatedBy; type UpdatedAt = S::UpdatedAt; - type Disabled = S::Disabled; - type Id = S::Id; - type ContentMarkdown = Set; + type Id = Set; type CreatedAt = S::CreatedAt; + type ContentMarkdown = S::ContentMarkdown; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type Name = S::Name; + type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; type UpdatedAt = S::UpdatedAt; - type Disabled = S::Disabled; type Id = S::Id; - type ContentMarkdown = S::ContentMarkdown; type CreatedAt = Set; + type ContentMarkdown = S::ContentMarkdown; + } + ///State transition - sets the `content_markdown` field to Set + pub struct SetContentMarkdown(PhantomData S>); + impl sealed::Sealed for SetContentMarkdown {} + impl State for SetContentMarkdown { + type Name = S::Name; + type Disabled = S::Disabled; + type LastUpdatedBy = S::LastUpdatedBy; + type UpdatedAt = S::UpdatedAt; + type Id = S::Id; + type CreatedAt = S::CreatedAt; + type ContentMarkdown = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `disabled` field + pub struct disabled(()); ///Marker type for the `last_updated_by` field pub struct last_updated_by(()); ///Marker type for the `updated_at` field pub struct updated_at(()); - ///Marker type for the `disabled` field - pub struct disabled(()); ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `content_markdown` field - pub struct content_markdown(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `content_markdown` field + pub struct content_markdown(()); } } @@ -396,12 +396,12 @@ impl<'a, S> TemplateViewBuilder<'a, S> where S: template_view_state::State, S::Name: template_view_state::IsSet, + S::Disabled: template_view_state::IsSet, S::LastUpdatedBy: template_view_state::IsSet, S::UpdatedAt: template_view_state::IsSet, - S::Disabled: template_view_state::IsSet, S::Id: template_view_state::IsSet, - S::ContentMarkdown: template_view_state::IsSet, S::CreatedAt: template_view_state::IsSet, + S::ContentMarkdown: template_view_state::IsSet, { /// Build the final struct pub fn build(self) -> TemplateView<'a> { diff --git a/crates/weaver-api/src/tools_ozone/moderation.rs b/crates/weaver-api/src/tools_ozone/moderation.rs index 91d6fa6..3898d93 100644 --- a/crates/weaver-api/src/tools_ozone/moderation.rs +++ b/crates/weaver-api/src/tools_ozone/moderation.rs @@ -55,37 +55,37 @@ pub mod account_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Timestamp; type Active; + type Timestamp; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Timestamp = Unset; type Active = Unset; - } - ///State transition - sets the `timestamp` field to Set - pub struct SetTimestamp(PhantomData S>); - impl sealed::Sealed for SetTimestamp {} - impl State for SetTimestamp { - type Timestamp = Set; - type Active = S::Active; + type Timestamp = Unset; } ///State transition - sets the `active` field to Set pub struct SetActive(PhantomData S>); impl sealed::Sealed for SetActive {} impl State for SetActive { - type Timestamp = S::Timestamp; type Active = Set; + type Timestamp = S::Timestamp; + } + ///State transition - sets the `timestamp` field to Set + pub struct SetTimestamp(PhantomData S>); + impl sealed::Sealed for SetTimestamp {} + impl State for SetTimestamp { + type Active = S::Active; + type Timestamp = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `timestamp` field - pub struct timestamp(()); ///Marker type for the `active` field pub struct active(()); + ///Marker type for the `timestamp` field + pub struct timestamp(()); } } @@ -192,8 +192,8 @@ where impl<'a, S> AccountEventBuilder<'a, S> where S: account_event_state::State, - S::Timestamp: account_event_state::IsSet, S::Active: account_event_state::IsSet, + S::Timestamp: account_event_state::IsSet, { /// Build the final struct pub fn build(self) -> AccountEvent<'a> { @@ -5097,51 +5097,51 @@ pub mod age_assurance_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type AttemptId; - type Status; type CreatedAt; + type Status; + type AttemptId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type AttemptId = Unset; - type Status = Unset; type CreatedAt = Unset; + type Status = Unset; + type AttemptId = Unset; } - ///State transition - sets the `attempt_id` field to Set - pub struct SetAttemptId(PhantomData S>); - impl sealed::Sealed for SetAttemptId {} - impl State for SetAttemptId { - type AttemptId = Set; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; type Status = S::Status; - type CreatedAt = S::CreatedAt; + type AttemptId = S::AttemptId; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type AttemptId = S::AttemptId; - type Status = Set; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { + type Status = Set; type AttemptId = S::AttemptId; + } + ///State transition - sets the `attempt_id` field to Set + pub struct SetAttemptId(PhantomData S>); + impl sealed::Sealed for SetAttemptId {} + impl State for SetAttemptId { + type CreatedAt = S::CreatedAt; type Status = S::Status; - type CreatedAt = Set; + type AttemptId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `attempt_id` field - pub struct attempt_id(()); - ///Marker type for the `status` field - pub struct status(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `status` field + pub struct status(()); + ///Marker type for the `attempt_id` field + pub struct attempt_id(()); } } @@ -5379,9 +5379,9 @@ where impl<'a, S> AgeAssuranceEventBuilder<'a, S> where S: age_assurance_event_state::State, - S::AttemptId: age_assurance_event_state::IsSet, - S::Status: age_assurance_event_state::IsSet, S::CreatedAt: age_assurance_event_state::IsSet, + S::Status: age_assurance_event_state::IsSet, + S::AttemptId: age_assurance_event_state::IsSet, { /// Build the final struct pub fn build(self) -> AgeAssuranceEvent<'a> { @@ -5519,8 +5519,8 @@ pub mod blob_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Cid; - type CreatedAt; type MimeType; + type CreatedAt; type Size; } /// Empty state - all required fields are unset @@ -5528,8 +5528,8 @@ pub mod blob_view_state { impl sealed::Sealed for Empty {} impl State for Empty { type Cid = Unset; - type CreatedAt = Unset; type MimeType = Unset; + type CreatedAt = Unset; type Size = Unset; } ///State transition - sets the `cid` field to Set @@ -5537,17 +5537,8 @@ pub mod blob_view_state { impl sealed::Sealed for SetCid {} impl State for SetCid { type Cid = Set; - type CreatedAt = S::CreatedAt; - type MimeType = S::MimeType; - type Size = S::Size; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Cid = S::Cid; - type CreatedAt = Set; type MimeType = S::MimeType; + type CreatedAt = S::CreatedAt; type Size = S::Size; } ///State transition - sets the `mime_type` field to Set @@ -5555,8 +5546,17 @@ pub mod blob_view_state { impl sealed::Sealed for SetMimeType {} impl State for SetMimeType { type Cid = S::Cid; - type CreatedAt = S::CreatedAt; type MimeType = Set; + type CreatedAt = S::CreatedAt; + type Size = S::Size; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Cid = S::Cid; + type MimeType = S::MimeType; + type CreatedAt = Set; type Size = S::Size; } ///State transition - sets the `size` field to Set @@ -5564,8 +5564,8 @@ pub mod blob_view_state { impl sealed::Sealed for SetSize {} impl State for SetSize { type Cid = S::Cid; - type CreatedAt = S::CreatedAt; type MimeType = S::MimeType; + type CreatedAt = S::CreatedAt; type Size = Set; } /// Marker types for field names @@ -5573,10 +5573,10 @@ pub mod blob_view_state { pub mod members { ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `mime_type` field pub struct mime_type(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `size` field pub struct size(()); } @@ -5726,8 +5726,8 @@ impl<'a, S> BlobViewBuilder<'a, S> where S: blob_view_state::State, S::Cid: blob_view_state::IsSet, - S::CreatedAt: blob_view_state::IsSet, S::MimeType: blob_view_state::IsSet, + S::CreatedAt: blob_view_state::IsSet, S::Size: blob_view_state::IsSet, { /// Build the final struct @@ -6088,37 +6088,37 @@ pub mod image_details_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Height; type Width; + type Height; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Height = Unset; type Width = Unset; - } - ///State transition - sets the `height` field to Set - pub struct SetHeight(PhantomData S>); - impl sealed::Sealed for SetHeight {} - impl State for SetHeight { - type Height = Set; - type Width = S::Width; + type Height = Unset; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData S>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { - type Height = S::Height; type Width = Set; + type Height = S::Height; + } + ///State transition - sets the `height` field to Set + pub struct SetHeight(PhantomData S>); + impl sealed::Sealed for SetHeight {} + impl State for SetHeight { + type Width = S::Width; + type Height = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `height` field - pub struct height(()); ///Marker type for the `width` field pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); } } @@ -6188,8 +6188,8 @@ where impl<'a, S> ImageDetailsBuilder<'a, S> where S: image_details_state::State, - S::Height: image_details_state::IsSet, S::Width: image_details_state::IsSet, + S::Height: image_details_state::IsSet, { /// Build the final struct pub fn build(self) -> ImageDetails<'a> { @@ -6488,37 +6488,37 @@ pub mod mod_event_label_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreateLabelVals; type NegateLabelVals; + type CreateLabelVals; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreateLabelVals = Unset; type NegateLabelVals = Unset; - } - ///State transition - sets the `create_label_vals` field to Set - pub struct SetCreateLabelVals(PhantomData S>); - impl sealed::Sealed for SetCreateLabelVals {} - impl State for SetCreateLabelVals { - type CreateLabelVals = Set; - type NegateLabelVals = S::NegateLabelVals; + type CreateLabelVals = Unset; } ///State transition - sets the `negate_label_vals` field to Set pub struct SetNegateLabelVals(PhantomData S>); impl sealed::Sealed for SetNegateLabelVals {} impl State for SetNegateLabelVals { - type CreateLabelVals = S::CreateLabelVals; type NegateLabelVals = Set; + type CreateLabelVals = S::CreateLabelVals; + } + ///State transition - sets the `create_label_vals` field to Set + pub struct SetCreateLabelVals(PhantomData S>); + impl sealed::Sealed for SetCreateLabelVals {} + impl State for SetCreateLabelVals { + type NegateLabelVals = S::NegateLabelVals; + type CreateLabelVals = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `create_label_vals` field - pub struct create_label_vals(()); ///Marker type for the `negate_label_vals` field pub struct negate_label_vals(()); + ///Marker type for the `create_label_vals` field + pub struct create_label_vals(()); } } @@ -6622,8 +6622,8 @@ where impl<'a, S> ModEventLabelBuilder<'a, S> where S: mod_event_label_state::State, - S::CreateLabelVals: mod_event_label_state::IsSet, S::NegateLabelVals: mod_event_label_state::IsSet, + S::CreateLabelVals: mod_event_label_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventLabel<'a> { @@ -7725,10 +7725,10 @@ pub mod mod_event_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Id; - type Event; - type CreatedBy; type Subject; + type CreatedBy; type SubjectBlobCids; + type Event; type CreatedAt; } /// Empty state - all required fields are unset @@ -7736,10 +7736,10 @@ pub mod mod_event_view_state { impl sealed::Sealed for Empty {} impl State for Empty { type Id = Unset; - type Event = Unset; - type CreatedBy = Unset; type Subject = Unset; + type CreatedBy = Unset; type SubjectBlobCids = Unset; + type Event = Unset; type CreatedAt = Unset; } ///State transition - sets the `id` field to Set @@ -7747,21 +7747,21 @@ pub mod mod_event_view_state { impl sealed::Sealed for SetId {} impl State for SetId { type Id = Set; - type Event = S::Event; - type CreatedBy = S::CreatedBy; type Subject = S::Subject; + type CreatedBy = S::CreatedBy; type SubjectBlobCids = S::SubjectBlobCids; + type Event = S::Event; type CreatedAt = S::CreatedAt; } - ///State transition - sets the `event` field to Set - pub struct SetEvent(PhantomData S>); - impl sealed::Sealed for SetEvent {} - impl State for SetEvent { + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { type Id = S::Id; - type Event = Set; + type Subject = Set; type CreatedBy = S::CreatedBy; - type Subject = S::Subject; type SubjectBlobCids = S::SubjectBlobCids; + type Event = S::Event; type CreatedAt = S::CreatedAt; } ///State transition - sets the `created_by` field to Set @@ -7769,21 +7769,10 @@ pub mod mod_event_view_state { impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { type Id = S::Id; - type Event = S::Event; - type CreatedBy = Set; type Subject = S::Subject; + type CreatedBy = Set; type SubjectBlobCids = S::SubjectBlobCids; - type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Id = S::Id; type Event = S::Event; - type CreatedBy = S::CreatedBy; - type Subject = Set; - type SubjectBlobCids = S::SubjectBlobCids; type CreatedAt = S::CreatedAt; } ///State transition - sets the `subject_blob_cids` field to Set @@ -7791,10 +7780,21 @@ pub mod mod_event_view_state { impl sealed::Sealed for SetSubjectBlobCids {} impl State for SetSubjectBlobCids { type Id = S::Id; - type Event = S::Event; - type CreatedBy = S::CreatedBy; type Subject = S::Subject; + type CreatedBy = S::CreatedBy; type SubjectBlobCids = Set; + type Event = S::Event; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `event` field to Set + pub struct SetEvent(PhantomData S>); + impl sealed::Sealed for SetEvent {} + impl State for SetEvent { + type Id = S::Id; + type Subject = S::Subject; + type CreatedBy = S::CreatedBy; + type SubjectBlobCids = S::SubjectBlobCids; + type Event = Set; type CreatedAt = S::CreatedAt; } ///State transition - sets the `created_at` field to Set @@ -7802,10 +7802,10 @@ pub mod mod_event_view_state { impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type Id = S::Id; - type Event = S::Event; - type CreatedBy = S::CreatedBy; type Subject = S::Subject; + type CreatedBy = S::CreatedBy; type SubjectBlobCids = S::SubjectBlobCids; + type Event = S::Event; type CreatedAt = Set; } /// Marker types for field names @@ -7813,14 +7813,14 @@ pub mod mod_event_view_state { pub mod members { ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `event` field - pub struct event(()); - ///Marker type for the `created_by` field - pub struct created_by(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_by` field + pub struct created_by(()); ///Marker type for the `subject_blob_cids` field pub struct subject_blob_cids(()); + ///Marker type for the `event` field + pub struct event(()); ///Marker type for the `created_at` field pub struct created_at(()); } @@ -8046,10 +8046,10 @@ impl<'a, S> ModEventViewBuilder<'a, S> where S: mod_event_view_state::State, S::Id: mod_event_view_state::IsSet, - S::Event: mod_event_view_state::IsSet, - S::CreatedBy: mod_event_view_state::IsSet, S::Subject: mod_event_view_state::IsSet, + S::CreatedBy: mod_event_view_state::IsSet, S::SubjectBlobCids: mod_event_view_state::IsSet, + S::Event: mod_event_view_state::IsSet, S::CreatedAt: mod_event_view_state::IsSet, { /// Build the final struct @@ -8244,105 +8244,105 @@ pub mod mod_event_view_detail_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; - type Subject; type SubjectBlobs; type CreatedBy; - type Event; + type Id; type CreatedAt; + type Event; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; - type Subject = Unset; type SubjectBlobs = Unset; type CreatedBy = Unset; - type Event = Unset; + type Id = Unset; type CreatedAt = Unset; + type Event = Unset; + type Subject = Unset; } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Id = Set; - type Subject = S::Subject; - type SubjectBlobs = S::SubjectBlobs; + ///State transition - sets the `subject_blobs` field to Set + pub struct SetSubjectBlobs(PhantomData S>); + impl sealed::Sealed for SetSubjectBlobs {} + impl State for SetSubjectBlobs { + type SubjectBlobs = Set; type CreatedBy = S::CreatedBy; - type Event = S::Event; - type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Id = S::Id; - type Subject = Set; - type SubjectBlobs = S::SubjectBlobs; - type CreatedBy = S::CreatedBy; - type Event = S::Event; - type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `subject_blobs` field to Set - pub struct SetSubjectBlobs(PhantomData S>); - impl sealed::Sealed for SetSubjectBlobs {} - impl State for SetSubjectBlobs { - type Id = S::Id; - type Subject = S::Subject; - type SubjectBlobs = Set; - type CreatedBy = S::CreatedBy; - type Event = S::Event; + type Id = S::Id; type CreatedAt = S::CreatedAt; + type Event = S::Event; + type Subject = S::Subject; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type Id = S::Id; - type Subject = S::Subject; type SubjectBlobs = S::SubjectBlobs; type CreatedBy = Set; - type Event = S::Event; - type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `event` field to Set - pub struct SetEvent(PhantomData S>); - impl sealed::Sealed for SetEvent {} - impl State for SetEvent { type Id = S::Id; + type CreatedAt = S::CreatedAt; + type Event = S::Event; type Subject = S::Subject; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { type SubjectBlobs = S::SubjectBlobs; type CreatedBy = S::CreatedBy; - type Event = Set; + type Id = Set; type CreatedAt = S::CreatedAt; + type Event = S::Event; + type Subject = S::Subject; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { + type SubjectBlobs = S::SubjectBlobs; + type CreatedBy = S::CreatedBy; + type Id = S::Id; + type CreatedAt = Set; + type Event = S::Event; + type Subject = S::Subject; + } + ///State transition - sets the `event` field to Set + pub struct SetEvent(PhantomData S>); + impl sealed::Sealed for SetEvent {} + impl State for SetEvent { + type SubjectBlobs = S::SubjectBlobs; + type CreatedBy = S::CreatedBy; type Id = S::Id; + type CreatedAt = S::CreatedAt; + type Event = Set; type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { type SubjectBlobs = S::SubjectBlobs; type CreatedBy = S::CreatedBy; + type Id = S::Id; + type CreatedAt = S::CreatedAt; type Event = S::Event; - type CreatedAt = Set; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `id` field - pub struct id(()); - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `subject_blobs` field pub struct subject_blobs(()); ///Marker type for the `created_by` field pub struct created_by(()); - ///Marker type for the `event` field - pub struct event(()); + ///Marker type for the `id` field + pub struct id(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `event` field + pub struct event(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -8515,12 +8515,12 @@ where impl<'a, S> ModEventViewDetailBuilder<'a, S> where S: mod_event_view_detail_state::State, - S::Id: mod_event_view_detail_state::IsSet, - S::Subject: mod_event_view_detail_state::IsSet, S::SubjectBlobs: mod_event_view_detail_state::IsSet, S::CreatedBy: mod_event_view_detail_state::IsSet, - S::Event: mod_event_view_detail_state::IsSet, + S::Id: mod_event_view_detail_state::IsSet, S::CreatedAt: mod_event_view_detail_state::IsSet, + S::Event: mod_event_view_detail_state::IsSet, + S::Subject: mod_event_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventViewDetail<'a> { @@ -9089,126 +9089,126 @@ pub mod record_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Cid; - type Moderation; - type IndexedAt; - type Repo; - type Uri; type Value; + type Uri; type BlobCids; + type IndexedAt; + type Moderation; + type Repo; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Cid = Unset; - type Moderation = Unset; - type IndexedAt = Unset; - type Repo = Unset; - type Uri = Unset; type Value = Unset; + type Uri = Unset; type BlobCids = Unset; + type IndexedAt = Unset; + type Moderation = Unset; + type Repo = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Cid = Set; - type Moderation = S::Moderation; - type IndexedAt = S::IndexedAt; - type Repo = S::Repo; - type Uri = S::Uri; type Value = S::Value; - type BlobCids = S::BlobCids; - } - ///State transition - sets the `moderation` field to Set - pub struct SetModeration(PhantomData S>); - impl sealed::Sealed for SetModeration {} - impl State for SetModeration { - type Cid = S::Cid; - type Moderation = Set; - type IndexedAt = S::IndexedAt; - type Repo = S::Repo; type Uri = S::Uri; - type Value = S::Value; type BlobCids = S::BlobCids; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Cid = S::Cid; + type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; - type IndexedAt = Set; type Repo = S::Repo; - type Uri = S::Uri; - type Value = S::Value; - type BlobCids = S::BlobCids; } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { type Cid = S::Cid; - type Moderation = S::Moderation; - type IndexedAt = S::IndexedAt; - type Repo = Set; + type Value = Set; type Uri = S::Uri; - type Value = S::Value; type BlobCids = S::BlobCids; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = S::Repo; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Cid = S::Cid; - type Moderation = S::Moderation; - type IndexedAt = S::IndexedAt; - type Repo = S::Repo; - type Uri = Set; type Value = S::Value; + type Uri = Set; type BlobCids = S::BlobCids; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type Cid = S::Cid; - type Moderation = S::Moderation; type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; type Repo = S::Repo; - type Uri = S::Uri; - type Value = Set; - type BlobCids = S::BlobCids; } ///State transition - sets the `blob_cids` field to Set pub struct SetBlobCids(PhantomData S>); impl sealed::Sealed for SetBlobCids {} impl State for SetBlobCids { type Cid = S::Cid; - type Moderation = S::Moderation; + type Value = S::Value; + type Uri = S::Uri; + type BlobCids = Set; type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = S::Repo; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Cid = S::Cid; + type Value = S::Value; + type Uri = S::Uri; + type BlobCids = S::BlobCids; + type IndexedAt = Set; + type Moderation = S::Moderation; type Repo = S::Repo; + } + ///State transition - sets the `moderation` field to Set + pub struct SetModeration(PhantomData S>); + impl sealed::Sealed for SetModeration {} + impl State for SetModeration { + type Cid = S::Cid; + type Value = S::Value; type Uri = S::Uri; + type BlobCids = S::BlobCids; + type IndexedAt = S::IndexedAt; + type Moderation = Set; + type Repo = S::Repo; + } + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Cid = S::Cid; type Value = S::Value; - type BlobCids = Set; + type Uri = S::Uri; + type BlobCids = S::BlobCids; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `moderation` field - pub struct moderation(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); - ///Marker type for the `repo` field - pub struct repo(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `blob_cids` field pub struct blob_cids(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `moderation` field + pub struct moderation(()); + ///Marker type for the `repo` field + pub struct repo(()); } } @@ -9382,12 +9382,12 @@ impl<'a, S> RecordViewBuilder<'a, S> where S: record_view_state::State, S::Cid: record_view_state::IsSet, - S::Moderation: record_view_state::IsSet, - S::IndexedAt: record_view_state::IsSet, - S::Repo: record_view_state::IsSet, - S::Uri: record_view_state::IsSet, S::Value: record_view_state::IsSet, + S::Uri: record_view_state::IsSet, S::BlobCids: record_view_state::IsSet, + S::IndexedAt: record_view_state::IsSet, + S::Moderation: record_view_state::IsSet, + S::Repo: record_view_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordView<'a> { @@ -9481,126 +9481,126 @@ pub mod record_view_detail_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Repo; + type Moderation; + type Blobs; + type Uri; type Cid; type Value; - type Blobs; type IndexedAt; - type Moderation; - type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Repo = Unset; + type Moderation = Unset; + type Blobs = Unset; + type Uri = Unset; type Cid = Unset; type Value = Unset; - type Blobs = Unset; type IndexedAt = Unset; - type Moderation = Unset; - type Uri = Unset; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { type Repo = Set; + type Moderation = S::Moderation; + type Blobs = S::Blobs; + type Uri = S::Uri; type Cid = S::Cid; type Value = S::Value; - type Blobs = S::Blobs; type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; - type Uri = S::Uri; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { + ///State transition - sets the `moderation` field to Set + pub struct SetModeration(PhantomData S>); + impl sealed::Sealed for SetModeration {} + impl State for SetModeration { type Repo = S::Repo; - type Cid = Set; - type Value = S::Value; + type Moderation = Set; type Blobs = S::Blobs; - type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; - type Uri = S::Uri; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type Repo = S::Repo; - type Cid = S::Cid; - type Value = Set; - type Blobs = S::Blobs; - type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; type Uri = S::Uri; + type Cid = S::Cid; + type Value = S::Value; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `blobs` field to Set pub struct SetBlobs(PhantomData S>); impl sealed::Sealed for SetBlobs {} impl State for SetBlobs { type Repo = S::Repo; + type Moderation = S::Moderation; + type Blobs = Set; + type Uri = S::Uri; type Cid = S::Cid; type Value = S::Value; - type Blobs = Set; type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; - type Uri = S::Uri; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type Repo = S::Repo; + type Moderation = S::Moderation; + type Blobs = S::Blobs; + type Uri = Set; type Cid = S::Cid; type Value = S::Value; - type Blobs = S::Blobs; - type IndexedAt = Set; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Repo = S::Repo; type Moderation = S::Moderation; + type Blobs = S::Blobs; type Uri = S::Uri; + type Cid = Set; + type Value = S::Value; + type IndexedAt = S::IndexedAt; } - ///State transition - sets the `moderation` field to Set - pub struct SetModeration(PhantomData S>); - impl sealed::Sealed for SetModeration {} - impl State for SetModeration { + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { type Repo = S::Repo; - type Cid = S::Cid; - type Value = S::Value; + type Moderation = S::Moderation; type Blobs = S::Blobs; - type IndexedAt = S::IndexedAt; - type Moderation = Set; type Uri = S::Uri; + type Cid = S::Cid; + type Value = Set; + type IndexedAt = S::IndexedAt; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { type Repo = S::Repo; + type Moderation = S::Moderation; + type Blobs = S::Blobs; + type Uri = S::Uri; type Cid = S::Cid; type Value = S::Value; - type Blobs = S::Blobs; - type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; - type Uri = Set; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `moderation` field + pub struct moderation(()); + ///Marker type for the `blobs` field + pub struct blobs(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `value` field pub struct value(()); - ///Marker type for the `blobs` field - pub struct blobs(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `moderation` field - pub struct moderation(()); - ///Marker type for the `uri` field - pub struct uri(()); } } @@ -9794,12 +9794,12 @@ impl<'a, S> RecordViewDetailBuilder<'a, S> where S: record_view_detail_state::State, S::Repo: record_view_detail_state::IsSet, + S::Moderation: record_view_detail_state::IsSet, + S::Blobs: record_view_detail_state::IsSet, + S::Uri: record_view_detail_state::IsSet, S::Cid: record_view_detail_state::IsSet, S::Value: record_view_detail_state::IsSet, - S::Blobs: record_view_detail_state::IsSet, S::IndexedAt: record_view_detail_state::IsSet, - S::Moderation: record_view_detail_state::IsSet, - S::Uri: record_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordViewDetail<'a> { @@ -10100,83 +10100,83 @@ pub mod repo_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type RelatedRecords; - type IndexedAt; type Moderation; type Did; + type RelatedRecords; + type IndexedAt; type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type RelatedRecords = Unset; - type IndexedAt = Unset; type Moderation = Unset; type Did = Unset; + type RelatedRecords = Unset; + type IndexedAt = Unset; type Handle = Unset; } - ///State transition - sets the `related_records` field to Set - pub struct SetRelatedRecords(PhantomData S>); - impl sealed::Sealed for SetRelatedRecords {} - impl State for SetRelatedRecords { - type RelatedRecords = Set; - type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; - type Did = S::Did; - type Handle = S::Handle; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type RelatedRecords = S::RelatedRecords; - type IndexedAt = Set; - type Moderation = S::Moderation; - type Did = S::Did; - type Handle = S::Handle; - } ///State transition - sets the `moderation` field to Set pub struct SetModeration(PhantomData S>); impl sealed::Sealed for SetModeration {} impl State for SetModeration { - type RelatedRecords = S::RelatedRecords; - type IndexedAt = S::IndexedAt; type Moderation = Set; type Did = S::Did; + type RelatedRecords = S::RelatedRecords; + type IndexedAt = S::IndexedAt; type Handle = S::Handle; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { + type Moderation = S::Moderation; + type Did = Set; type RelatedRecords = S::RelatedRecords; type IndexedAt = S::IndexedAt; + type Handle = S::Handle; + } + ///State transition - sets the `related_records` field to Set + pub struct SetRelatedRecords(PhantomData S>); + impl sealed::Sealed for SetRelatedRecords {} + impl State for SetRelatedRecords { + type Moderation = S::Moderation; + type Did = S::Did; + type RelatedRecords = Set; + type IndexedAt = S::IndexedAt; + type Handle = S::Handle; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { type Moderation = S::Moderation; - type Did = Set; + type Did = S::Did; + type RelatedRecords = S::RelatedRecords; + type IndexedAt = Set; type Handle = S::Handle; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type RelatedRecords = S::RelatedRecords; - type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; type Did = S::Did; + type RelatedRecords = S::RelatedRecords; + type IndexedAt = S::IndexedAt; type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `related_records` field - pub struct related_records(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `moderation` field pub struct moderation(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `related_records` field + pub struct related_records(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `handle` field pub struct handle(()); } @@ -10434,10 +10434,10 @@ impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> { impl<'a, S> RepoViewBuilder<'a, S> where S: repo_view_state::State, - S::RelatedRecords: repo_view_state::IsSet, - S::IndexedAt: repo_view_state::IsSet, S::Moderation: repo_view_state::IsSet, S::Did: repo_view_state::IsSet, + S::RelatedRecords: repo_view_state::IsSet, + S::IndexedAt: repo_view_state::IsSet, S::Handle: repo_view_state::IsSet, { /// Build the final struct @@ -10560,85 +10560,85 @@ pub mod repo_view_detail_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Handle; - type RelatedRecords; type IndexedAt; + type Did; type Moderation; + type RelatedRecords; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Handle = Unset; - type RelatedRecords = Unset; type IndexedAt = Unset; + type Did = Unset; type Moderation = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Handle = S::Handle; - type RelatedRecords = S::RelatedRecords; - type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; + type RelatedRecords = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Did = S::Did; type Handle = Set; - type RelatedRecords = S::RelatedRecords; type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; - } - ///State transition - sets the `related_records` field to Set - pub struct SetRelatedRecords(PhantomData S>); - impl sealed::Sealed for SetRelatedRecords {} - impl State for SetRelatedRecords { type Did = S::Did; - type Handle = S::Handle; - type RelatedRecords = Set; - type IndexedAt = S::IndexedAt; type Moderation = S::Moderation; + type RelatedRecords = S::RelatedRecords; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Did = S::Did; type Handle = S::Handle; - type RelatedRecords = S::RelatedRecords; type IndexedAt = Set; + type Did = S::Did; type Moderation = S::Moderation; + type RelatedRecords = S::RelatedRecords; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = S::Handle; + type IndexedAt = S::IndexedAt; + type Did = Set; + type Moderation = S::Moderation; + type RelatedRecords = S::RelatedRecords; } ///State transition - sets the `moderation` field to Set pub struct SetModeration(PhantomData S>); impl sealed::Sealed for SetModeration {} impl State for SetModeration { - type Did = S::Did; type Handle = S::Handle; - type RelatedRecords = S::RelatedRecords; type IndexedAt = S::IndexedAt; + type Did = S::Did; type Moderation = Set; + type RelatedRecords = S::RelatedRecords; + } + ///State transition - sets the `related_records` field to Set + pub struct SetRelatedRecords(PhantomData S>); + impl sealed::Sealed for SetRelatedRecords {} + impl State for SetRelatedRecords { + type Handle = S::Handle; + type IndexedAt = S::IndexedAt; + type Did = S::Did; + type Moderation = S::Moderation; + type RelatedRecords = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); - ///Marker type for the `related_records` field - pub struct related_records(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `moderation` field pub struct moderation(()); + ///Marker type for the `related_records` field + pub struct related_records(()); } } @@ -10957,11 +10957,11 @@ impl<'a, S: repo_view_detail_state::State> RepoViewDetailBuilder<'a, S> { impl<'a, S> RepoViewDetailBuilder<'a, S> where S: repo_view_detail_state::State, - S::Did: repo_view_detail_state::IsSet, S::Handle: repo_view_detail_state::IsSet, - S::RelatedRecords: repo_view_detail_state::IsSet, S::IndexedAt: repo_view_detail_state::IsSet, + S::Did: repo_view_detail_state::IsSet, S::Moderation: repo_view_detail_state::IsSet, + S::RelatedRecords: repo_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> RepoViewDetail<'a> { @@ -11208,177 +11208,177 @@ pub mod reporter_stats_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ReportedRecordCount; - type Did; type LabeledRecordCount; - type TakendownAccountCount; - type LabeledAccountCount; - type ReportedAccountCount; type TakendownRecordCount; - type AccountReportCount; type RecordReportCount; + type LabeledAccountCount; + type AccountReportCount; + type TakendownAccountCount; + type ReportedAccountCount; + type ReportedRecordCount; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ReportedRecordCount = Unset; - type Did = Unset; type LabeledRecordCount = Unset; - type TakendownAccountCount = Unset; - type LabeledAccountCount = Unset; - type ReportedAccountCount = Unset; type TakendownRecordCount = Unset; - type AccountReportCount = Unset; type RecordReportCount = Unset; - } - ///State transition - sets the `reported_record_count` field to Set - pub struct SetReportedRecordCount(PhantomData S>); - impl sealed::Sealed for SetReportedRecordCount {} - impl State for SetReportedRecordCount { - type ReportedRecordCount = Set; - type Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; - type ReportedAccountCount = S::ReportedAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; - type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type ReportedRecordCount = S::ReportedRecordCount; - type Did = Set; - type LabeledRecordCount = S::LabeledRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; - type ReportedAccountCount = S::ReportedAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; - type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; + type LabeledAccountCount = Unset; + type AccountReportCount = Unset; + type TakendownAccountCount = Unset; + type ReportedAccountCount = Unset; + type ReportedRecordCount = Unset; + type Did = Unset; } ///State transition - sets the `labeled_record_count` field to Set pub struct SetLabeledRecordCount(PhantomData S>); impl sealed::Sealed for SetLabeledRecordCount {} impl State for SetLabeledRecordCount { - type ReportedRecordCount = S::ReportedRecordCount; - type Did = S::Did; type LabeledRecordCount = Set; - type TakendownAccountCount = S::TakendownAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; - type ReportedAccountCount = S::ReportedAccountCount; type TakendownRecordCount = S::TakendownRecordCount; - type AccountReportCount = S::AccountReportCount; type RecordReportCount = S::RecordReportCount; - } - ///State transition - sets the `takendown_account_count` field to Set - pub struct SetTakendownAccountCount(PhantomData S>); - impl sealed::Sealed for SetTakendownAccountCount {} - impl State for SetTakendownAccountCount { + type LabeledAccountCount = S::LabeledAccountCount; + type AccountReportCount = S::AccountReportCount; + type TakendownAccountCount = S::TakendownAccountCount; + type ReportedAccountCount = S::ReportedAccountCount; type ReportedRecordCount = S::ReportedRecordCount; type Did = S::Did; + } + ///State transition - sets the `takendown_record_count` field to Set + pub struct SetTakendownRecordCount(PhantomData S>); + impl sealed::Sealed for SetTakendownRecordCount {} + impl State for SetTakendownRecordCount { type LabeledRecordCount = S::LabeledRecordCount; - type TakendownAccountCount = Set; + type TakendownRecordCount = Set; + type RecordReportCount = S::RecordReportCount; type LabeledAccountCount = S::LabeledAccountCount; + type AccountReportCount = S::AccountReportCount; + type TakendownAccountCount = S::TakendownAccountCount; type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type Did = S::Did; + } + ///State transition - sets the `record_report_count` field to Set + pub struct SetRecordReportCount(PhantomData S>); + impl sealed::Sealed for SetRecordReportCount {} + impl State for SetRecordReportCount { + type LabeledRecordCount = S::LabeledRecordCount; type TakendownRecordCount = S::TakendownRecordCount; + type RecordReportCount = Set; + type LabeledAccountCount = S::LabeledAccountCount; type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; + type TakendownAccountCount = S::TakendownAccountCount; + type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type Did = S::Did; } ///State transition - sets the `labeled_account_count` field to Set pub struct SetLabeledAccountCount(PhantomData S>); impl sealed::Sealed for SetLabeledAccountCount {} impl State for SetLabeledAccountCount { - type ReportedRecordCount = S::ReportedRecordCount; - type Did = S::Did; type LabeledRecordCount = S::LabeledRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; - type LabeledAccountCount = Set; - type ReportedAccountCount = S::ReportedAccountCount; type TakendownRecordCount = S::TakendownRecordCount; - type AccountReportCount = S::AccountReportCount; type RecordReportCount = S::RecordReportCount; - } - ///State transition - sets the `reported_account_count` field to Set - pub struct SetReportedAccountCount(PhantomData S>); - impl sealed::Sealed for SetReportedAccountCount {} - impl State for SetReportedAccountCount { - type ReportedRecordCount = S::ReportedRecordCount; - type Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; - type ReportedAccountCount = Set; - type TakendownRecordCount = S::TakendownRecordCount; + type LabeledAccountCount = Set; type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; - } - ///State transition - sets the `takendown_record_count` field to Set - pub struct SetTakendownRecordCount(PhantomData S>); - impl sealed::Sealed for SetTakendownRecordCount {} - impl State for SetTakendownRecordCount { - type ReportedRecordCount = S::ReportedRecordCount; - type Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; type TakendownAccountCount = S::TakendownAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; type ReportedAccountCount = S::ReportedAccountCount; - type TakendownRecordCount = Set; - type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; + type ReportedRecordCount = S::ReportedRecordCount; + type Did = S::Did; } ///State transition - sets the `account_report_count` field to Set pub struct SetAccountReportCount(PhantomData S>); impl sealed::Sealed for SetAccountReportCount {} impl State for SetAccountReportCount { + type LabeledRecordCount = S::LabeledRecordCount; + type TakendownRecordCount = S::TakendownRecordCount; + type RecordReportCount = S::RecordReportCount; + type LabeledAccountCount = S::LabeledAccountCount; + type AccountReportCount = Set; + type TakendownAccountCount = S::TakendownAccountCount; + type ReportedAccountCount = S::ReportedAccountCount; type ReportedRecordCount = S::ReportedRecordCount; type Did = S::Did; + } + ///State transition - sets the `takendown_account_count` field to Set + pub struct SetTakendownAccountCount(PhantomData S>); + impl sealed::Sealed for SetTakendownAccountCount {} + impl State for SetTakendownAccountCount { type LabeledRecordCount = S::LabeledRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type RecordReportCount = S::RecordReportCount; type LabeledAccountCount = S::LabeledAccountCount; + type AccountReportCount = S::AccountReportCount; + type TakendownAccountCount = Set; type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type Did = S::Did; + } + ///State transition - sets the `reported_account_count` field to Set + pub struct SetReportedAccountCount(PhantomData S>); + impl sealed::Sealed for SetReportedAccountCount {} + impl State for SetReportedAccountCount { + type LabeledRecordCount = S::LabeledRecordCount; type TakendownRecordCount = S::TakendownRecordCount; - type AccountReportCount = Set; type RecordReportCount = S::RecordReportCount; - } - ///State transition - sets the `record_report_count` field to Set - pub struct SetRecordReportCount(PhantomData S>); - impl sealed::Sealed for SetRecordReportCount {} - impl State for SetRecordReportCount { + type LabeledAccountCount = S::LabeledAccountCount; + type AccountReportCount = S::AccountReportCount; + type TakendownAccountCount = S::TakendownAccountCount; + type ReportedAccountCount = Set; type ReportedRecordCount = S::ReportedRecordCount; type Did = S::Did; + } + ///State transition - sets the `reported_record_count` field to Set + pub struct SetReportedRecordCount(PhantomData S>); + impl sealed::Sealed for SetReportedRecordCount {} + impl State for SetReportedRecordCount { type LabeledRecordCount = S::LabeledRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type RecordReportCount = S::RecordReportCount; type LabeledAccountCount = S::LabeledAccountCount; + type AccountReportCount = S::AccountReportCount; + type TakendownAccountCount = S::TakendownAccountCount; type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type LabeledRecordCount = S::LabeledRecordCount; type TakendownRecordCount = S::TakendownRecordCount; + type RecordReportCount = S::RecordReportCount; + type LabeledAccountCount = S::LabeledAccountCount; type AccountReportCount = S::AccountReportCount; - type RecordReportCount = Set; + type TakendownAccountCount = S::TakendownAccountCount; + type ReportedAccountCount = S::ReportedAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reported_record_count` field - pub struct reported_record_count(()); - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `labeled_record_count` field pub struct labeled_record_count(()); - ///Marker type for the `takendown_account_count` field - pub struct takendown_account_count(()); - ///Marker type for the `labeled_account_count` field - pub struct labeled_account_count(()); - ///Marker type for the `reported_account_count` field - pub struct reported_account_count(()); ///Marker type for the `takendown_record_count` field pub struct takendown_record_count(()); - ///Marker type for the `account_report_count` field - pub struct account_report_count(()); ///Marker type for the `record_report_count` field pub struct record_report_count(()); + ///Marker type for the `labeled_account_count` field + pub struct labeled_account_count(()); + ///Marker type for the `account_report_count` field + pub struct account_report_count(()); + ///Marker type for the `takendown_account_count` field + pub struct takendown_account_count(()); + ///Marker type for the `reported_account_count` field + pub struct reported_account_count(()); + ///Marker type for the `reported_record_count` field + pub struct reported_record_count(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -11601,15 +11601,15 @@ where impl<'a, S> ReporterStatsBuilder<'a, S> where S: reporter_stats_state::State, - S::ReportedRecordCount: reporter_stats_state::IsSet, - S::Did: reporter_stats_state::IsSet, S::LabeledRecordCount: reporter_stats_state::IsSet, - S::TakendownAccountCount: reporter_stats_state::IsSet, - S::LabeledAccountCount: reporter_stats_state::IsSet, - S::ReportedAccountCount: reporter_stats_state::IsSet, S::TakendownRecordCount: reporter_stats_state::IsSet, - S::AccountReportCount: reporter_stats_state::IsSet, S::RecordReportCount: reporter_stats_state::IsSet, + S::LabeledAccountCount: reporter_stats_state::IsSet, + S::AccountReportCount: reporter_stats_state::IsSet, + S::TakendownAccountCount: reporter_stats_state::IsSet, + S::ReportedAccountCount: reporter_stats_state::IsSet, + S::ReportedRecordCount: reporter_stats_state::IsSet, + S::Did: reporter_stats_state::IsSet, { /// Build the final struct pub fn build(self) -> ReporterStats<'a> { @@ -11887,105 +11887,105 @@ pub mod scheduled_action_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; - type Action; type Did; - type Id; + type Action; type CreatedBy; type Status; + type Id; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; - type Action = Unset; type Did = Unset; - type Id = Unset; + type Action = Unset; type CreatedBy = Unset; type Status = Unset; + type Id = Unset; + type CreatedAt = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; type Action = S::Action; - type Did = S::Did; - type Id = S::Id; type CreatedBy = S::CreatedBy; type Status = S::Status; + type Id = S::Id; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { - type CreatedAt = S::CreatedAt; - type Action = Set; type Did = S::Did; - type Id = S::Id; + type Action = Set; type CreatedBy = S::CreatedBy; type Status = S::Status; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type CreatedAt = S::CreatedAt; - type Action = S::Action; - type Did = Set; type Id = S::Id; - type CreatedBy = S::CreatedBy; - type Status = S::Status; - } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { type CreatedAt = S::CreatedAt; - type Action = S::Action; - type Did = S::Did; - type Id = Set; - type CreatedBy = S::CreatedBy; - type Status = S::Status; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type CreatedAt = S::CreatedAt; - type Action = S::Action; type Did = S::Did; - type Id = S::Id; + type Action = S::Action; type CreatedBy = Set; type Status = S::Status; + type Id = S::Id; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { + type Did = S::Did; + type Action = S::Action; + type CreatedBy = S::CreatedBy; + type Status = Set; + type Id = S::Id; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Did = S::Did; type Action = S::Action; + type CreatedBy = S::CreatedBy; + type Status = S::Status; + type Id = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { type Did = S::Did; - type Id = S::Id; + type Action = S::Action; type CreatedBy = S::CreatedBy; - type Status = Set; + type Status = S::Status; + type Id = S::Id; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `action` field - pub struct action(()); ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `id` field - pub struct id(()); + ///Marker type for the `action` field + pub struct action(()); ///Marker type for the `created_by` field pub struct created_by(()); ///Marker type for the `status` field pub struct status(()); + ///Marker type for the `id` field + pub struct id(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -12322,12 +12322,12 @@ impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S impl<'a, S> ScheduledActionViewBuilder<'a, S> where S: scheduled_action_view_state::State, - S::CreatedAt: scheduled_action_view_state::IsSet, - S::Action: scheduled_action_view_state::IsSet, S::Did: scheduled_action_view_state::IsSet, - S::Id: scheduled_action_view_state::IsSet, + S::Action: scheduled_action_view_state::IsSet, S::CreatedBy: scheduled_action_view_state::IsSet, S::Status: scheduled_action_view_state::IsSet, + S::Id: scheduled_action_view_state::IsSet, + S::CreatedAt: scheduled_action_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ScheduledActionView<'a> { @@ -12617,83 +12617,83 @@ pub mod subject_status_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; - type ReviewState; type CreatedAt; type UpdatedAt; + type ReviewState; + type Id; type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; - type ReviewState = Unset; type CreatedAt = Unset; type UpdatedAt = Unset; + type ReviewState = Unset; + type Id = Unset; type Subject = Unset; } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Id = Set; - type ReviewState = S::ReviewState; - type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; - type Subject = S::Subject; - } - ///State transition - sets the `review_state` field to Set - pub struct SetReviewState(PhantomData S>); - impl sealed::Sealed for SetReviewState {} - impl State for SetReviewState { - type Id = S::Id; - type ReviewState = Set; - type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; - type Subject = S::Subject; - } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Id = S::Id; - type ReviewState = S::ReviewState; type CreatedAt = Set; type UpdatedAt = S::UpdatedAt; + type ReviewState = S::ReviewState; + type Id = S::Id; type Subject = S::Subject; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { - type Id = S::Id; - type ReviewState = S::ReviewState; type CreatedAt = S::CreatedAt; type UpdatedAt = Set; + type ReviewState = S::ReviewState; + type Id = S::Id; + type Subject = S::Subject; + } + ///State transition - sets the `review_state` field to Set + pub struct SetReviewState(PhantomData S>); + impl sealed::Sealed for SetReviewState {} + impl State for SetReviewState { + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + type ReviewState = Set; + type Id = S::Id; + type Subject = S::Subject; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + type ReviewState = S::ReviewState; + type Id = Set; type Subject = S::Subject; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Id = S::Id; - type ReviewState = S::ReviewState; type CreatedAt = S::CreatedAt; type UpdatedAt = S::UpdatedAt; + type ReviewState = S::ReviewState; + type Id = S::Id; type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `id` field - pub struct id(()); - ///Marker type for the `review_state` field - pub struct review_state(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `updated_at` field pub struct updated_at(()); + ///Marker type for the `review_state` field + pub struct review_state(()); + ///Marker type for the `id` field + pub struct id(()); ///Marker type for the `subject` field pub struct subject(()); } @@ -13230,10 +13230,10 @@ where impl<'a, S> SubjectStatusViewBuilder<'a, S> where S: subject_status_view_state::State, - S::Id: subject_status_view_state::IsSet, - S::ReviewState: subject_status_view_state::IsSet, S::CreatedAt: subject_status_view_state::IsSet, S::UpdatedAt: subject_status_view_state::IsSet, + S::ReviewState: subject_status_view_state::IsSet, + S::Id: subject_status_view_state::IsSet, S::Subject: subject_status_view_state::IsSet, { /// Build the final struct @@ -13747,50 +13747,50 @@ pub mod video_details_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Width; - type Length; type Height; + type Length; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Width = Unset; - type Length = Unset; type Height = Unset; + type Length = Unset; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData S>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { type Width = Set; - type Length = S::Length; - type Height = S::Height; - } - ///State transition - sets the `length` field to Set - pub struct SetLength(PhantomData S>); - impl sealed::Sealed for SetLength {} - impl State for SetLength { - type Width = S::Width; - type Length = Set; type Height = S::Height; + type Length = S::Length; } ///State transition - sets the `height` field to Set pub struct SetHeight(PhantomData S>); impl sealed::Sealed for SetHeight {} impl State for SetHeight { type Width = S::Width; - type Length = S::Length; type Height = Set; + type Length = S::Length; + } + ///State transition - sets the `length` field to Set + pub struct SetLength(PhantomData S>); + impl sealed::Sealed for SetLength {} + impl State for SetLength { + type Width = S::Width; + type Height = S::Height; + type Length = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `width` field pub struct width(()); - ///Marker type for the `length` field - pub struct length(()); ///Marker type for the `height` field pub struct height(()); + ///Marker type for the `length` field + pub struct length(()); } } @@ -13884,8 +13884,8 @@ impl<'a, S> VideoDetailsBuilder<'a, S> where S: video_details_state::State, S::Width: video_details_state::IsSet, - S::Length: video_details_state::IsSet, S::Height: video_details_state::IsSet, + S::Length: video_details_state::IsSet, { /// Build the final struct pub fn build(self) -> VideoDetails<'a> { diff --git a/crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs b/crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs index 43a4388..2645ecb 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/cancel_scheduled_actions.rs @@ -37,37 +37,37 @@ pub mod cancellation_results_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Succeeded; type Failed; + type Succeeded; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Succeeded = Unset; type Failed = Unset; - } - ///State transition - sets the `succeeded` field to Set - pub struct SetSucceeded(PhantomData S>); - impl sealed::Sealed for SetSucceeded {} - impl State for SetSucceeded { - type Succeeded = Set; - type Failed = S::Failed; + type Succeeded = Unset; } ///State transition - sets the `failed` field to Set pub struct SetFailed(PhantomData S>); impl sealed::Sealed for SetFailed {} impl State for SetFailed { - type Succeeded = S::Succeeded; type Failed = Set; + type Succeeded = S::Succeeded; + } + ///State transition - sets the `succeeded` field to Set + pub struct SetSucceeded(PhantomData S>); + impl sealed::Sealed for SetSucceeded {} + impl State for SetSucceeded { + type Failed = S::Failed; + type Succeeded = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `succeeded` field - pub struct succeeded(()); ///Marker type for the `failed` field pub struct failed(()); + ///Marker type for the `succeeded` field + pub struct succeeded(()); } } @@ -152,8 +152,8 @@ where impl<'a, S> CancellationResultsBuilder<'a, S> where S: cancellation_results_state::State, - S::Succeeded: cancellation_results_state::IsSet, S::Failed: cancellation_results_state::IsSet, + S::Succeeded: cancellation_results_state::IsSet, { /// Build the final struct pub fn build(self) -> CancellationResults<'a> { @@ -453,37 +453,37 @@ pub mod failed_cancellation_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Error; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Error = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Error = S::Error; + type Did = Unset; } ///State transition - sets the `error` field to Set pub struct SetError(PhantomData S>); impl sealed::Sealed for SetError {} impl State for SetError { - type Did = S::Did; type Error = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Error = S::Error; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `error` field pub struct error(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -576,8 +576,8 @@ impl<'a, S: failed_cancellation_state::State> FailedCancellationBuilder<'a, S> { impl<'a, S> FailedCancellationBuilder<'a, S> where S: failed_cancellation_state::State, - S::Did: failed_cancellation_state::IsSet, S::Error: failed_cancellation_state::IsSet, + S::Did: failed_cancellation_state::IsSet, { /// Build the final struct pub fn build(self) -> FailedCancellation<'a> { diff --git a/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs b/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs index 4e31137..8bf3d12 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs @@ -47,49 +47,49 @@ pub mod emit_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Event; type Subject; + type Event; type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Event = Unset; type Subject = Unset; + type Event = Unset; type CreatedBy = Unset; } - ///State transition - sets the `event` field to Set - pub struct SetEvent(PhantomData S>); - impl sealed::Sealed for SetEvent {} - impl State for SetEvent { - type Event = Set; - type Subject = S::Subject; - type CreatedBy = S::CreatedBy; - } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Event = S::Event; type Subject = Set; + type Event = S::Event; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `event` field to Set + pub struct SetEvent(PhantomData S>); + impl sealed::Sealed for SetEvent {} + impl State for SetEvent { + type Subject = S::Subject; + type Event = Set; type CreatedBy = S::CreatedBy; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type Event = S::Event; type Subject = S::Subject; + type Event = S::Event; type CreatedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `event` field - pub struct event(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `event` field + pub struct event(()); ///Marker type for the `created_by` field pub struct created_by(()); } @@ -244,8 +244,8 @@ impl<'a, S: emit_event_state::State> EmitEventBuilder<'a, S> { impl<'a, S> EmitEventBuilder<'a, S> where S: emit_event_state::State, - S::Event: emit_event_state::IsSet, S::Subject: emit_event_state::IsSet, + S::Event: emit_event_state::IsSet, S::CreatedBy: emit_event_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs b/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs index fe63878..8f7645f 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs @@ -575,49 +575,49 @@ pub mod timeline_item_summary_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type EventType; type Count; + type EventType; type EventSubjectType; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type EventType = Unset; type Count = Unset; + type EventType = Unset; type EventSubjectType = Unset; } - ///State transition - sets the `event_type` field to Set - pub struct SetEventType(PhantomData S>); - impl sealed::Sealed for SetEventType {} - impl State for SetEventType { - type EventType = Set; - type Count = S::Count; - type EventSubjectType = S::EventSubjectType; - } ///State transition - sets the `count` field to Set pub struct SetCount(PhantomData S>); impl sealed::Sealed for SetCount {} impl State for SetCount { - type EventType = S::EventType; type Count = Set; + type EventType = S::EventType; + type EventSubjectType = S::EventSubjectType; + } + ///State transition - sets the `event_type` field to Set + pub struct SetEventType(PhantomData S>); + impl sealed::Sealed for SetEventType {} + impl State for SetEventType { + type Count = S::Count; + type EventType = Set; type EventSubjectType = S::EventSubjectType; } ///State transition - sets the `event_subject_type` field to Set pub struct SetEventSubjectType(PhantomData S>); impl sealed::Sealed for SetEventSubjectType {} impl State for SetEventSubjectType { - type EventType = S::EventType; type Count = S::Count; + type EventType = S::EventType; type EventSubjectType = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `event_type` field - pub struct event_type(()); ///Marker type for the `count` field pub struct count(()); + ///Marker type for the `event_type` field + pub struct event_type(()); ///Marker type for the `event_subject_type` field pub struct event_subject_type(()); } @@ -715,8 +715,8 @@ where impl<'a, S> TimelineItemSummaryBuilder<'a, S> where S: timeline_item_summary_state::State, - S::EventType: timeline_item_summary_state::IsSet, S::Count: timeline_item_summary_state::IsSet, + S::EventType: timeline_item_summary_state::IsSet, S::EventSubjectType: timeline_item_summary_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs b/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs index 5c6433f..3205a2f 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs @@ -761,67 +761,67 @@ pub mod schedule_action_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedBy; type Subjects; - type Action; + type CreatedBy; type Scheduling; + type Action; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedBy = Unset; type Subjects = Unset; - type Action = Unset; + type CreatedBy = Unset; type Scheduling = Unset; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type CreatedBy = Set; - type Subjects = S::Subjects; - type Action = S::Action; - type Scheduling = S::Scheduling; + type Action = Unset; } ///State transition - sets the `subjects` field to Set pub struct SetSubjects(PhantomData S>); impl sealed::Sealed for SetSubjects {} impl State for SetSubjects { - type CreatedBy = S::CreatedBy; type Subjects = Set; - type Action = S::Action; + type CreatedBy = S::CreatedBy; type Scheduling = S::Scheduling; + type Action = S::Action; } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData S>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type CreatedBy = S::CreatedBy; + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { type Subjects = S::Subjects; - type Action = Set; + type CreatedBy = Set; type Scheduling = S::Scheduling; + type Action = S::Action; } ///State transition - sets the `scheduling` field to Set pub struct SetScheduling(PhantomData S>); impl sealed::Sealed for SetScheduling {} impl State for SetScheduling { - type CreatedBy = S::CreatedBy; type Subjects = S::Subjects; - type Action = S::Action; + type CreatedBy = S::CreatedBy; type Scheduling = Set; + type Action = S::Action; + } + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData S>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { + type Subjects = S::Subjects; + type CreatedBy = S::CreatedBy; + type Scheduling = S::Scheduling; + type Action = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_by` field - pub struct created_by(()); ///Marker type for the `subjects` field pub struct subjects(()); - ///Marker type for the `action` field - pub struct action(()); + ///Marker type for the `created_by` field + pub struct created_by(()); ///Marker type for the `scheduling` field pub struct scheduling(()); + ///Marker type for the `action` field + pub struct action(()); } } @@ -960,10 +960,10 @@ where impl<'a, S> ScheduleActionBuilder<'a, S> where S: schedule_action_state::State, - S::CreatedBy: schedule_action_state::IsSet, S::Subjects: schedule_action_state::IsSet, - S::Action: schedule_action_state::IsSet, + S::CreatedBy: schedule_action_state::IsSet, S::Scheduling: schedule_action_state::IsSet, + S::Action: schedule_action_state::IsSet, { /// Build the final struct pub fn build(self) -> ScheduleAction<'a> { @@ -1072,37 +1072,37 @@ pub mod scheduled_action_results_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Succeeded; type Failed; + type Succeeded; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Succeeded = Unset; type Failed = Unset; - } - ///State transition - sets the `succeeded` field to Set - pub struct SetSucceeded(PhantomData S>); - impl sealed::Sealed for SetSucceeded {} - impl State for SetSucceeded { - type Succeeded = Set; - type Failed = S::Failed; + type Succeeded = Unset; } ///State transition - sets the `failed` field to Set pub struct SetFailed(PhantomData S>); impl sealed::Sealed for SetFailed {} impl State for SetFailed { - type Succeeded = S::Succeeded; type Failed = Set; + type Succeeded = S::Succeeded; + } + ///State transition - sets the `succeeded` field to Set + pub struct SetSucceeded(PhantomData S>); + impl sealed::Sealed for SetSucceeded {} + impl State for SetSucceeded { + type Failed = S::Failed; + type Succeeded = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `succeeded` field - pub struct succeeded(()); ///Marker type for the `failed` field pub struct failed(()); + ///Marker type for the `succeeded` field + pub struct succeeded(()); } } @@ -1188,8 +1188,8 @@ where impl<'a, S> ScheduledActionResultsBuilder<'a, S> where S: scheduled_action_results_state::State, - S::Succeeded: scheduled_action_results_state::IsSet, S::Failed: scheduled_action_results_state::IsSet, + S::Succeeded: scheduled_action_results_state::IsSet, { /// Build the final struct pub fn build(self) -> ScheduledActionResults<'a> { diff --git a/crates/weaver-api/src/tools_ozone/safelink.rs b/crates/weaver-api/src/tools_ozone/safelink.rs index b812912..4bfe46e 100644 --- a/crates/weaver-api/src/tools_ozone/safelink.rs +++ b/crates/weaver-api/src/tools_ozone/safelink.rs @@ -138,149 +138,149 @@ pub mod event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Url; type Action; - type Reason; - type Id; - type CreatedBy; type Pattern; + type CreatedBy; + type Reason; + type Url; type CreatedAt; + type Id; type EventType; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Url = Unset; type Action = Unset; - type Reason = Unset; - type Id = Unset; - type CreatedBy = Unset; type Pattern = Unset; + type CreatedBy = Unset; + type Reason = Unset; + type Url = Unset; type CreatedAt = Unset; + type Id = Unset; type EventType = Unset; } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData S>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { - type Url = Set; - type Action = S::Action; - type Reason = S::Reason; - type Id = S::Id; - type CreatedBy = S::CreatedBy; - type Pattern = S::Pattern; - type CreatedAt = S::CreatedAt; - type EventType = S::EventType; - } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { - type Url = S::Url; type Action = Set; - type Reason = S::Reason; - type Id = S::Id; - type CreatedBy = S::CreatedBy; type Pattern = S::Pattern; - type CreatedAt = S::CreatedAt; - type EventType = S::EventType; - } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type Url = S::Url; - type Action = S::Action; - type Reason = Set; - type Id = S::Id; type CreatedBy = S::CreatedBy; - type Pattern = S::Pattern; + type Reason = S::Reason; + type Url = S::Url; type CreatedAt = S::CreatedAt; + type Id = S::Id; type EventType = S::EventType; } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Url = S::Url; + ///State transition - sets the `pattern` field to Set + pub struct SetPattern(PhantomData S>); + impl sealed::Sealed for SetPattern {} + impl State for SetPattern { type Action = S::Action; - type Reason = S::Reason; - type Id = Set; + type Pattern = Set; type CreatedBy = S::CreatedBy; - type Pattern = S::Pattern; + type Reason = S::Reason; + type Url = S::Url; type CreatedAt = S::CreatedAt; + type Id = S::Id; type EventType = S::EventType; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type Url = S::Url; type Action = S::Action; + type Pattern = S::Pattern; + type CreatedBy = Set; type Reason = S::Reason; + type Url = S::Url; + type CreatedAt = S::CreatedAt; type Id = S::Id; - type CreatedBy = Set; + type EventType = S::EventType; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Action = S::Action; type Pattern = S::Pattern; + type CreatedBy = S::CreatedBy; + type Reason = Set; + type Url = S::Url; type CreatedAt = S::CreatedAt; + type Id = S::Id; type EventType = S::EventType; } - ///State transition - sets the `pattern` field to Set - pub struct SetPattern(PhantomData S>); - impl sealed::Sealed for SetPattern {} - impl State for SetPattern { - type Url = S::Url; + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { type Action = S::Action; - type Reason = S::Reason; - type Id = S::Id; + type Pattern = S::Pattern; type CreatedBy = S::CreatedBy; - type Pattern = Set; + type Reason = S::Reason; + type Url = Set; type CreatedAt = S::CreatedAt; + type Id = S::Id; type EventType = S::EventType; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Url = S::Url; type Action = S::Action; + type Pattern = S::Pattern; + type CreatedBy = S::CreatedBy; type Reason = S::Reason; + type Url = S::Url; + type CreatedAt = Set; type Id = S::Id; - type CreatedBy = S::CreatedBy; + type EventType = S::EventType; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Action = S::Action; type Pattern = S::Pattern; - type CreatedAt = Set; + type CreatedBy = S::CreatedBy; + type Reason = S::Reason; + type Url = S::Url; + type CreatedAt = S::CreatedAt; + type Id = Set; type EventType = S::EventType; } ///State transition - sets the `event_type` field to Set pub struct SetEventType(PhantomData S>); impl sealed::Sealed for SetEventType {} impl State for SetEventType { - type Url = S::Url; type Action = S::Action; - type Reason = S::Reason; - type Id = S::Id; - type CreatedBy = S::CreatedBy; type Pattern = S::Pattern; + type CreatedBy = S::CreatedBy; + type Reason = S::Reason; + type Url = S::Url; type CreatedAt = S::CreatedAt; + type Id = S::Id; type EventType = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `url` field - pub struct url(()); ///Marker type for the `action` field pub struct action(()); - ///Marker type for the `reason` field - pub struct reason(()); - ///Marker type for the `id` field - pub struct id(()); - ///Marker type for the `created_by` field - pub struct created_by(()); ///Marker type for the `pattern` field pub struct pattern(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `reason` field + pub struct reason(()); + ///Marker type for the `url` field + pub struct url(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `id` field + pub struct id(()); ///Marker type for the `event_type` field pub struct event_type(()); } @@ -502,13 +502,13 @@ where impl<'a, S> EventBuilder<'a, S> where S: event_state::State, - S::Url: event_state::IsSet, S::Action: event_state::IsSet, - S::Reason: event_state::IsSet, - S::Id: event_state::IsSet, - S::CreatedBy: event_state::IsSet, S::Pattern: event_state::IsSet, + S::CreatedBy: event_state::IsSet, + S::Reason: event_state::IsSet, + S::Url: event_state::IsSet, S::CreatedAt: event_state::IsSet, + S::Id: event_state::IsSet, S::EventType: event_state::IsSet, { /// Build the final struct @@ -1233,127 +1233,127 @@ pub mod url_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type CreatedBy; type UpdatedAt; + type Url; type Pattern; type Reason; - type Url; - type CreatedAt; - type CreatedBy; type Action; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type CreatedBy = Unset; type UpdatedAt = Unset; + type Url = Unset; type Pattern = Unset; type Reason = Unset; - type Url = Unset; - type CreatedAt = Unset; - type CreatedBy = Unset; type Action = Unset; + type CreatedAt = Unset; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type CreatedBy = Set; + type UpdatedAt = S::UpdatedAt; + type Url = S::Url; + type Pattern = S::Pattern; + type Reason = S::Reason; + type Action = S::Action; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { + type CreatedBy = S::CreatedBy; type UpdatedAt = Set; + type Url = S::Url; type Pattern = S::Pattern; type Reason = S::Reason; - type Url = S::Url; + type Action = S::Action; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { type CreatedBy = S::CreatedBy; + type UpdatedAt = S::UpdatedAt; + type Url = Set; + type Pattern = S::Pattern; + type Reason = S::Reason; type Action = S::Action; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { + type CreatedBy = S::CreatedBy; type UpdatedAt = S::UpdatedAt; + type Url = S::Url; type Pattern = Set; type Reason = S::Reason; - type Url = S::Url; - type CreatedAt = S::CreatedAt; - type CreatedBy = S::CreatedBy; type Action = S::Action; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); impl sealed::Sealed for SetReason {} impl State for SetReason { + type CreatedBy = S::CreatedBy; type UpdatedAt = S::UpdatedAt; + type Url = S::Url; type Pattern = S::Pattern; type Reason = Set; - type Url = S::Url; - type CreatedAt = S::CreatedAt; - type CreatedBy = S::CreatedBy; type Action = S::Action; + type CreatedAt = S::CreatedAt; } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData S>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData S>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { + type CreatedBy = S::CreatedBy; type UpdatedAt = S::UpdatedAt; + type Url = S::Url; type Pattern = S::Pattern; type Reason = S::Reason; - type Url = Set; + type Action = Set; type CreatedAt = S::CreatedAt; - type CreatedBy = S::CreatedBy; - type Action = S::Action; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type UpdatedAt = S::UpdatedAt; - type Pattern = S::Pattern; - type Reason = S::Reason; - type Url = S::Url; - type CreatedAt = Set; type CreatedBy = S::CreatedBy; - type Action = S::Action; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { type UpdatedAt = S::UpdatedAt; - type Pattern = S::Pattern; - type Reason = S::Reason; type Url = S::Url; - type CreatedAt = S::CreatedAt; - type CreatedBy = Set; - type Action = S::Action; - } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData S>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type UpdatedAt = S::UpdatedAt; type Pattern = S::Pattern; type Reason = S::Reason; - type Url = S::Url; - type CreatedAt = S::CreatedAt; - type CreatedBy = S::CreatedBy; - type Action = Set; + type Action = S::Action; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `created_by` field + pub struct created_by(()); ///Marker type for the `updated_at` field pub struct updated_at(()); + ///Marker type for the `url` field + pub struct url(()); ///Marker type for the `pattern` field pub struct pattern(()); ///Marker type for the `reason` field pub struct reason(()); - ///Marker type for the `url` field - pub struct url(()); - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `created_by` field - pub struct created_by(()); ///Marker type for the `action` field pub struct action(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -1543,13 +1543,13 @@ where impl<'a, S> UrlRuleBuilder<'a, S> where S: url_rule_state::State, + S::CreatedBy: url_rule_state::IsSet, S::UpdatedAt: url_rule_state::IsSet, + S::Url: url_rule_state::IsSet, S::Pattern: url_rule_state::IsSet, S::Reason: url_rule_state::IsSet, - S::Url: url_rule_state::IsSet, - S::CreatedAt: url_rule_state::IsSet, - S::CreatedBy: url_rule_state::IsSet, S::Action: url_rule_state::IsSet, + S::CreatedAt: url_rule_state::IsSet, { /// Build the final struct pub fn build(self) -> UrlRule<'a> { diff --git a/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs index 7b2a7f7..40e4f54 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs @@ -46,67 +46,67 @@ pub mod add_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Url; type Pattern; type Reason; type Action; - type Url; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Url = Unset; type Pattern = Unset; type Reason = Unset; type Action = Unset; - type Url = Unset; + } + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type Url = Set; + type Pattern = S::Pattern; + type Reason = S::Reason; + type Action = S::Action; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { + type Url = S::Url; type Pattern = Set; type Reason = S::Reason; type Action = S::Action; - type Url = S::Url; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); impl sealed::Sealed for SetReason {} impl State for SetReason { + type Url = S::Url; type Pattern = S::Pattern; type Reason = Set; type Action = S::Action; - type Url = S::Url; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { - type Pattern = S::Pattern; - type Reason = S::Reason; - type Action = Set; type Url = S::Url; - } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData S>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { type Pattern = S::Pattern; type Reason = S::Reason; - type Action = S::Action; - type Url = Set; + type Action = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `url` field + pub struct url(()); ///Marker type for the `pattern` field pub struct pattern(()); ///Marker type for the `reason` field pub struct reason(()); ///Marker type for the `action` field pub struct action(()); - ///Marker type for the `url` field - pub struct url(()); } } @@ -256,10 +256,10 @@ where impl<'a, S> AddRuleBuilder<'a, S> where S: add_rule_state::State, + S::Url: add_rule_state::IsSet, S::Pattern: add_rule_state::IsSet, S::Reason: add_rule_state::IsSet, S::Action: add_rule_state::IsSet, - S::Url: add_rule_state::IsSet, { /// Build the final struct pub fn build(self) -> AddRule<'a> { diff --git a/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs index fb94be1..5ea6842 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs @@ -48,8 +48,8 @@ pub mod update_rule_state { pub trait State: sealed::Sealed { type Reason; type Action; - type Url; type Pattern; + type Url; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -57,8 +57,8 @@ pub mod update_rule_state { impl State for Empty { type Reason = Unset; type Action = Unset; - type Url = Unset; type Pattern = Unset; + type Url = Unset; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); @@ -66,8 +66,8 @@ pub mod update_rule_state { impl State for SetReason { type Reason = Set; type Action = S::Action; - type Url = S::Url; type Pattern = S::Pattern; + type Url = S::Url; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); @@ -75,17 +75,8 @@ pub mod update_rule_state { impl State for SetAction { type Reason = S::Reason; type Action = Set; - type Url = S::Url; - type Pattern = S::Pattern; - } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData S>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { - type Reason = S::Reason; - type Action = S::Action; - type Url = Set; type Pattern = S::Pattern; + type Url = S::Url; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); @@ -93,8 +84,17 @@ pub mod update_rule_state { impl State for SetPattern { type Reason = S::Reason; type Action = S::Action; - type Url = S::Url; type Pattern = Set; + type Url = S::Url; + } + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type Reason = S::Reason; + type Action = S::Action; + type Pattern = S::Pattern; + type Url = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -103,10 +103,10 @@ pub mod update_rule_state { pub struct reason(()); ///Marker type for the `action` field pub struct action(()); - ///Marker type for the `url` field - pub struct url(()); ///Marker type for the `pattern` field pub struct pattern(()); + ///Marker type for the `url` field + pub struct url(()); } } @@ -258,8 +258,8 @@ where S: update_rule_state::State, S::Reason: update_rule_state::IsSet, S::Action: update_rule_state::IsSet, - S::Url: update_rule_state::IsSet, S::Pattern: update_rule_state::IsSet, + S::Url: update_rule_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateRule<'a> { diff --git a/crates/weaver-api/src/tools_ozone/set.rs b/crates/weaver-api/src/tools_ozone/set.rs index 2c00443..b0634a8 100644 --- a/crates/weaver-api/src/tools_ozone/set.rs +++ b/crates/weaver-api/src/tools_ozone/set.rs @@ -301,66 +301,66 @@ pub mod set_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Name; - type SetSize; type UpdatedAt; type CreatedAt; + type SetSize; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Name = Unset; - type SetSize = Unset; type UpdatedAt = Unset; type CreatedAt = Unset; + type SetSize = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { type Name = Set; - type SetSize = S::SetSize; - type UpdatedAt = S::UpdatedAt; - type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `set_size` field to Set - pub struct SetSetSize(PhantomData S>); - impl sealed::Sealed for SetSetSize {} - impl State for SetSetSize { - type Name = S::Name; - type SetSize = Set; type UpdatedAt = S::UpdatedAt; type CreatedAt = S::CreatedAt; + type SetSize = S::SetSize; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { type Name = S::Name; - type SetSize = S::SetSize; type UpdatedAt = Set; type CreatedAt = S::CreatedAt; + type SetSize = S::SetSize; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type Name = S::Name; - type SetSize = S::SetSize; type UpdatedAt = S::UpdatedAt; type CreatedAt = Set; + type SetSize = S::SetSize; + } + ///State transition - sets the `set_size` field to Set + pub struct SetSetSize(PhantomData S>); + impl sealed::Sealed for SetSetSize {} + impl State for SetSetSize { + type Name = S::Name; + type UpdatedAt = S::UpdatedAt; + type CreatedAt = S::CreatedAt; + type SetSize = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `name` field pub struct name(()); - ///Marker type for the `set_size` field - pub struct set_size(()); ///Marker type for the `updated_at` field pub struct updated_at(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `set_size` field + pub struct set_size(()); } } @@ -494,9 +494,9 @@ impl<'a, S> SetViewBuilder<'a, S> where S: set_view_state::State, S::Name: set_view_state::IsSet, - S::SetSize: set_view_state::IsSet, S::UpdatedAt: set_view_state::IsSet, S::CreatedAt: set_view_state::IsSet, + S::SetSize: set_view_state::IsSet, { /// Build the final struct pub fn build(self) -> SetView<'a> { diff --git a/crates/weaver-api/src/tools_ozone/set/delete_values.rs b/crates/weaver-api/src/tools_ozone/set/delete_values.rs index 24f250c..e81aea4 100644 --- a/crates/weaver-api/src/tools_ozone/set/delete_values.rs +++ b/crates/weaver-api/src/tools_ozone/set/delete_values.rs @@ -35,37 +35,37 @@ pub mod delete_values_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Values; type Name; + type Values; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Values = Unset; type Name = Unset; - } - ///State transition - sets the `values` field to Set - pub struct SetValues(PhantomData S>); - impl sealed::Sealed for SetValues {} - impl State for SetValues { - type Values = Set; - type Name = S::Name; + type Values = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Values = S::Values; type Name = Set; + type Values = S::Values; + } + ///State transition - sets the `values` field to Set + pub struct SetValues(PhantomData S>); + impl sealed::Sealed for SetValues {} + impl State for SetValues { + type Name = S::Name; + type Values = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `values` field - pub struct values(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `values` field + pub struct values(()); } } @@ -138,8 +138,8 @@ where impl<'a, S> DeleteValuesBuilder<'a, S> where S: delete_values_state::State, - S::Values: delete_values_state::IsSet, S::Name: delete_values_state::IsSet, + S::Values: delete_values_state::IsSet, { /// Build the final struct pub fn build(self) -> DeleteValues<'a> { diff --git a/crates/weaver-api/src/tools_ozone/setting.rs b/crates/weaver-api/src/tools_ozone/setting.rs index b4b04ce..ad88a49 100644 --- a/crates/weaver-api/src/tools_ozone/setting.rs +++ b/crates/weaver-api/src/tools_ozone/setting.rs @@ -55,105 +55,105 @@ pub mod defs_option_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Key; + type CreatedBy; + type Scope; type LastUpdatedBy; type Value; type Did; - type Key; - type Scope; - type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Key = Unset; + type CreatedBy = Unset; + type Scope = Unset; type LastUpdatedBy = Unset; type Value = Unset; type Did = Unset; - type Key = Unset; - type Scope = Unset; - type CreatedBy = Unset; + } + ///State transition - sets the `key` field to Set + pub struct SetKey(PhantomData S>); + impl sealed::Sealed for SetKey {} + impl State for SetKey { + type Key = Set; + type CreatedBy = S::CreatedBy; + type Scope = S::Scope; + type LastUpdatedBy = S::LastUpdatedBy; + type Value = S::Value; + type Did = S::Did; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type Key = S::Key; + type CreatedBy = Set; + type Scope = S::Scope; + type LastUpdatedBy = S::LastUpdatedBy; + type Value = S::Value; + type Did = S::Did; + } + ///State transition - sets the `scope` field to Set + pub struct SetScope(PhantomData S>); + impl sealed::Sealed for SetScope {} + impl State for SetScope { + type Key = S::Key; + type CreatedBy = S::CreatedBy; + type Scope = Set; + type LastUpdatedBy = S::LastUpdatedBy; + type Value = S::Value; + type Did = S::Did; } ///State transition - sets the `last_updated_by` field to Set pub struct SetLastUpdatedBy(PhantomData S>); impl sealed::Sealed for SetLastUpdatedBy {} impl State for SetLastUpdatedBy { + type Key = S::Key; + type CreatedBy = S::CreatedBy; + type Scope = S::Scope; type LastUpdatedBy = Set; type Value = S::Value; type Did = S::Did; - type Key = S::Key; - type Scope = S::Scope; - type CreatedBy = S::CreatedBy; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { + type Key = S::Key; + type CreatedBy = S::CreatedBy; + type Scope = S::Scope; type LastUpdatedBy = S::LastUpdatedBy; type Value = Set; type Did = S::Did; - type Key = S::Key; - type Scope = S::Scope; - type CreatedBy = S::CreatedBy; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type LastUpdatedBy = S::LastUpdatedBy; - type Value = S::Value; - type Did = Set; type Key = S::Key; - type Scope = S::Scope; type CreatedBy = S::CreatedBy; - } - ///State transition - sets the `key` field to Set - pub struct SetKey(PhantomData S>); - impl sealed::Sealed for SetKey {} - impl State for SetKey { - type LastUpdatedBy = S::LastUpdatedBy; - type Value = S::Value; - type Did = S::Did; - type Key = Set; type Scope = S::Scope; - type CreatedBy = S::CreatedBy; - } - ///State transition - sets the `scope` field to Set - pub struct SetScope(PhantomData S>); - impl sealed::Sealed for SetScope {} - impl State for SetScope { type LastUpdatedBy = S::LastUpdatedBy; type Value = S::Value; - type Did = S::Did; - type Key = S::Key; - type Scope = Set; - type CreatedBy = S::CreatedBy; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type LastUpdatedBy = S::LastUpdatedBy; - type Value = S::Value; - type Did = S::Did; - type Key = S::Key; - type Scope = S::Scope; - type CreatedBy = Set; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `key` field + pub struct key(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `scope` field + pub struct scope(()); ///Marker type for the `last_updated_by` field pub struct last_updated_by(()); ///Marker type for the `value` field pub struct value(()); ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `key` field - pub struct key(()); - ///Marker type for the `scope` field - pub struct scope(()); - ///Marker type for the `created_by` field - pub struct created_by(()); } } @@ -397,12 +397,12 @@ where impl<'a, S> DefsOptionBuilder<'a, S> where S: defs_option_state::State, + S::Key: defs_option_state::IsSet, + S::CreatedBy: defs_option_state::IsSet, + S::Scope: defs_option_state::IsSet, S::LastUpdatedBy: defs_option_state::IsSet, S::Value: defs_option_state::IsSet, S::Did: defs_option_state::IsSet, - S::Key: defs_option_state::IsSet, - S::Scope: defs_option_state::IsSet, - S::CreatedBy: defs_option_state::IsSet, { /// Build the final struct pub fn build(self) -> DefsOption<'a> { diff --git a/crates/weaver-api/src/tools_ozone/setting/remove_options.rs b/crates/weaver-api/src/tools_ozone/setting/remove_options.rs index 9c7ffe8..70b0fdf 100644 --- a/crates/weaver-api/src/tools_ozone/setting/remove_options.rs +++ b/crates/weaver-api/src/tools_ozone/setting/remove_options.rs @@ -33,37 +33,37 @@ pub mod remove_options_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Scope; type Keys; + type Scope; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Scope = Unset; type Keys = Unset; - } - ///State transition - sets the `scope` field to Set - pub struct SetScope(PhantomData S>); - impl sealed::Sealed for SetScope {} - impl State for SetScope { - type Scope = Set; - type Keys = S::Keys; + type Scope = Unset; } ///State transition - sets the `keys` field to Set pub struct SetKeys(PhantomData S>); impl sealed::Sealed for SetKeys {} impl State for SetKeys { - type Scope = S::Scope; type Keys = Set; + type Scope = S::Scope; + } + ///State transition - sets the `scope` field to Set + pub struct SetScope(PhantomData S>); + impl sealed::Sealed for SetScope {} + impl State for SetScope { + type Keys = S::Keys; + type Scope = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `scope` field - pub struct scope(()); ///Marker type for the `keys` field pub struct keys(()); + ///Marker type for the `scope` field + pub struct scope(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> RemoveOptionsBuilder<'a, S> where S: remove_options_state::State, - S::Scope: remove_options_state::IsSet, S::Keys: remove_options_state::IsSet, + S::Scope: remove_options_state::IsSet, { /// Build the final struct pub fn build(self) -> RemoveOptions<'a> { diff --git a/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs b/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs index 5651b97..131b34c 100644 --- a/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs +++ b/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs @@ -41,49 +41,49 @@ pub mod upsert_option_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Scope; type Key; + type Scope; type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Scope = Unset; type Key = Unset; + type Scope = Unset; type Value = Unset; } - ///State transition - sets the `scope` field to Set - pub struct SetScope(PhantomData S>); - impl sealed::Sealed for SetScope {} - impl State for SetScope { - type Scope = Set; - type Key = S::Key; - type Value = S::Value; - } ///State transition - sets the `key` field to Set pub struct SetKey(PhantomData S>); impl sealed::Sealed for SetKey {} impl State for SetKey { - type Scope = S::Scope; type Key = Set; + type Scope = S::Scope; + type Value = S::Value; + } + ///State transition - sets the `scope` field to Set + pub struct SetScope(PhantomData S>); + impl sealed::Sealed for SetScope {} + impl State for SetScope { + type Key = S::Key; + type Scope = Set; type Value = S::Value; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Scope = S::Scope; type Key = S::Key; + type Scope = S::Scope; type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `scope` field - pub struct scope(()); ///Marker type for the `key` field pub struct key(()); + ///Marker type for the `scope` field + pub struct scope(()); ///Marker type for the `value` field pub struct value(()); } @@ -218,8 +218,8 @@ where impl<'a, S> UpsertOptionBuilder<'a, S> where S: upsert_option_state::State, - S::Scope: upsert_option_state::IsSet, S::Key: upsert_option_state::IsSet, + S::Scope: upsert_option_state::IsSet, S::Value: upsert_option_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/tools_ozone/team/add_member.rs b/crates/weaver-api/src/tools_ozone/team/add_member.rs index 0697889..13a8670 100644 --- a/crates/weaver-api/src/tools_ozone/team/add_member.rs +++ b/crates/weaver-api/src/tools_ozone/team/add_member.rs @@ -33,37 +33,37 @@ pub mod add_member_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Role; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Role = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Role = S::Role; + type Did = Unset; } ///State transition - sets the `role` field to Set pub struct SetRole(PhantomData S>); impl sealed::Sealed for SetRole {} impl State for SetRole { - type Did = S::Did; type Role = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Role = S::Role; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `role` field pub struct role(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> AddMemberBuilder<'a, S> where S: add_member_state::State, - S::Did: add_member_state::IsSet, S::Role: add_member_state::IsSet, + S::Did: add_member_state::IsSet, { /// Build the final struct pub fn build(self) -> AddMember<'a> { diff --git a/crates/weaver-api/src/tools_ozone/verification.rs b/crates/weaver-api/src/tools_ozone/verification.rs index 702b0d2..2d24fb1 100644 --- a/crates/weaver-api/src/tools_ozone/verification.rs +++ b/crates/weaver-api/src/tools_ozone/verification.rs @@ -74,105 +74,105 @@ pub mod verification_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Issuer; type Handle; - type DisplayName; - type Subject; type Uri; + type Subject; + type DisplayName; type CreatedAt; + type Issuer; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Issuer = Unset; type Handle = Unset; - type DisplayName = Unset; - type Subject = Unset; type Uri = Unset; + type Subject = Unset; + type DisplayName = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `issuer` field to Set - pub struct SetIssuer(PhantomData S>); - impl sealed::Sealed for SetIssuer {} - impl State for SetIssuer { - type Issuer = Set; - type Handle = S::Handle; - type DisplayName = S::DisplayName; - type Subject = S::Subject; - type Uri = S::Uri; - type CreatedAt = S::CreatedAt; + type Issuer = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Issuer = S::Issuer; type Handle = Set; - type DisplayName = S::DisplayName; - type Subject = S::Subject; type Uri = S::Uri; + type Subject = S::Subject; + type DisplayName = S::DisplayName; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `display_name` field to Set - pub struct SetDisplayName(PhantomData S>); - impl sealed::Sealed for SetDisplayName {} - impl State for SetDisplayName { type Issuer = S::Issuer; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type Handle = S::Handle; - type DisplayName = Set; + type Uri = Set; type Subject = S::Subject; - type Uri = S::Uri; + type DisplayName = S::DisplayName; type CreatedAt = S::CreatedAt; + type Issuer = S::Issuer; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Issuer = S::Issuer; type Handle = S::Handle; - type DisplayName = S::DisplayName; - type Subject = Set; type Uri = S::Uri; + type Subject = Set; + type DisplayName = S::DisplayName; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { type Issuer = S::Issuer; + } + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData S>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { type Handle = S::Handle; - type DisplayName = S::DisplayName; + type Uri = S::Uri; type Subject = S::Subject; - type Uri = Set; + type DisplayName = Set; type CreatedAt = S::CreatedAt; + type Issuer = S::Issuer; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Issuer = S::Issuer; type Handle = S::Handle; - type DisplayName = S::DisplayName; - type Subject = S::Subject; type Uri = S::Uri; + type Subject = S::Subject; + type DisplayName = S::DisplayName; type CreatedAt = Set; + type Issuer = S::Issuer; + } + ///State transition - sets the `issuer` field to Set + pub struct SetIssuer(PhantomData S>); + impl sealed::Sealed for SetIssuer {} + impl State for SetIssuer { + type Handle = S::Handle; + type Uri = S::Uri; + type Subject = S::Subject; + type DisplayName = S::DisplayName; + type CreatedAt = S::CreatedAt; + type Issuer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `issuer` field - pub struct issuer(()); ///Marker type for the `handle` field pub struct handle(()); - ///Marker type for the `display_name` field - pub struct display_name(()); - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `display_name` field + pub struct display_name(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `issuer` field + pub struct issuer(()); } } @@ -479,12 +479,12 @@ where impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, - S::Issuer: verification_view_state::IsSet, S::Handle: verification_view_state::IsSet, - S::DisplayName: verification_view_state::IsSet, - S::Subject: verification_view_state::IsSet, S::Uri: verification_view_state::IsSet, + S::Subject: verification_view_state::IsSet, + S::DisplayName: verification_view_state::IsSet, S::CreatedAt: verification_view_state::IsSet, + S::Issuer: verification_view_state::IsSet, { /// Build the final struct pub fn build(self) -> VerificationView<'a> { diff --git a/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs b/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs index 97cfcb1..ceff4a4 100644 --- a/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs +++ b/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs @@ -640,51 +640,51 @@ pub mod verification_input_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Handle; type DisplayName; type Subject; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Handle = Unset; type DisplayName = Unset; type Subject = Unset; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type Handle = Set; - type DisplayName = S::DisplayName; - type Subject = S::Subject; + type Handle = Unset; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Handle = S::Handle; type DisplayName = Set; type Subject = S::Subject; + type Handle = S::Handle; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Handle = S::Handle; type DisplayName = S::DisplayName; type Subject = Set; + type Handle = S::Handle; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type DisplayName = S::DisplayName; + type Subject = S::Subject; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `display_name` field pub struct display_name(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -797,9 +797,9 @@ where impl<'a, S> VerificationInputBuilder<'a, S> where S: verification_input_state::State, - S::Handle: verification_input_state::IsSet, S::DisplayName: verification_input_state::IsSet, S::Subject: verification_input_state::IsSet, + S::Handle: verification_input_state::IsSet, { /// Build the final struct pub fn build(self) -> VerificationInput<'a> { diff --git a/crates/weaver-app/src/components/editor/collab.rs b/crates/weaver-app/src/components/editor/collab.rs index 9c124d4..efb6406 100644 --- a/crates/weaver-app/src/components/editor/collab.rs +++ b/crates/weaver-app/src/components/editor/collab.rs @@ -271,6 +271,34 @@ pub fn CollabCoordinator(props: CollabCoordinatorProps) -> Element { }); // Discover existing peers + #[cfg(feature = "use-index")] + let bootstrap_peers = match fetcher + .get_resource_sessions(&uri) + .await + { + Ok(output) => { + tracing::info!( + count = output.sessions.len(), + "CollabCoordinator: found peers via index" + ); + debug_state.with_mut(|ds| { + ds.discovered_peers = output.sessions.len(); + }); + output + .sessions + .into_iter() + .map(|s| s.node_id.as_ref().into()) + .collect::>() + } + Err(e) => { + tracing::warn!( + "CollabCoordinator: peer discovery failed: {e}" + ); + vec![] + } + }; + + #[cfg(not(feature = "use-index"))] let bootstrap_peers = match fetcher .find_session_peers(&uri) .await @@ -469,6 +497,32 @@ pub fn CollabCoordinator(props: CollabCoordinatorProps) -> Element { Err(_) => return, }; + #[cfg(feature = "use-index")] + match fetcher.get_resource_sessions(&uri).await { + Ok(output) => { + debug_state.with_mut(|ds| ds.discovered_peers = output.sessions.len()); + if !output.sessions.is_empty() { + let peer_ids: Vec = output + .sessions + .into_iter() + .map(|s| s.node_id.as_ref().into()) + .collect(); + + if let Some(ref mut s) = *worker_sink.write() { + if let Err(e) = + s.send(WorkerInput::AddPeers { peers: peer_ids }).await + { + tracing::warn!("Periodic AddPeers send failed: {e}"); + } + } + } + } + Err(e) => { + tracing::debug!("Peer discovery failed: {e}"); + } + } + + #[cfg(not(feature = "use-index"))] match fetcher.find_session_peers(&uri).await { Ok(peers) => { debug_state.with_mut(|ds| ds.discovered_peers = peers.len()); diff --git a/crates/weaver-app/src/components/editor/sync.rs b/crates/weaver-app/src/components/editor/sync.rs index 1b1dd15..0515eea 100644 --- a/crates/weaver-app/src/components/editor/sync.rs +++ b/crates/weaver-app/src/components/editor/sync.rs @@ -256,11 +256,53 @@ pub enum SyncResult { NoChanges, } +/// Find ALL edit.root records across collaborators for an entry. +/// +/// With use-index: Uses weaver-index getEditHistory endpoint. +/// Without use-index: Queries Constellation for backlinks. +#[cfg(feature = "use-index")] +pub async fn find_all_edit_roots_for_entry( + fetcher: &Fetcher, + entry_uri: &AtUri<'_>, +) -> Result>, WeaverError> { + let output = fetcher + .get_edit_history(entry_uri) + .await + .map_err(|e| WeaverError::InvalidNotebook(format!("Failed to get edit history: {}", e)))?; + + // Convert EditHistoryEntry roots to RecordId format + let roots: Vec> = output + .roots + .into_iter() + .filter_map(|entry| { + let uri = AtUri::new(entry.uri.as_ref()).ok()?; + let did = match uri.authority() { + AtIdentifier::Did(d) => d.clone().into_static(), + _ => return None, + }; + let rkey = uri.rkey()?.clone().into_static(); + Some(RecordId { + did, + collection: Nsid::raw(ROOT_NSID).into_static(), + rkey, + }) + }) + .collect(); + + tracing::debug!( + "find_all_edit_roots_for_entry (index): found {} roots", + roots.len() + ); + + Ok(roots) +} + /// Find ALL edit.root records across collaborators for an entry. /// /// 1. Gets list of collaborators via permissions /// 2. Queries Constellation for edit.root in each collaborator's repo /// 3. Returns all found roots for CRDT merge +#[cfg(not(feature = "use-index"))] pub async fn find_all_edit_roots_for_entry( fetcher: &Fetcher, entry_uri: &AtUri<'_>, @@ -442,9 +484,50 @@ pub struct RemoteDraft { pub created_at: String, } +/// List all drafts for the current user. +/// +/// With use-index: Uses weaver-index listDrafts endpoint. +/// Without use-index: Uses direct PDS ListRecords query. +#[cfg(feature = "use-index")] +pub async fn list_drafts_from_pds(fetcher: &Fetcher) -> Result, WeaverError> { + let did = fetcher + .current_did() + .await + .ok_or_else(|| WeaverError::InvalidNotebook("Not authenticated".into()))?; + + let actor = AtIdentifier::Did(did); + let output = fetcher + .list_drafts(&actor) + .await + .map_err(|e| WeaverError::InvalidNotebook(format!("Failed to list drafts: {}", e)))?; + + tracing::debug!( + "list_drafts_from_pds (index): found {} drafts", + output.drafts.len() + ); + + let drafts = output + .drafts + .into_iter() + .filter_map(|draft| { + let uri = AtUri::new(draft.uri.as_ref()).ok()?.into_static(); + let rkey = uri.rkey()?.0.as_str().to_string(); + let created_at = draft.created_at.to_string(); + Some(RemoteDraft { + uri, + rkey, + created_at, + }) + }) + .collect(); + + Ok(drafts) +} + /// List all drafts from PDS for the current user. /// /// Returns a list of draft records from `sh.weaver.edit.draft` collection. +#[cfg(not(feature = "use-index"))] pub async fn list_drafts_from_pds(fetcher: &Fetcher) -> Result, WeaverError> { use weaver_api::com_atproto::repo::list_records::ListRecords; diff --git a/crates/weaver-app/src/fetch.rs b/crates/weaver-app/src/fetch.rs index d650b82..9893da8 100644 --- a/crates/weaver-app/src/fetch.rs +++ b/crates/weaver-app/src/fetch.rs @@ -26,6 +26,7 @@ use jacquard::xrpc::XrpcResponse; use jacquard::xrpc::*; use jacquard::{ smol_str::{SmolStr, format_smolstr}, + types::aturi::AtUri, types::ident::AtIdentifier, }; use serde::{Deserialize, Serialize}; @@ -381,6 +382,18 @@ pub struct Fetcher { impl Fetcher { pub fn new(client: OAuthClient) -> Self { + // Set indexer URL for unauthenticated requests + #[cfg(feature = "use-index")] + if !crate::env::WEAVER_INDEXER_URL.is_empty() { + if let Ok(url) = jacquard::url::Url::parse(crate::env::WEAVER_INDEXER_URL) { + if let Ok(mut guard) = client.endpoint.try_write() { + use jacquard::cowstr::ToCowStr; + + *guard = Some(url.to_cowstr().into_static()); + } + } + } + Self { client: Arc::new(Client::new(client)), #[cfg(feature = "server")] @@ -1465,6 +1478,131 @@ impl LexiconSchemaResolver for Fetcher { } } +// ============================================================================ +// Collaboration & Edit methods (use-index gated) +// ============================================================================ + +impl Fetcher { + /// Get edit history for a resource from weaver-index. + /// + /// Returns edit roots and diffs for the given resource URI. + #[cfg(feature = "use-index")] + pub async fn get_edit_history( + &self, + resource_uri: &AtUri<'_>, + ) -> Result> { + use weaver_api::sh_weaver::edit::get_edit_history::GetEditHistory; + + let client = self.get_client(); + let resp = client + .send(GetEditHistory::new().resource(resource_uri.clone()).build()) + .await + .map_err(|e| dioxus::CapturedError::from_display(e))?; + + resp.into_output() + .map(|o| o.into_static()) + .map_err(|e| dioxus::CapturedError::from_display(e)) + } + + /// List drafts for an actor from weaver-index. + #[cfg(feature = "use-index")] + pub async fn list_drafts( + &self, + actor: &AtIdentifier<'_>, + ) -> Result> { + use weaver_api::sh_weaver::edit::list_drafts::ListDrafts; + + let client = self.get_client(); + let resp = client + .send(ListDrafts::new().actor(actor.clone()).build()) + .await + .map_err(|e| dioxus::CapturedError::from_display(e))?; + + resp.into_output() + .map(|o| o.into_static()) + .map_err(|e| dioxus::CapturedError::from_display(e)) + } + + /// Get resource sessions from weaver-index. + /// + /// Returns active collaboration sessions for the given resource. + #[cfg(feature = "use-index")] + pub async fn get_resource_sessions( + &self, + resource_uri: &AtUri<'_>, + ) -> Result< + weaver_api::sh_weaver::collab::get_resource_sessions::GetResourceSessionsOutput<'static>, + > { + use weaver_api::sh_weaver::collab::get_resource_sessions::GetResourceSessions; + + let client = self.get_client(); + let resp = client + .send( + GetResourceSessions::new() + .resource(resource_uri.clone()) + .build(), + ) + .await + .map_err(|e| dioxus::CapturedError::from_display(e))?; + + resp.into_output() + .map(|o| o.into_static()) + .map_err(|e| dioxus::CapturedError::from_display(e)) + } + + /// Get resource participants from weaver-index. + /// + /// Returns owner and collaborators who can edit the resource. + #[cfg(feature = "use-index")] + pub async fn get_resource_participants( + &self, + resource_uri: &AtUri<'_>, + ) -> Result< + weaver_api::sh_weaver::collab::get_resource_participants::GetResourceParticipantsOutput< + 'static, + >, + > { + use weaver_api::sh_weaver::collab::get_resource_participants::GetResourceParticipants; + + let client = self.get_client(); + let resp = client + .send( + GetResourceParticipants::new() + .resource(resource_uri.clone()) + .build(), + ) + .await + .map_err(|e| dioxus::CapturedError::from_display(e))?; + + resp.into_output() + .map(|o| o.into_static()) + .map_err(|e| dioxus::CapturedError::from_display(e)) + } + + /// Get contributors for a resource from weaver-index. + #[cfg(feature = "use-index")] + pub async fn get_contributors( + &self, + resource_uri: &AtUri<'_>, + ) -> Result> { + use weaver_api::sh_weaver::edit::get_contributors::GetContributors; + + let client = self.get_client(); + let resp = client + .send( + GetContributors::new() + .resource(resource_uri.clone()) + .build(), + ) + .await + .map_err(|e| dioxus::CapturedError::from_display(e))?; + + resp.into_output() + .map(|o| o.into_static()) + .map_err(|e| dioxus::CapturedError::from_display(e)) + } +} + impl AgentSession for Fetcher { #[doc = " Identify the kind of session."] fn session_kind(&self) -> AgentKind { diff --git a/crates/weaver-app/src/main.rs b/crates/weaver-app/src/main.rs index d8ce0cb..5f04798 100644 --- a/crates/weaver-app/src/main.rs +++ b/crates/weaver-app/src/main.rs @@ -61,16 +61,16 @@ fn main() { // Run `serve()` on the server only #[cfg(feature = "server")] dioxus::serve(|| async move { - use weaver_app::blobcache::BlobCache; - use weaver_app::auth::AuthStore; - use jacquard::oauth::{client::OAuthClient, session::ClientData}; use axum::{ extract::{Extension, Request}, middleware, middleware::Next, routing::get, }; + use jacquard::oauth::{client::OAuthClient, session::ClientData}; use std::convert::Infallible; + use weaver_app::auth::AuthStore; + use weaver_app::blobcache::BlobCache; #[cfg(not(feature = "fullstack-server"))] let router = { axum::Router::new().merge(dioxus::server::router(App)) }; @@ -81,13 +81,11 @@ fn main() { AuthStore::new(), ClientData::new_public(CONFIG.oauth.clone()), ))); + let blob_cache = Arc::new(BlobCache::new(fetcher.clone())); axum::Router::new() .route("/favicon.ico", get(weaver_app::favicon)) - .serve_dioxus_application( - ServeConfig::builder(), - App, - ) + .serve_dioxus_application(ServeConfig::builder(), App) .layer(middleware::from_fn({ let blob_cache = blob_cache.clone(); let fetcher = fetcher.clone(); diff --git a/crates/weaver-index/migrations/clickhouse/037_contributors.sql b/crates/weaver-index/migrations/clickhouse/037_contributors.sql index a1f79cd..098dfe0 100644 --- a/crates/weaver-index/migrations/clickhouse/037_contributors.sql +++ b/crates/weaver-index/migrations/clickhouse/037_contributors.sql @@ -7,39 +7,6 @@ REFRESH EVERY 1 MINUTE ENGINE = ReplacingMergeTree(indexed_at) ORDER BY (resource_did, resource_collection, resource_rkey, contributor_did) AS --- Owners: resource creator is always a contributor -SELECT - did as resource_did, - 'sh.weaver.notebook.entry' as resource_collection, - rkey as resource_rkey, - - did as contributor_did, - 'owner' as contribution_type, - - concat('at://', did, '/sh.weaver.notebook.entry/', rkey) as source_uri, - created_at as contributed_at, - now64(3) as indexed_at -FROM entries -WHERE deleted_at = toDateTime64(0, 3) - -UNION ALL - -SELECT - did as resource_did, - 'sh.weaver.notebook.book' as resource_collection, - rkey as resource_rkey, - - did as contributor_did, - 'owner' as contribution_type, - - concat('at://', did, '/sh.weaver.notebook.book/', rkey) as source_uri, - created_at as contributed_at, - now64(3) as indexed_at -FROM notebooks -WHERE deleted_at = toDateTime64(0, 3) - -UNION ALL - -- Editors: anyone with edit nodes for the resource SELECT resource_did, @@ -75,26 +42,5 @@ FROM entries e INNER JOIN permissions p ON e.did = p.grantee_did AND e.rkey = p.resource_rkey AND p.resource_collection = 'sh.weaver.notebook.entry' - AND p.scope = 'collaborator' + AND (p.scope = 'collaborator' OR p.scope = 'owner') WHERE e.deleted_at = toDateTime64(0, 3) - -UNION ALL - --- Notebook collaborators -SELECT - p.resource_did, - p.resource_collection, - p.resource_rkey, - - n.did as contributor_did, - 'collaborator' as contribution_type, - - n.uri as source_uri, - n.created_at as contributed_at, - now64(3) as indexed_at -FROM notebooks n -INNER JOIN permissions p ON n.did = p.grantee_did - AND n.rkey = p.resource_rkey - AND p.resource_collection = 'sh.weaver.notebook.book' - AND p.scope = 'collaborator' -WHERE n.deleted_at = toDateTime64(0, 3) diff --git a/crates/weaver-index/src/clickhouse/client.rs b/crates/weaver-index/src/clickhouse/client.rs index 4bd97d3..f736be3 100644 --- a/crates/weaver-index/src/clickhouse/client.rs +++ b/crates/weaver-index/src/clickhouse/client.rs @@ -23,6 +23,8 @@ impl Client { .with_option("allow_experimental_json_type", "1") .with_option("input_format_binary_read_json_as_string", "1") .with_option("output_format_binary_write_json_as_string", "1") + // Output datetimes in ISO 8601 format (ATProto standard) + .with_option("date_time_output_format", "iso") .with_option("send_timeout", "120") .with_option("receive_timeout", "120"); diff --git a/crates/weaver-index/src/clickhouse/queries/collab.rs b/crates/weaver-index/src/clickhouse/queries/collab.rs index 4701983..0f43591 100644 --- a/crates/weaver-index/src/clickhouse/queries/collab.rs +++ b/crates/weaver-index/src/clickhouse/queries/collab.rs @@ -90,4 +90,60 @@ impl Client { Ok(row.cnt > 0) } + + /// Get active collaboration sessions for a resource. + /// + /// Sessions are stored as records with collection `sh.weaver.collab.session`. + /// They have a TTL (expiresAt) and should be filtered to only return unexpired sessions. + pub async fn get_resource_sessions( + &self, + resource_uri: &str, + ) -> Result, IndexError> { + let query = r#" + SELECT + did, + rkey, + cid, + record.nodeId AS node_id, + record.relayUrl AS relay_url, + record.createdAt AS created_at, + record.expiresAt AS expires_at + FROM raw_records FINAL + WHERE collection = 'sh.weaver.collab.session' + AND is_live = 1 + AND record.resource.uri = ? + AND ( + record.expiresAt IS NULL + OR record.expiresAt > now64(3) + ) + ORDER BY created_at DESC + "#; + + let rows = self + .inner() + .query(query) + .bind(resource_uri) + .fetch_all::() + .await + .map_err(|e| ClickHouseError::Query { + message: "failed to get resource sessions".into(), + source: e, + })?; + + Ok(rows) + } +} + +/// Session record row +#[derive(Debug, Clone, Row, Deserialize)] +pub struct SessionRow { + pub did: SmolStr, + pub rkey: SmolStr, + pub cid: SmolStr, + pub node_id: SmolStr, + pub relay_url: SmolStr, + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] + pub created_at: chrono::DateTime, + #[serde(with = "clickhouse::serde::chrono::datetime64::millis::option")] + pub expires_at: Option>, } diff --git a/crates/weaver-index/src/clickhouse/queries/contributors.rs b/crates/weaver-index/src/clickhouse/queries/contributors.rs index 54719a3..75c77fd 100644 --- a/crates/weaver-index/src/clickhouse/queries/contributors.rs +++ b/crates/weaver-index/src/clickhouse/queries/contributors.rs @@ -19,6 +19,14 @@ struct ContributorRow { contributor_did: SmolStr, } +/// Row for batch contributor query (includes entry identity) +#[derive(Debug, Clone, Row, Deserialize)] +struct BatchContributorRow { + entry_did: SmolStr, + entry_rkey: SmolStr, + contributor_did: SmolStr, +} + /// Row for notebook lookup #[derive(Debug, Clone, Row, Deserialize)] struct NotebookRefRow { @@ -91,39 +99,20 @@ impl Client { Ok(rows.into_iter().map(|r| r.contributor_did).collect()) } - /// Get contributors for an entry, including cascaded notebook-level collaborators. + /// Get contributors for an entry. /// - /// Returns DIDs of users who have contributed to this entry OR are - /// notebook-level collaborators for a notebook containing this entry. + /// Returns DIDs of users who have contributed to this entry. pub async fn get_entry_contributors( &self, entry_did: &str, entry_rkey: &str, ) -> Result, IndexError> { - // Single query that unions: - // 1. Direct entry contributors - // 2. Notebook collaborators for notebooks containing this entry let query = r#" - SELECT DISTINCT contributor_did FROM ( - -- Direct entry contributors - SELECT contributor_did - FROM contributors FINAL - WHERE resource_did = ? - AND resource_rkey = ? - AND resource_collection = 'sh.weaver.notebook.entry' - - UNION ALL - - -- Notebook-level collaborators (cascaded) - SELECT c.contributor_did - FROM notebook_entries ne FINAL - INNER JOIN contributors c FINAL ON - c.resource_did = ne.notebook_did - AND c.resource_rkey = ne.notebook_rkey - AND c.resource_collection = 'sh.weaver.notebook.book' - WHERE ne.entry_did = ? - AND ne.entry_rkey = ? - ) + SELECT DISTINCT contributor_did + FROM contributors FINAL + WHERE resource_did = ? + AND resource_rkey = ? + AND resource_collection = 'sh.weaver.notebook.entry' "#; let rows = self @@ -131,8 +120,6 @@ impl Client { .query(query) .bind(entry_did) .bind(entry_rkey) - .bind(entry_did) - .bind(entry_rkey) .fetch_all::() .await .map_err(|e| ClickHouseError::Query { @@ -143,6 +130,63 @@ impl Client { Ok(rows.into_iter().map(|r| r.contributor_did).collect()) } + /// Batch get contributors for multiple entries. + /// + /// Returns a map of (did, rkey) -> Vec. + pub async fn get_entry_contributors_batch( + &self, + entries: &[(&str, &str)], // Vec of (did, rkey) + ) -> Result>, IndexError> { + use std::collections::HashMap; + + if entries.is_empty() { + return Ok(HashMap::new()); + } + + // Build (did, rkey) tuples for the IN clause + let tuples: String = entries + .iter() + .map(|(did, rkey)| format!("('{}', '{}')", did, rkey)) + .collect::>() + .join(", "); + + let query = format!( + r#" + SELECT resource_did AS entry_did, resource_rkey AS entry_rkey, contributor_did + FROM contributors FINAL + WHERE (resource_did, resource_rkey) IN ({tuples}) + AND resource_collection = 'sh.weaver.notebook.entry' + "# + ); + + let rows = self + .inner() + .query(&query) + .fetch_all::() + .await + .map_err(|e| ClickHouseError::Query { + message: "failed to batch get entry contributors".into(), + source: e, + })?; + + // Group by (entry_did, entry_rkey) + let mut result: HashMap<(SmolStr, SmolStr), Vec> = HashMap::new(); + for row in rows { + result + .entry((row.entry_did, row.entry_rkey)) + .or_default() + .push(row.contributor_did); + } + + // Dedupe each entry's contributors + for contributors in result.values_mut() { + contributors.sort(); + contributors.dedup(); + } + + Ok(result) + } + /// Get contributors for a notebook. /// /// Returns DIDs of users who have contributed to this notebook. diff --git a/crates/weaver-index/src/clickhouse/queries/edit.rs b/crates/weaver-index/src/clickhouse/queries/edit.rs index 80820e1..95bc3d7 100644 --- a/crates/weaver-index/src/clickhouse/queries/edit.rs +++ b/crates/weaver-index/src/clickhouse/queries/edit.rs @@ -27,33 +27,34 @@ pub struct EditNodeRow { pub created_at: chrono::DateTime, } +/// Draft with associated edit root info +#[derive(Debug, Clone, Row, Deserialize)] +pub struct DraftWithRootRow { + pub did: SmolStr, + pub rkey: SmolStr, + pub cid: SmolStr, + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] + pub created_at: chrono::DateTime, + pub root_did: SmolStr, + pub root_rkey: SmolStr, + pub root_cid: SmolStr, + #[serde(with = "clickhouse::serde::chrono::datetime64::millis::option")] + pub last_edit_at: Option>, +} + impl Client { /// Get edit history for a resource. /// /// Returns roots and diffs separately, ordered by created_at. - /// The resource_uri should be an at:// URI for an entry or notebook. pub async fn get_edit_history( &self, - resource_uri: &str, + resource_did: &str, + resource_collection: &str, + resource_rkey: &str, cursor: Option, after_rkey: Option<&str>, limit: i64, ) -> Result, IndexError> { - // Parse resource URI to extract did/collection/rkey - let parts: Vec<&str> = resource_uri - .strip_prefix("at://") - .unwrap_or(resource_uri) - .split('/') - .collect(); - - if parts.len() < 3 { - return Ok(Vec::new()); - } - - let resource_did = parts[0]; - let resource_collection = parts[1]; - let resource_rkey = parts[2]; - let query = r#" SELECT did, @@ -104,4 +105,65 @@ impl Client { Ok(rows) } + + /// List drafts for an actor. + /// + /// Returns draft records with associated edit root info if available. + pub async fn list_drafts( + &self, + actor_did: &str, + cursor: Option, + limit: i64, + ) -> Result, IndexError> { + // Query drafts table with LEFT JOIN to get associated edit roots + // Edit roots reference drafts via resource_type/did/rkey fields + let query = r#" + SELECT + d.did, + d.rkey, + d.cid, + d.created_at, + COALESCE(e.did, '') AS root_did, + COALESCE(e.rkey, '') AS root_rkey, + COALESCE(e.cid, '') AS root_cid, + e.created_at AS last_edit_at + FROM drafts d FINAL + LEFT JOIN ( + SELECT + did, + rkey, + cid, + created_at, + resource_did, + resource_rkey + FROM edit_nodes FINAL + WHERE node_type = 'root' + AND resource_type = 'draft' + AND deleted_at = toDateTime64(0, 3) + ) e ON e.resource_did = d.did AND e.resource_rkey = d.rkey + WHERE d.did = ? + AND d.deleted_at = toDateTime64(0, 3) + AND (? = 0 OR toUnixTimestamp64Milli(d.created_at) < ?) + ORDER BY d.created_at DESC + LIMIT ? + "#; + + let cursor_val = cursor.unwrap_or(0); + + let rows = self + .inner() + .query(query) + .bind(actor_did) + .bind(cursor_val) + .bind(cursor_val) + .bind(limit) + .fetch_all::() + .await + .map_err(|e| ClickHouseError::Query { + message: "failed to list drafts".into(), + source: e, + })?; + + Ok(rows) + } } diff --git a/crates/weaver-index/src/clickhouse/queries/notebooks.rs b/crates/weaver-index/src/clickhouse/queries/notebooks.rs index 31a3549..4cdac9d 100644 --- a/crates/weaver-index/src/clickhouse/queries/notebooks.rs +++ b/crates/weaver-index/src/clickhouse/queries/notebooks.rs @@ -65,7 +65,7 @@ impl Client { created_at, indexed_at, record - FROM notebooks + FROM notebooks FINAL WHERE did = ? AND (path = ? OR title = ?) AND deleted_at = toDateTime64(0, 3) @@ -110,7 +110,7 @@ impl Client { created_at, indexed_at, record - FROM notebooks + FROM notebooks FINAL WHERE did = ? AND rkey = ? AND deleted_at = toDateTime64(0, 3) @@ -147,42 +147,30 @@ impl Client { // Note: rkey ordering is intentional here - it's the notebook's entry order let query = if cursor.is_some() { r#" - SELECT - did, - rkey, - cid, - uri, - title, - path, - tags, - author_dids, - created_at, - indexed_at, - record - FROM entries - WHERE did = ? - AND deleted_at = toDateTime64(0, 3) - AND rkey > ? + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, indexed_at, record + FROM ( + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, updated_at, indexed_at, record, + ROW_NUMBER() OVER (PARTITION BY rkey ORDER BY updated_at DESC) as rn + FROM entries FINAL + WHERE did = ? + AND deleted_at = toDateTime64(0, 3) + AND rkey > ? + ) + WHERE rn = 1 ORDER BY rkey ASC LIMIT ? "# } else { r#" - SELECT - did, - rkey, - cid, - uri, - title, - path, - tags, - author_dids, - created_at, - indexed_at, - record - FROM entries - WHERE did = ? - AND deleted_at = toDateTime64(0, 3) + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, indexed_at, record + FROM ( + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, updated_at, indexed_at, record, + ROW_NUMBER() OVER (PARTITION BY rkey ORDER BY updated_at DESC) as rn + FROM entries FINAL + WHERE did = ? + AND deleted_at = toDateTime64(0, 3) + ) + WHERE rn = 1 ORDER BY rkey ASC LIMIT ? "# @@ -237,11 +225,11 @@ impl Client { created_at, indexed_at, record - FROM entries + FROM entries FINAL WHERE rkey = ? AND did IN ({}) AND deleted_at = toDateTime64(0, 3) - ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC + ORDER BY updated_at DESC LIMIT 1 "#, placeholders.join(", ") @@ -284,11 +272,11 @@ impl Client { created_at, indexed_at, record - FROM entries + FROM entries FINAL WHERE did = ? AND rkey = ? AND deleted_at = toDateTime64(0, 3) - ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC + ORDER BY updated_at DESC LIMIT 1 "#; @@ -326,11 +314,11 @@ impl Client { created_at, indexed_at, record - FROM entries + FROM entries FINAL WHERE did = ? AND (path = ? OR title = ?) AND deleted_at = toDateTime64(0, 3) - ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC + ORDER BY updated_at DESC LIMIT 1 "#; @@ -374,7 +362,7 @@ impl Client { created_at, indexed_at, record - FROM notebooks + FROM notebooks FINAL WHERE did = ? AND deleted_at = toDateTime64(0, 3) AND created_at < fromUnixTimestamp64Milli(?) @@ -395,7 +383,7 @@ impl Client { created_at, indexed_at, record - FROM notebooks + FROM notebooks FINAL WHERE did = ? AND deleted_at = toDateTime64(0, 3) ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC @@ -433,43 +421,31 @@ impl Client { ) -> Result, IndexError> { let query = if cursor.is_some() { r#" - SELECT - did, - rkey, - cid, - uri, - title, - path, - tags, - author_dids, - created_at, - indexed_at, - record - FROM entries - WHERE did = ? - AND deleted_at = toDateTime64(0, 3) - AND created_at < fromUnixTimestamp64Milli(?) - ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, indexed_at, record + FROM ( + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, updated_at, indexed_at, record, + ROW_NUMBER() OVER (PARTITION BY rkey ORDER BY updated_at DESC) as rn + FROM entries FINAL + WHERE did = ? + AND deleted_at = toDateTime64(0, 3) + AND created_at < fromUnixTimestamp64Milli(?) + ) + WHERE rn = 1 + ORDER BY created_at DESC LIMIT ? "# } else { r#" - SELECT - did, - rkey, - cid, - uri, - title, - path, - tags, - author_dids, - created_at, - indexed_at, - record - FROM entries - WHERE did = ? - AND deleted_at = toDateTime64(0, 3) - ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, indexed_at, record + FROM ( + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, updated_at, indexed_at, record, + ROW_NUMBER() OVER (PARTITION BY rkey ORDER BY updated_at DESC) as rn + FROM entries FINAL + WHERE did = ? + AND deleted_at = toDateTime64(0, 3) + ) + WHERE rn = 1 + ORDER BY created_at DESC LIMIT ? "# }; @@ -519,7 +495,7 @@ impl Client { created_at, indexed_at, record - FROM notebooks + FROM notebooks FINAL WHERE deleted_at = toDateTime64(0, 3) AND hasAny(tags, ?) AND created_at < fromUnixTimestamp64Milli(?) @@ -540,7 +516,7 @@ impl Client { created_at, indexed_at, record - FROM notebooks + FROM notebooks FINAL WHERE deleted_at = toDateTime64(0, 3) AND hasAny(tags, ?) ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC @@ -560,7 +536,7 @@ impl Client { created_at, indexed_at, record - FROM notebooks + FROM notebooks FINAL WHERE deleted_at = toDateTime64(0, 3) AND created_at < fromUnixTimestamp64Milli(?) ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC @@ -580,7 +556,7 @@ impl Client { created_at, indexed_at, record - FROM notebooks + FROM notebooks FINAL WHERE deleted_at = toDateTime64(0, 3) ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC LIMIT ? @@ -623,82 +599,58 @@ impl Client { ) -> Result, IndexError> { let base_query = if tags.is_some() && cursor.is_some() { r#" - SELECT - did, - rkey, - cid, - uri, - title, - path, - tags, - author_dids, - created_at, - indexed_at, - record - FROM entries - WHERE deleted_at = toDateTime64(0, 3) - AND hasAny(tags, ?) - AND created_at < fromUnixTimestamp64Milli(?) - ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, indexed_at, record + FROM ( + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, updated_at, indexed_at, record, + ROW_NUMBER() OVER (PARTITION BY rkey ORDER BY updated_at DESC) as rn + FROM entries FINAL + WHERE deleted_at = toDateTime64(0, 3) + AND hasAny(tags, ?) + AND created_at < fromUnixTimestamp64Milli(?) + ) + WHERE rn = 1 + ORDER BY created_at DESC LIMIT ? "# } else if tags.is_some() { r#" - SELECT - did, - rkey, - cid, - uri, - title, - path, - tags, - author_dids, - created_at, - indexed_at, - record - FROM entries - WHERE deleted_at = toDateTime64(0, 3) - AND hasAny(tags, ?) - ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, indexed_at, record + FROM ( + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, updated_at, indexed_at, record, + ROW_NUMBER() OVER (PARTITION BY rkey ORDER BY updated_at DESC) as rn + FROM entries FINAL + WHERE deleted_at = toDateTime64(0, 3) + AND hasAny(tags, ?) + ) + WHERE rn = 1 + ORDER BY created_at DESC LIMIT ? "# } else if cursor.is_some() { r#" - SELECT - did, - rkey, - cid, - uri, - title, - path, - tags, - author_dids, - created_at, - indexed_at, - record - FROM entries - WHERE deleted_at = toDateTime64(0, 3) - AND created_at < fromUnixTimestamp64Milli(?) - ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, indexed_at, record + FROM ( + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, updated_at, indexed_at, record, + ROW_NUMBER() OVER (PARTITION BY rkey ORDER BY updated_at DESC) as rn + FROM entries FINAL + WHERE deleted_at = toDateTime64(0, 3) + AND created_at < fromUnixTimestamp64Milli(?) + ) + WHERE rn = 1 + ORDER BY created_at DESC LIMIT ? "# } else { r#" - SELECT - did, - rkey, - cid, - uri, - title, - path, - tags, - author_dids, - created_at, - indexed_at, - record - FROM entries - WHERE deleted_at = toDateTime64(0, 3) - ORDER BY toStartOfFiveMinutes(event_time) DESC, created_at DESC + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, indexed_at, record + FROM ( + SELECT did, rkey, cid, uri, title, path, tags, author_dids, created_at, updated_at, indexed_at, record, + ROW_NUMBER() OVER (PARTITION BY rkey ORDER BY updated_at DESC) as rn + FROM entries FINAL + WHERE deleted_at = toDateTime64(0, 3) + ) + WHERE rn = 1 + ORDER BY created_at DESC LIMIT ? "# }; diff --git a/crates/weaver-index/src/endpoints/actor.rs b/crates/weaver-index/src/endpoints/actor.rs index ff4de6b..4104371 100644 --- a/crates/weaver-index/src/endpoints/actor.rs +++ b/crates/weaver-index/src/endpoints/actor.rs @@ -7,7 +7,7 @@ use jacquard::IntoStatic; use jacquard::cowstr::ToCowStr; use jacquard::identity::resolver::IdentityResolver; use jacquard::types::ident::AtIdentifier; -use jacquard::types::string::{AtUri, Cid, Did, Handle}; +use jacquard::types::string::{AtUri, Cid, Did, Handle, Uri}; use jacquard_axum::ExtractXrpc; use jacquard_axum::service_auth::{ExtractOptionalServiceAuth, VerifiedServiceAuth}; use smol_str::SmolStr; @@ -78,13 +78,36 @@ pub async fn get_profile( XrpcErrorResponse::internal_error("Invalid handle stored") })?; + // Build avatar URL from CID if present + let avatar = if !profile.avatar_cid.is_empty() { + let url = format!( + "https://cdn.bsky.app/img/avatar/plain/{}/{}@jpeg", + profile.did, profile.avatar_cid + ); + Uri::new_owned(url).ok() + } else { + None + }; + + // Build banner URL from CID if present + let banner = if !profile.banner_cid.is_empty() { + let url = format!( + "https://cdn.bsky.app/img/banner/plain/{}/{}@jpeg", + profile.did, profile.banner_cid + ); + Uri::new_owned(url).ok() + } else { + None + }; + // Build ProfileView (weaver native profile) let inner_profile = ProfileView::new() .did(did.clone()) .handle(handle) .maybe_display_name(non_empty_str(&profile.display_name)) .maybe_description(non_empty_str(&profile.description)) - // TODO: avatar/banner need URL construction from CID + .maybe_avatar(avatar) + .maybe_banner(banner) .build(); let inner = ProfileDataViewInner::ProfileView(Box::new(inner_profile)); @@ -271,7 +294,7 @@ pub async fn get_actor_notebooks( GetActorNotebooksOutput { notebooks, cursor: next_cursor, - extra_data: None + extra_data: None, } .into_static(), )) @@ -308,10 +331,24 @@ pub async fn get_actor_entries( let has_more = entry_rows.len() > limit as usize; let entry_rows: Vec<_> = entry_rows.into_iter().take(limit as usize).collect(); - // Collect author DIDs for hydration + // Batch fetch contributors for all entries + let entry_keys: Vec<(&str, &str)> = entry_rows + .iter() + .map(|e| (e.did.as_str(), e.rkey.as_str())) + .collect(); + let contributors_map = state + .clickhouse + .get_entry_contributors_batch(&entry_keys) + .await + .map_err(|e| { + tracing::error!("Failed to batch fetch contributors: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + // Collect all contributor DIDs for profile hydration let mut all_author_dids: HashSet<&str> = HashSet::new(); - for entry in &entry_rows { - for did in &entry.author_dids { + for contributors in contributors_map.values() { + for did in contributors { all_author_dids.insert(did.as_str()); } } @@ -343,7 +380,14 @@ pub async fn get_actor_entries( XrpcErrorResponse::internal_error("Invalid CID stored") })?; - let authors = hydrate_authors(&entry_row.author_dids, &profile_map)?; + // Get contributors for this entry + let entry_key = (entry_row.did.clone(), entry_row.rkey.clone()); + let contributors = contributors_map + .get(&entry_key) + .map(|v| v.as_slice()) + .unwrap_or(&[]); + + let authors = hydrate_authors(contributors, &profile_map)?; let record = parse_record_json(&entry_row.record)?; let entry = EntryView::new() diff --git a/crates/weaver-index/src/endpoints/collab.rs b/crates/weaver-index/src/endpoints/collab.rs index 0bcde53..8175da2 100644 --- a/crates/weaver-index/src/endpoints/collab.rs +++ b/crates/weaver-index/src/endpoints/collab.rs @@ -18,11 +18,14 @@ use weaver_api::sh_weaver::collab::get_collaboration_state::{ use weaver_api::sh_weaver::collab::get_resource_participants::{ GetResourceParticipantsOutput, GetResourceParticipantsRequest, }; -use weaver_api::sh_weaver::collab::{CollaborationStateView, ParticipantStateView}; +use weaver_api::sh_weaver::collab::get_resource_sessions::{ + GetResourceSessionsOutput, GetResourceSessionsRequest, +}; +use weaver_api::sh_weaver::collab::{CollaborationStateView, ParticipantStateView, SessionView}; use crate::clickhouse::{CollaboratorRow, ProfileRow}; use crate::endpoints::actor::Viewer; -use crate::endpoints::non_empty_str; +use crate::endpoints::{non_empty_str, resolve_uri}; use crate::endpoints::repo::XrpcErrorResponse; use crate::server::AppState; @@ -37,12 +40,13 @@ pub async fn get_resource_participants( let _viewer: Viewer = viewer; let viewer_did: Option<&str> = _viewer.as_ref().map(|v| v.did().as_str()); - let resource_uri = args.resource.as_str(); + // Resolve URI and get canonical form + let resolved = resolve_uri(&state, &args.resource).await?; // Get all permissions for the resource let permissions = state .clickhouse - .get_resource_permissions(resource_uri) + .get_resource_permissions(&resolved.canonical_uri) .await .map_err(|e| { tracing::error!("Failed to get resource permissions: {}", e); @@ -134,12 +138,13 @@ pub async fn get_collaboration_state( ) -> Result>, XrpcErrorResponse> { let _viewer: Viewer = viewer; - let resource_uri = args.resource.as_str(); + // Resolve URI and get canonical form + let resolved = resolve_uri(&state, &args.resource).await?; // Get permissions for the resource let permissions = state .clickhouse - .get_resource_permissions(resource_uri) + .get_resource_permissions(&resolved.canonical_uri) .await .map_err(|e| { tracing::error!("Failed to get resource permissions: {}", e); @@ -153,7 +158,7 @@ pub async fn get_collaboration_state( // Get collaborators (invite+accept pairs) for additional data let collaborators = state .clickhouse - .get_collaborators(resource_uri) + .get_collaborators(&resolved.canonical_uri) .await .map_err(|e| { tracing::error!("Failed to get collaborators: {}", e); @@ -163,7 +168,7 @@ pub async fn get_collaboration_state( // Check for divergence let has_divergence = state .clickhouse - .has_divergence(resource_uri) + .has_divergence(&resolved.canonical_uri) .await .map_err(|e| { tracing::error!("Failed to check divergence: {}", e); @@ -202,7 +207,7 @@ pub async fn get_collaboration_state( })?; // Build resource StrongRef - look up the CID from the appropriate table - let resource_uri_parsed = AtUri::new(resource_uri) + let resource_uri_parsed = AtUri::new(&resolved.canonical_uri) .map_err(|_| XrpcErrorResponse::internal_error("Invalid resource URI"))? .into_static(); @@ -325,3 +330,119 @@ fn build_participant_state( .maybe_accept_uri(accept_uri) .build()) } + +/// Handle sh.weaver.collab.getResourceSessions +/// +/// Returns active real-time collaboration sessions for a resource. +pub async fn get_resource_sessions( + State(state): State, + ExtractOptionalServiceAuth(viewer): ExtractOptionalServiceAuth, + ExtractXrpc(args): ExtractXrpc, +) -> Result>, XrpcErrorResponse> { + let _viewer: Viewer = viewer; + + // Resolve URI and get canonical form + let resolved = resolve_uri(&state, &args.resource).await?; + + // Get active sessions + let session_rows = state + .clickhouse + .get_resource_sessions(&resolved.canonical_uri) + .await + .map_err(|e| { + tracing::error!("Failed to get resource sessions: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + if session_rows.is_empty() { + return Ok(Json( + GetResourceSessionsOutput { + sessions: Vec::new(), + extra_data: None, + } + .into_static(), + )); + } + + // Collect user DIDs for profile hydration + let user_dids: Vec<&str> = session_rows.iter().map(|s| s.did.as_str()).collect(); + + // Batch fetch profiles + let profiles = state + .clickhouse + .get_profiles_batch(&user_dids) + .await + .map_err(|e| { + tracing::error!("Failed to batch fetch profiles: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + let profile_map: HashMap<&str, &ProfileRow> = + profiles.iter().map(|p| (p.did.as_str(), p)).collect(); + + // Build resource StrongRef once (same for all sessions) + let resource_cid = state + .clickhouse + .get_record_cid(&resolved.did, &resolved.collection, &resolved.rkey) + .await + .map_err(|e| { + tracing::error!("Failed to get resource CID: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })? + .ok_or_else(|| XrpcErrorResponse::not_found("Resource not found"))?; + + let resource_ref = StrongRef::new() + .uri(args.resource.clone().into_static()) + .cid( + Cid::new(resource_cid.as_bytes()) + .map_err(|_| XrpcErrorResponse::internal_error("Invalid resource CID"))? + .into_static(), + ) + .build(); + + // Build session views + let mut sessions = Vec::with_capacity(session_rows.len()); + for row in &session_rows { + let uri = AtUri::new(&format!( + "at://{}/sh.weaver.collab.session/{}", + row.did, row.rkey + )) + .map_err(|_| XrpcErrorResponse::internal_error("Invalid session URI"))? + .into_static(); + + let user = profile_map + .get(row.did.as_str()) + .map(|p| profile_to_view_basic(p)) + .transpose()? + .ok_or_else(|| XrpcErrorResponse::internal_error("Missing user profile"))?; + + let created_at = Datetime::new(row.created_at.fixed_offset()); + let expires_at = row.expires_at.map(|dt| Datetime::new(dt.fixed_offset())); + + let relay_url = if row.relay_url.is_empty() { + None + } else { + jacquard::types::string::Uri::new_owned(row.relay_url.to_string()).ok() + }; + + sessions.push( + SessionView::new() + .uri(uri) + .user(user) + .resource(resource_ref.clone()) + .node_id(row.node_id.to_cowstr().into_static()) + .created_at(created_at) + .maybe_relay_url(relay_url) + .maybe_expires_at(expires_at) + .build(), + ); + } + + Ok(Json( + GetResourceSessionsOutput { + sessions, + extra_data: None, + } + .into_static(), + )) +} diff --git a/crates/weaver-index/src/endpoints/edit.rs b/crates/weaver-index/src/endpoints/edit.rs index 91250a7..1b0b26d 100644 --- a/crates/weaver-index/src/endpoints/edit.rs +++ b/crates/weaver-index/src/endpoints/edit.rs @@ -12,11 +12,16 @@ use jacquard_axum::service_auth::ExtractOptionalServiceAuth; use weaver_api::com_atproto::repo::strong_ref::StrongRef; use weaver_api::sh_weaver::edit::EditHistoryEntry; +use weaver_api::sh_weaver::edit::get_contributors::{ + GetContributorsOutput, GetContributorsRequest, +}; use weaver_api::sh_weaver::edit::get_edit_history::{GetEditHistoryOutput, GetEditHistoryRequest}; +use weaver_api::sh_weaver::edit::list_drafts::{DraftView, ListDraftsOutput, ListDraftsRequest}; use crate::clickhouse::{EditNodeRow, ProfileRow}; -use crate::endpoints::actor::Viewer; +use crate::endpoints::actor::{Viewer, resolve_actor}; use crate::endpoints::collab::profile_to_view_basic; +use crate::endpoints::resolve_uri; use crate::endpoints::repo::XrpcErrorResponse; use crate::server::AppState; @@ -30,9 +35,11 @@ pub async fn get_edit_history( ) -> Result>, XrpcErrorResponse> { let _viewer: Viewer = viewer; - let resource_uri = args.resource.as_str(); let limit = args.limit.unwrap_or(50).min(100).max(1); + // Resolve URI and get canonical form + let resolved = resolve_uri(&state, &args.resource).await?; + // Parse cursor as millisecond timestamp let cursor = args .cursor @@ -46,7 +53,14 @@ pub async fn get_edit_history( // Fetch edit nodes let nodes = state .clickhouse - .get_edit_history(resource_uri, cursor, after_rkey, limit + 1) + .get_edit_history( + &resolved.did, + &resolved.collection, + &resolved.rkey, + cursor, + after_rkey, + limit + 1, + ) .await .map_err(|e| { tracing::error!("Failed to get edit history: {}", e); @@ -184,3 +198,194 @@ fn node_to_history_entry( .maybe_root_ref(root_ref) .build()) } + +/// Handle sh.weaver.edit.getContributors +/// +/// Returns evidence-based contributors for a resource (entry or notebook). +pub async fn get_contributors( + State(state): State, + ExtractOptionalServiceAuth(viewer): ExtractOptionalServiceAuth, + ExtractXrpc(args): ExtractXrpc, +) -> Result>, XrpcErrorResponse> { + let _viewer: Viewer = viewer; + + let include_cascaded = args.include_cascaded.unwrap_or(true); + + // Resolve URI and get canonical form + let resolved = resolve_uri(&state, &args.resource).await?; + + // Get contributors based on resource type + let contributor_dids = match resolved.collection.as_str() { + "sh.weaver.notebook.entry" => { + if include_cascaded { + state + .clickhouse + .get_entry_contributors(&resolved.did, &resolved.rkey) + .await + } else { + state + .clickhouse + .get_entry_contributors_direct(&resolved.did, &resolved.rkey) + .await + } + } + "sh.weaver.notebook.book" => { + state + .clickhouse + .get_notebook_contributors(&resolved.did, &resolved.rkey) + .await + } + _ => { + return Err(XrpcErrorResponse::invalid_request( + "Resource must be an entry or notebook", + )); + } + } + .map_err(|e| { + tracing::error!("Failed to get contributors: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + if contributor_dids.is_empty() { + return Ok(Json( + GetContributorsOutput { + contributors: Vec::new(), + extra_data: None, + } + .into_static(), + )); + } + + // Batch fetch profiles + let did_refs: Vec<&str> = contributor_dids.iter().map(|s| s.as_str()).collect(); + let profiles = state + .clickhouse + .get_profiles_batch(&did_refs) + .await + .map_err(|e| { + tracing::error!("Failed to batch fetch profiles: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + let profile_map: HashMap<&str, &ProfileRow> = + profiles.iter().map(|p| (p.did.as_str(), p)).collect(); + + // Build contributor list + let mut contributors = Vec::with_capacity(contributor_dids.len()); + for did in &contributor_dids { + if let Some(profile) = profile_map.get(did.as_str()) { + contributors.push(profile_to_view_basic(profile)?); + } + } + + Ok(Json( + GetContributorsOutput { + contributors, + extra_data: None, + } + .into_static(), + )) +} + +/// Handle sh.weaver.edit.listDrafts +/// +/// Returns draft records for an actor. +pub async fn list_drafts( + State(state): State, + ExtractOptionalServiceAuth(viewer): ExtractOptionalServiceAuth, + ExtractXrpc(args): ExtractXrpc, +) -> Result>, XrpcErrorResponse> { + let _viewer: Viewer = viewer; + + let limit = args.limit.unwrap_or(50).min(100).max(1); + + // Parse cursor as millisecond timestamp + let cursor = args + .cursor + .as_deref() + .map(|c| c.parse::()) + .transpose() + .map_err(|_| XrpcErrorResponse::invalid_request("Invalid cursor format"))?; + + // Resolve actor to DID + let actor_did = resolve_actor(&state, &args.actor).await?; + + // Fetch drafts + let draft_rows = state + .clickhouse + .list_drafts(&actor_did, cursor, limit + 1) + .await + .map_err(|e| { + tracing::error!("Failed to list drafts: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + // Check if there are more results + let has_more = draft_rows.len() > limit as usize; + let draft_rows: Vec<_> = draft_rows.into_iter().take(limit as usize).collect(); + + // Build draft views + let mut drafts = Vec::with_capacity(draft_rows.len()); + for row in &draft_rows { + let uri = AtUri::new(&format!( + "at://{}/sh.weaver.edit.draft/{}", + row.did, row.rkey + )) + .map_err(|_| XrpcErrorResponse::internal_error("Invalid AT URI"))? + .into_static(); + + let cid = Cid::new(row.cid.as_bytes()) + .map_err(|_| XrpcErrorResponse::internal_error("Invalid CID"))? + .into_static(); + + let created_at = Datetime::new(row.created_at.fixed_offset()); + + // Build optional edit root reference + let edit_root = if !row.root_cid.is_empty() { + let root_uri = AtUri::new(&format!( + "at://{}/sh.weaver.edit.root/{}", + row.root_did, row.root_rkey + )) + .map_err(|_| XrpcErrorResponse::internal_error("Invalid root URI"))? + .into_static(); + + let root_cid = Cid::new(row.root_cid.as_bytes()) + .map_err(|_| XrpcErrorResponse::internal_error("Invalid root CID"))? + .into_static(); + + Some(StrongRef::new().uri(root_uri).cid(root_cid).build()) + } else { + None + }; + + let last_edit_at = row.last_edit_at.map(|dt| Datetime::new(dt.fixed_offset())); + + drafts.push( + DraftView::new() + .uri(uri) + .cid(cid) + .created_at(created_at) + .maybe_edit_root(edit_root) + .maybe_last_edit_at(last_edit_at) + .build(), + ); + } + + // Build cursor from last draft's created_at + let next_cursor = if has_more { + draft_rows + .last() + .map(|d| d.created_at.timestamp_millis().to_cowstr().into_static()) + } else { + None + }; + + Ok(Json( + ListDraftsOutput { + drafts, + cursor: next_cursor, + extra_data: None, + } + .into_static(), + )) +} diff --git a/crates/weaver-index/src/endpoints/mod.rs b/crates/weaver-index/src/endpoints/mod.rs index 126a142..7b1c5fa 100644 --- a/crates/weaver-index/src/endpoints/mod.rs +++ b/crates/weaver-index/src/endpoints/mod.rs @@ -3,14 +3,63 @@ use jacquard::CowStr; use jacquard::IntoStatic; use jacquard::cowstr::ToCowStr; +use jacquard::types::string::AtUri; use smol_str::SmolStr; +use crate::server::AppState; + +use self::actor::resolve_actor; +use self::repo::XrpcErrorResponse; + pub mod actor; pub mod collab; pub mod edit; pub mod notebook; pub mod repo; +/// Resolved AT URI components with canonical DID-based URI. +pub struct ResolvedUri { + /// The resolved DID (authority converted from handle if needed) + pub did: SmolStr, + /// The collection from the URI + pub collection: SmolStr, + /// The record key from the URI + pub rkey: SmolStr, + /// Canonical DID-based URI for database lookups + pub canonical_uri: String, +} + +/// Parse an AT URI and resolve its authority to a DID. +/// +/// This handles the common case where a URI might use a handle as the authority +/// (e.g. `at://alice.bsky.social/...`) but the database stores URIs with DIDs +/// (e.g. `at://did:plc:abc123/...`). +pub async fn resolve_uri( + state: &AppState, + uri: &AtUri<'_>, +) -> Result { + let authority = uri.authority(); + let collection = uri + .collection() + .ok_or_else(|| XrpcErrorResponse::invalid_request("URI must include collection"))?; + let rkey = uri + .rkey() + .ok_or_else(|| XrpcErrorResponse::invalid_request("URI must include rkey"))?; + + // Resolve authority to DID (might be a handle) + let did = resolve_actor(state, authority).await?; + + // Construct canonical DID-based URI for DB lookup + let canonical_uri = format!("at://{}/{}/{}", did, collection, rkey.as_ref()); + + Ok(ResolvedUri { + did: SmolStr::new(&did), + collection: SmolStr::new(collection.as_ref()), + rkey: SmolStr::new(rkey.as_ref()), + canonical_uri, + }) +} + /// Convert SmolStr to Option if non-empty pub fn non_empty_str(s: &SmolStr) -> Option> { if s.is_empty() { diff --git a/crates/weaver-index/src/endpoints/notebook.rs b/crates/weaver-index/src/endpoints/notebook.rs index 55e5dd9..94983ef 100644 --- a/crates/weaver-index/src/endpoints/notebook.rs +++ b/crates/weaver-index/src/endpoints/notebook.rs @@ -17,6 +17,7 @@ use weaver_api::sh_weaver::notebook::{ get_book_entry::{GetBookEntryOutput, GetBookEntryRequest}, get_entry::{GetEntryOutput, GetEntryRequest}, get_entry_feed::{GetEntryFeedOutput, GetEntryFeedRequest}, + get_entry_notebooks::{GetEntryNotebooksOutput, GetEntryNotebooksRequest, NotebookRef}, get_notebook::{GetNotebookOutput, GetNotebookRequest}, get_notebook_feed::{GetNotebookFeedOutput, GetNotebookFeedRequest}, resolve_entry::{ResolveEntryOutput, ResolveEntryRequest}, @@ -809,10 +810,24 @@ pub async fn get_entry_feed( let has_more = entry_rows.len() > limit as usize; let entry_rows: Vec<_> = entry_rows.into_iter().take(limit as usize).collect(); - // Collect author DIDs for hydration + // Batch fetch contributors for all entries + let entry_keys: Vec<(&str, &str)> = entry_rows + .iter() + .map(|e| (e.did.as_str(), e.rkey.as_str())) + .collect(); + let contributors_map = state + .clickhouse + .get_entry_contributors_batch(&entry_keys) + .await + .map_err(|e| { + tracing::error!("Failed to batch fetch contributors: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + // Collect all contributor DIDs for profile hydration let mut all_author_dids: HashSet<&str> = HashSet::new(); - for entry in &entry_rows { - for did in &entry.author_dids { + for contributors in contributors_map.values() { + for did in contributors { all_author_dids.insert(did.as_str()); } } @@ -834,7 +849,14 @@ pub async fn get_entry_feed( // Build FeedEntryViews let mut feed: Vec> = Vec::with_capacity(entry_rows.len()); for entry_row in &entry_rows { - let entry_view = build_entry_view(entry_row, &profile_map)?; + // Get contributors for this entry + let entry_key = (entry_row.did.clone(), entry_row.rkey.clone()); + let contributors = contributors_map + .get(&entry_key) + .map(|v| v.as_slice()) + .unwrap_or(&[]); + + let entry_view = build_entry_view_with_authors(entry_row, contributors, &profile_map)?; let feed_entry = FeedEntryView::new().entry(entry_view).build(); @@ -991,3 +1013,114 @@ fn build_entry_view( Ok(entry_view) } + +/// Handle sh.weaver.notebook.getEntryNotebooks +/// +/// Returns notebooks that contain a given entry. +pub async fn get_entry_notebooks( + State(state): State, + ExtractOptionalServiceAuth(viewer): ExtractOptionalServiceAuth, + ExtractXrpc(args): ExtractXrpc, +) -> Result>, XrpcErrorResponse> { + let _viewer: Viewer = viewer; + + // Parse the entry URI + let entry_uri = &args.entry; + let authority = entry_uri.authority(); + let entry_rkey = entry_uri + .rkey() + .ok_or_else(|| XrpcErrorResponse::invalid_request("Entry URI must include rkey"))?; + + // Resolve authority to DID + let entry_did = resolve_actor(&state, authority).await?; + let entry_did_str = entry_did.as_str(); + let entry_rkey_str = entry_rkey.as_ref(); + + // Get notebooks containing this entry + let notebook_refs = state + .clickhouse + .get_notebooks_for_entry(entry_did_str, entry_rkey_str) + .await + .map_err(|e| { + tracing::error!("Failed to get notebooks for entry: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + if notebook_refs.is_empty() { + return Ok(Json( + GetEntryNotebooksOutput { + notebooks: Vec::new(), + extra_data: None, + } + .into_static(), + )); + } + + // Fetch notebook details and owner profiles + let mut notebooks = Vec::with_capacity(notebook_refs.len()); + let mut owner_dids: HashSet<&str> = HashSet::new(); + + // First pass: collect owner DIDs + for (notebook_did, _notebook_rkey) in ¬ebook_refs { + owner_dids.insert(notebook_did.as_str()); + } + + // Batch fetch profiles + let owner_dids_vec: Vec<&str> = owner_dids.into_iter().collect(); + let profiles = state + .clickhouse + .get_profiles_batch(&owner_dids_vec) + .await + .map_err(|e| { + tracing::error!("Failed to batch fetch profiles: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + let profile_map: HashMap<&str, &ProfileRow> = + profiles.iter().map(|p| (p.did.as_str(), p)).collect(); + + // Fetch each notebook's details + for (notebook_did, notebook_rkey) in ¬ebook_refs { + let notebook_row = state + .clickhouse + .get_notebook(notebook_did.as_str(), notebook_rkey.as_str()) + .await + .map_err(|e| { + tracing::error!("Failed to get notebook: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + if let Some(nb) = notebook_row { + let uri = AtUri::new(&nb.uri) + .map_err(|_| XrpcErrorResponse::internal_error("Invalid notebook URI"))? + .into_static(); + + let cid = Cid::new(nb.cid.as_bytes()) + .map_err(|_| XrpcErrorResponse::internal_error("Invalid notebook CID"))? + .into_static(); + + // Get owner profile + let owner = profile_map + .get(notebook_did.as_str()) + .map(|p| crate::endpoints::collab::profile_to_view_basic(p)) + .transpose()?; + + notebooks.push( + NotebookRef::new() + .uri(uri) + .cid(cid) + .maybe_title(non_empty_cowstr(&nb.title)) + .maybe_owner(owner) + .build(), + ); + } + } + + Ok(Json( + GetEntryNotebooksOutput { + notebooks, + extra_data: None, + } + .into_static(), + )) +} diff --git a/crates/weaver-index/src/server.rs b/crates/weaver-index/src/server.rs index 921fba9..2b30a95 100644 --- a/crates/weaver-index/src/server.rs +++ b/crates/weaver-index/src/server.rs @@ -13,6 +13,7 @@ use jacquard_axum::IntoRouter; use jacquard_axum::did_web::did_web_router; use jacquard_axum::service_auth::ServiceAuth; use serde::Serialize; +use tower_http::cors::CorsLayer; use tower_http::trace::TraceLayer; use tracing::info; use weaver_api::sh_weaver::actor::{ @@ -21,12 +22,15 @@ use weaver_api::sh_weaver::actor::{ }; use weaver_api::sh_weaver::collab::get_collaboration_state::GetCollaborationStateRequest; use weaver_api::sh_weaver::collab::get_resource_participants::GetResourceParticipantsRequest; +use weaver_api::sh_weaver::collab::get_resource_sessions::GetResourceSessionsRequest; +use weaver_api::sh_weaver::edit::get_contributors::GetContributorsRequest; use weaver_api::sh_weaver::edit::get_edit_history::GetEditHistoryRequest; +use weaver_api::sh_weaver::edit::list_drafts::ListDraftsRequest; use weaver_api::sh_weaver::notebook::{ get_book_entry::GetBookEntryRequest, get_entry::GetEntryRequest, - get_entry_feed::GetEntryFeedRequest, get_notebook::GetNotebookRequest, - get_notebook_feed::GetNotebookFeedRequest, resolve_entry::ResolveEntryRequest, - resolve_notebook::ResolveNotebookRequest, + get_entry_feed::GetEntryFeedRequest, get_entry_notebooks::GetEntryNotebooksRequest, + get_notebook::GetNotebookRequest, get_notebook_feed::GetNotebookFeedRequest, + resolve_entry::ResolveEntryRequest, resolve_notebook::ResolveNotebookRequest, }; use crate::clickhouse::Client; @@ -106,6 +110,9 @@ pub fn router(state: AppState, did_doc: DidDocument<'static>) -> Router { )) .merge(GetEntryFeedRequest::into_router(notebook::get_entry_feed)) .merge(GetBookEntryRequest::into_router(notebook::get_book_entry)) + .merge(GetEntryNotebooksRequest::into_router( + notebook::get_entry_notebooks, + )) // sh.weaver.collab.* endpoints .merge(GetResourceParticipantsRequest::into_router( collab::get_resource_participants, @@ -113,9 +120,15 @@ pub fn router(state: AppState, did_doc: DidDocument<'static>) -> Router { .merge(GetCollaborationStateRequest::into_router( collab::get_collaboration_state, )) + .merge(GetResourceSessionsRequest::into_router( + collab::get_resource_sessions, + )) // sh.weaver.edit.* endpoints .merge(GetEditHistoryRequest::into_router(edit::get_edit_history)) + .merge(GetContributorsRequest::into_router(edit::get_contributors)) + .merge(ListDraftsRequest::into_router(edit::list_drafts)) .layer(TraceLayer::new_for_http()) + .layer(CorsLayer::permissive().max_age(std::time::Duration::from_secs(86400))) .with_state(state) .merge(did_web_router(did_doc)) } diff --git a/lexicons/edit/getContributors.json b/lexicons/edit/getContributors.json new file mode 100644 index 0000000..3c676a3 --- /dev/null +++ b/lexicons/edit/getContributors.json @@ -0,0 +1,39 @@ +{ + "lexicon": 1, + "id": "sh.weaver.edit.getContributors", + "defs": { + "main": { + "type": "query", + "description": "Get evidence-based contributors for a resource (entry or notebook). Returns users who have edit history or are explicit collaborators.", + "parameters": { + "type": "params", + "required": ["resource"], + "properties": { + "resource": { + "type": "string", + "format": "at-uri", + "description": "AT URI of the entry or notebook" + }, + "includeCascaded": { + "type": "boolean", + "description": "For entries, also include notebook-level collaborators", + "default": true + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["contributors"], + "properties": { + "contributors": { + "type": "array", + "items": { "type": "ref", "ref": "sh.weaver.actor.defs#profileViewBasic" } + } + } + } + } + } + } +} diff --git a/lexicons/edit/listDrafts.json b/lexicons/edit/listDrafts.json new file mode 100644 index 0000000..d1557ec --- /dev/null +++ b/lexicons/edit/listDrafts.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "sh.weaver.edit.listDrafts", + "defs": { + "main": { + "type": "query", + "description": "List draft records for an actor. Drafts are unpublished edit roots that aren't linked to a published entry.", + "parameters": { + "type": "params", + "required": ["actor"], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier", + "description": "DID or handle of the actor" + }, + "limit": { + "type": "integer", + "minimum": 1, + "maximum": 100, + "default": 50 + }, + "cursor": { "type": "string" } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["drafts"], + "properties": { + "drafts": { + "type": "array", + "items": { "type": "ref", "ref": "#draftView" } + }, + "cursor": { "type": "string" } + } + } + } + }, + "draftView": { + "type": "object", + "description": "Hydrated view of a draft with edit state.", + "required": ["uri", "cid", "createdAt"], + "properties": { + "uri": { "type": "string", "format": "at-uri" }, + "cid": { "type": "string", "format": "cid" }, + "title": { + "type": "string", + "description": "Extracted title if available from edit state" + }, + "editRoot": { + "type": "ref", + "ref": "com.atproto.repo.strongRef", + "description": "Associated edit root if one exists" + }, + "lastEditAt": { "type": "string", "format": "datetime" }, + "createdAt": { "type": "string", "format": "datetime" } + } + } + } +} diff --git a/lexicons/notebook/getEntryNotebooks.json b/lexicons/notebook/getEntryNotebooks.json new file mode 100644 index 0000000..3076bba --- /dev/null +++ b/lexicons/notebook/getEntryNotebooks.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getEntryNotebooks", + "defs": { + "main": { + "type": "query", + "description": "Get notebooks that contain an entry. An entry can appear in multiple notebooks.", + "parameters": { + "type": "params", + "required": ["entry"], + "properties": { + "entry": { + "type": "string", + "format": "at-uri", + "description": "AT URI of the entry" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": ["notebooks"], + "properties": { + "notebooks": { + "type": "array", + "items": { "type": "ref", "ref": "#notebookRef" } + } + } + } + } + }, + "notebookRef": { + "type": "object", + "description": "Reference to a notebook containing this entry.", + "required": ["uri", "cid"], + "properties": { + "uri": { "type": "string", "format": "at-uri" }, + "cid": { "type": "string", "format": "cid" }, + "title": { "type": "string" }, + "owner": { "type": "ref", "ref": "sh.weaver.actor.defs#profileViewBasic" } + } + } + } +} -- knotmirror 0.0.1