From 4453cdd3d0a3a7b6256e516c35fc16fa9901436f Mon Sep 17 00:00:00 2001 From: Orual Date: Sun, 11 Jan 2026 01:00:09 -0500 Subject: [PATCH] custom domain routing --- crates/weaver-api/Cargo.toml | 2 +- .../lexicons/blog_pckt_content.json | 23 + .../lexicons/sh_weaver_domain_defs.json | 105 ++ .../sh_weaver_domain_generateDocument.json | 60 + .../sh_weaver_domain_resolveByDomain.json | 42 + .../sh_weaver_domain_resolveDocument.json | 51 + .../lexicons/site_standard_document.json | 126 +- .../site_standard_graph_subscription.json | 24 + .../lexicons/site_standard_publication.json | 81 +- .../lexicons/site_standard_theme_basic.json | 5 + crates/weaver-api/src/app_bsky/actor.rs | 212 +-- .../weaver-api/src/app_bsky/ageassurance.rs | 168 +-- crates/weaver-api/src/app_bsky/bookmark.rs | 26 +- .../src/app_bsky/bookmark/create_bookmark.rs | 26 +- .../weaver-api/src/app_bsky/embed/external.rs | 60 +- .../weaver-api/src/app_bsky/embed/images.rs | 56 +- .../weaver-api/src/app_bsky/embed/record.rs | 168 +-- .../src/app_bsky/embed/record_with_media.rs | 26 +- crates/weaver-api/src/app_bsky/embed/video.rs | 26 +- crates/weaver-api/src/app_bsky/feed.rs | 218 +-- .../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 | 26 +- .../weaver-api/src/app_bsky/feed/postgate.rs | 26 +- .../src/app_bsky/feed/threadgate.rs | 26 +- crates/weaver-api/src/app_bsky/graph.rs | 374 ++--- .../weaver-api/src/app_bsky/graph/follow.rs | 26 +- crates/weaver-api/src/app_bsky/graph/list.rs | 48 +- .../weaver-api/src/app_bsky/graph/listitem.rs | 48 +- .../src/app_bsky/graph/starterpack.rs | 30 +- .../src/app_bsky/graph/verification.rs | 34 +- crates/weaver-api/src/app_bsky/labeler.rs | 72 +- .../weaver-api/src/app_bsky/notification.rs | 386 ++--- .../notification/list_notifications.rs | 156 +- .../app_bsky/notification/register_push.rs | 62 +- .../app_bsky/notification/unregister_push.rs | 52 +- crates/weaver-api/src/app_bsky/unspecced.rs | 342 ++--- .../src/app_bsky/unspecced/get_config.rs | 26 +- .../unspecced/get_post_thread_other_v2.rs | 48 +- .../app_bsky/unspecced/get_post_thread_v2.rs | 48 +- .../unspecced/get_tagged_suggestions.rs | 30 +- crates/weaver-api/src/blog_pckt.rs | 1 + .../weaver-api/src/blog_pckt/block/image.rs | 26 +- .../weaver-api/src/blog_pckt/block/mention.rs | 26 +- .../src/blog_pckt/block/task_item.rs | 26 +- crates/weaver-api/src/blog_pckt/content.rs | 190 +++ crates/weaver-api/src/blog_pckt/post.rs | 56 +- .../src/blog_pckt/richtext/facet.rs | 26 +- crates/weaver-api/src/chat_bsky/convo.rs | 330 ++-- .../moderation/get_actor_metadata.rs | 34 +- crates/weaver-api/src/com_atproto/admin.rs | 26 +- .../src/com_atproto/admin/send_email.rs | 30 +- .../admin/update_account_password.rs | 26 +- crates/weaver-api/src/com_atproto/identity.rs | 30 +- crates/weaver-api/src/com_atproto/label.rs | 160 +- .../com_atproto/moderation/create_report.rs | 26 +- crates/weaver-api/src/com_atproto/repo.rs | 26 +- .../src/com_atproto/repo/apply_writes.rs | 56 +- .../src/com_atproto/repo/create_record.rs | 30 +- .../src/com_atproto/repo/delete_record.rs | 30 +- .../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 | 148 +- .../com_atproto/server/create_invite_codes.rs | 26 +- .../src/com_atproto/server/delete_account.rs | 30 +- .../com_atproto/server/list_app_passwords.rs | 26 +- .../src/com_atproto/sync/get_blob.rs | 26 +- .../src/com_atproto/sync/get_record.rs | 30 +- .../src/com_atproto/sync/list_repos.rs | 48 +- .../src/com_atproto/sync/subscribe_repos.rs | 362 ++--- .../src/com_deckbelcher/deck/list.rs | 60 +- .../src/com_deckbelcher/richtext/facet.rs | 26 +- crates/weaver-api/src/com_whtwnd/blog.rs | 26 +- .../src/pub_leaflet/blocks/image.rs | 26 +- crates/weaver-api/src/pub_leaflet/comment.rs | 74 +- crates/weaver-api/src/pub_leaflet/document.rs | 48 +- .../src/pub_leaflet/pages/canvas.rs | 60 +- .../src/pub_leaflet/pages/linear_document.rs | 26 +- .../weaver-api/src/pub_leaflet/poll/vote.rs | 26 +- .../src/pub_leaflet/richtext/facet.rs | 52 +- .../weaver-api/src/pub_leaflet/theme/color.rs | 78 +- crates/weaver-api/src/sh_weaver.rs | 1 + crates/weaver-api/src/sh_weaver/actor.rs | 56 +- crates/weaver-api/src/sh_weaver/collab.rs | 286 ++-- .../weaver-api/src/sh_weaver/collab/invite.rs | 30 +- .../src/sh_weaver/collab/session.rs | 30 +- crates/weaver-api/src/sh_weaver/domain.rs | 1339 +++++++++++++++++ .../src/sh_weaver/domain/generate_document.rs | 280 ++++ .../src/sh_weaver/domain/resolve_by_domain.rs | 186 +++ .../src/sh_weaver/domain/resolve_document.rs | 233 +++ crates/weaver-api/src/sh_weaver/edit.rs | 120 +- .../weaver-api/src/sh_weaver/edit/cursor.rs | 56 +- crates/weaver-api/src/sh_weaver/edit/diff.rs | 26 +- .../src/sh_weaver/edit/list_drafts.rs | 30 +- crates/weaver-api/src/sh_weaver/edit/root.rs | 26 +- crates/weaver-api/src/sh_weaver/embed.rs | 26 +- .../src/sh_weaver/embed/external.rs | 60 +- .../weaver-api/src/sh_weaver/embed/images.rs | 30 +- .../src/sh_weaver/embed/record_with_media.rs | 26 +- .../weaver-api/src/sh_weaver/embed/records.rs | 64 +- .../weaver-api/src/sh_weaver/embed/video.rs | 26 +- crates/weaver-api/src/sh_weaver/graph.rs | 172 +-- .../src/sh_weaver/graph/bookmark.rs | 26 +- crates/weaver-api/src/sh_weaver/graph/list.rs | 48 +- .../src/sh_weaver/graph/listitem.rs | 30 +- .../src/sh_weaver/graph/subscribe.rs | 26 +- crates/weaver-api/src/sh_weaver/graph/tag.rs | 30 +- crates/weaver-api/src/sh_weaver/notebook.rs | 544 +++---- .../weaver-api/src/sh_weaver/notebook/book.rs | 26 +- .../src/sh_weaver/notebook/colour_scheme.rs | 30 +- .../src/sh_weaver/notebook/entry.rs | 52 +- .../sh_weaver/notebook/get_entry_notebooks.rs | 26 +- .../sh_weaver/notebook/get_reading_history.rs | 26 +- .../src/sh_weaver/notebook/resolve_entry.rs | 30 +- .../sh_weaver/notebook/resolve_notebook.rs | 26 +- .../src/sh_weaver/notebook/theme.rs | 156 +- .../weaver-api/src/sh_weaver/notification.rs | 216 +-- crates/weaver-api/src/site_standard.rs | 1 + .../weaver-api/src/site_standard/document.rs | 593 +++++--- crates/weaver-api/src/site_standard/graph.rs | 6 + .../src/site_standard/graph/subscription.rs | 270 ++++ .../src/site_standard/publication.rs | 354 +++-- .../src/site_standard/theme/basic.rs | 69 +- .../src/site_standard/theme/color.rs | 64 +- .../src/tools_ozone/communication.rs | 86 +- .../weaver-api/src/tools_ozone/moderation.rs | 974 ++++++------ .../moderation/cancel_scheduled_actions.rs | 26 +- .../src/tools_ozone/moderation/emit_event.rs | 48 +- .../moderation/get_account_timeline.rs | 56 +- .../tools_ozone/moderation/schedule_action.rs | 60 +- crates/weaver-api/src/tools_ozone/safelink.rs | 280 ++-- .../src/tools_ozone/safelink/add_rule.rs | 34 +- .../src/tools_ozone/safelink/remove_rule.rs | 26 +- .../src/tools_ozone/safelink/update_rule.rs | 52 +- crates/weaver-api/src/tools_ozone/set.rs | 52 +- .../src/tools_ozone/set/delete_values.rs | 26 +- crates/weaver-api/src/tools_ozone/setting.rs | 96 +- .../src/tools_ozone/setting/upsert_option.rs | 30 +- .../src/tools_ozone/team/add_member.rs | 26 +- .../src/tools_ozone/verification.rs | 76 +- .../verification/grant_verifications.rs | 74 +- .../verification/revoke_verifications.rs | 26 +- crates/weaver-app/Cargo.toml | 2 +- crates/weaver-app/src/components/app_link.rs | 74 +- crates/weaver-app/src/custom_domain_app.rs | 150 ++ crates/weaver-app/src/data.rs | 194 ++- crates/weaver-app/src/host_mode.rs | 88 +- crates/weaver-app/src/lib.rs | 122 +- crates/weaver-app/src/main.rs | 22 +- crates/weaver-app/src/middleware.rs | 182 +++ crates/weaver-app/src/subdomain_app.rs | 3 + crates/weaver-app/src/views/notebook.rs | 9 +- .../weaver-app/src/views/subdomain_navbar.rs | 5 + crates/weaver-app/src/well_known.rs | 37 + crates/weaver-common/src/domain_encoding.rs | 112 ++ crates/weaver-common/src/lib.rs | 2 + .../clickhouse/041_publications.sql | 45 + .../clickhouse/042_publications_mv.sql | 34 + .../migrations/clickhouse/043_documents.sql | 44 + .../clickhouse/044_documents_mv.sql | 53 + .../clickhouse/045_custom_domains.sql | 38 + crates/weaver-index/src/clickhouse.rs | 5 +- crates/weaver-index/src/clickhouse/queries.rs | 2 + .../src/clickhouse/queries/notebooks.rs | 131 +- .../src/clickhouse/queries/publications.rs | 223 +++ crates/weaver-index/src/endpoints/domain.rs | 255 ++++ crates/weaver-index/src/endpoints/mod.rs | 1 + crates/weaver-index/src/endpoints/notebook.rs | 68 +- crates/weaver-index/src/landing.html | 2 +- crates/weaver-index/src/server.rs | 14 +- crates/weaver-renderer/Cargo.toml | 2 +- .../src/atproto/embed_renderer.rs | 49 +- .../src/pckt/block_renderer.rs | 243 ++- crates/weaver-renderer/src/pckt/mod.rs | 2 +- docker-compose.yml | 21 + infra/caddy/Caddyfile | 32 + infra/caddy/Dockerfile | 8 + 180 files changed, 10420 insertions(+), 5578 deletions(-) create mode 100644 crates/weaver-api/lexicons/blog_pckt_content.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_domain_defs.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_domain_generateDocument.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_domain_resolveByDomain.json create mode 100644 crates/weaver-api/lexicons/sh_weaver_domain_resolveDocument.json create mode 100644 crates/weaver-api/lexicons/site_standard_graph_subscription.json create mode 100644 crates/weaver-api/src/blog_pckt/content.rs create mode 100644 crates/weaver-api/src/sh_weaver/domain.rs create mode 100644 crates/weaver-api/src/sh_weaver/domain/generate_document.rs create mode 100644 crates/weaver-api/src/sh_weaver/domain/resolve_by_domain.rs create mode 100644 crates/weaver-api/src/sh_weaver/domain/resolve_document.rs create mode 100644 crates/weaver-api/src/site_standard/graph.rs create mode 100644 crates/weaver-api/src/site_standard/graph/subscription.rs create mode 100644 crates/weaver-app/src/custom_domain_app.rs create mode 100644 crates/weaver-app/src/middleware.rs create mode 100644 crates/weaver-app/src/well_known.rs create mode 100644 crates/weaver-common/src/domain_encoding.rs create mode 100644 crates/weaver-index/migrations/clickhouse/041_publications.sql create mode 100644 crates/weaver-index/migrations/clickhouse/042_publications_mv.sql create mode 100644 crates/weaver-index/migrations/clickhouse/043_documents.sql create mode 100644 crates/weaver-index/migrations/clickhouse/044_documents_mv.sql create mode 100644 crates/weaver-index/migrations/clickhouse/045_custom_domains.sql create mode 100644 crates/weaver-index/src/clickhouse/queries/publications.rs create mode 100644 crates/weaver-index/src/endpoints/domain.rs create mode 100644 infra/caddy/Caddyfile create mode 100644 infra/caddy/Dockerfile diff --git a/crates/weaver-api/Cargo.toml b/crates/weaver-api/Cargo.toml index 1e8b634..238abfe 100644 --- a/crates/weaver-api/Cargo.toml +++ b/crates/weaver-api/Cargo.toml @@ -37,6 +37,6 @@ com_atproto = [] com_deckbelcher = ["com_atproto"] com_whtwnd = [] pub_leaflet = ["com_atproto"] -sh_weaver = ["app_bsky", "com_atproto"] +sh_weaver = ["app_bsky", "com_atproto", "site_standard"] site_standard = ["com_atproto"] tools_ozone = ["app_bsky", "chat_bsky", "com_atproto"] diff --git a/crates/weaver-api/lexicons/blog_pckt_content.json b/crates/weaver-api/lexicons/blog_pckt_content.json new file mode 100644 index 0000000..007fbc5 --- /dev/null +++ b/crates/weaver-api/lexicons/blog_pckt_content.json @@ -0,0 +1,23 @@ +{ + "lexicon": 1, + "id": "blog.pckt.content", + "defs": { + "main": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "description": "Array of content blocks", + "items": { + "type": "union", + "refs": [], + "closed": false + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_domain_defs.json b/crates/weaver-api/lexicons/sh_weaver_domain_defs.json new file mode 100644 index 0000000..2be5665 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_domain_defs.json @@ -0,0 +1,105 @@ +{ + "lexicon": 1, + "id": "sh.weaver.domain.defs", + "defs": { + "documentView": { + "type": "object", + "description": "Hydrated view of a document with re-hydrated content.", + "required": [ + "uri", + "cid", + "did", + "rkey", + "title", + "path", + "record", + "indexedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "did": { + "type": "string", + "format": "did" + }, + "entryIndex": { + "type": "integer" + }, + "entryUri": { + "type": "string", + "format": "at-uri" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "path": { + "type": "string" + }, + "record": { + "type": "unknown" + }, + "rkey": { + "type": "string" + }, + "title": { + "type": "string" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "publicationView": { + "type": "object", + "description": "Hydrated view of a publication with domain info.", + "required": [ + "uri", + "cid", + "did", + "rkey", + "name", + "domain", + "record", + "indexedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "did": { + "type": "string", + "format": "did" + }, + "domain": { + "type": "string" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "name": { + "type": "string" + }, + "notebookUri": { + "type": "string", + "format": "at-uri" + }, + "record": { + "type": "unknown" + }, + "rkey": { + "type": "string" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_domain_generateDocument.json b/crates/weaver-api/lexicons/sh_weaver_domain_generateDocument.json new file mode 100644 index 0000000..6dd06a5 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_domain_generateDocument.json @@ -0,0 +1,60 @@ +{ + "lexicon": 1, + "id": "sh.weaver.domain.generateDocument", + "defs": { + "main": { + "type": "query", + "description": "Generate a site.standard.document record from a weaver entry. Returns a ready-to-write record with fully hydrated BookEntryView in content.", + "parameters": { + "type": "params", + "required": [ + "entry", + "publication", + "path" + ], + "properties": { + "entry": { + "type": "string", + "description": "AT-URI of the sh.weaver.notebook.entry to convert.", + "format": "at-uri" + }, + "path": { + "type": "string", + "description": "URL path for the document." + }, + "publication": { + "type": "string", + "description": "AT-URI of the site.standard.publication this document belongs to.", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "record" + ], + "properties": { + "record": { + "type": "ref", + "ref": "site.standard.document" + } + } + } + }, + "errors": [ + { + "name": "PublicationNotFound" + }, + { + "name": "EntryNotFound" + }, + { + "name": "NotebookNotLinked" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_domain_resolveByDomain.json b/crates/weaver-api/lexicons/sh_weaver_domain_resolveByDomain.json new file mode 100644 index 0000000..0885e47 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_domain_resolveByDomain.json @@ -0,0 +1,42 @@ +{ + "lexicon": 1, + "id": "sh.weaver.domain.resolveByDomain", + "defs": { + "main": { + "type": "query", + "description": "Resolve a publication by its custom domain.", + "parameters": { + "type": "params", + "required": [ + "domain" + ], + "properties": { + "domain": { + "type": "string", + "description": "The custom domain to resolve (e.g., myblog.com)." + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "publication" + ], + "properties": { + "publication": { + "type": "ref", + "ref": "sh.weaver.domain.defs#publicationView" + } + } + } + }, + "errors": [ + { + "name": "DomainNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_domain_resolveDocument.json b/crates/weaver-api/lexicons/sh_weaver_domain_resolveDocument.json new file mode 100644 index 0000000..6a06ee8 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_domain_resolveDocument.json @@ -0,0 +1,51 @@ +{ + "lexicon": 1, + "id": "sh.weaver.domain.resolveDocument", + "defs": { + "main": { + "type": "query", + "description": "Resolve a document by path within a publication. Returns re-hydrated content for weaver-backed documents.", + "parameters": { + "type": "params", + "required": [ + "publication", + "path" + ], + "properties": { + "path": { + "type": "string", + "description": "URL path within the publication (e.g., /posts/my-first-post)." + }, + "publication": { + "type": "string", + "description": "AT-URI of the publication.", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "document" + ], + "properties": { + "document": { + "type": "ref", + "ref": "sh.weaver.domain.defs#documentView" + } + } + } + }, + "errors": [ + { + "name": "PublicationNotFound" + }, + { + "name": "DocumentNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/site_standard_document.json b/crates/weaver-api/lexicons/site_standard_document.json index c91bcda..14c2568 100644 --- a/crates/weaver-api/lexicons/site_standard_document.json +++ b/crates/weaver-api/lexicons/site_standard_document.json @@ -3,68 +3,80 @@ "id": "site.standard.document", "defs": { "main": { - "type": "object", - "required": [ - "publication", - "title", - "publishedAt" - ], - "properties": { - "bskyPostRef": { - "type": "ref", - "ref": "com.atproto.repo.strongRef" - }, - "content": { - "type": "array", - "items": { + "type": "record", + "description": "A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "site", + "title", + "publishedAt" + ], + "properties": { + "bskyPostRef": { + "type": "ref", + "description": "Strong reference to a Bluesky post. Useful to keep track of comments off-platform.", + "ref": "com.atproto.repo.strongRef" + }, + "content": { "type": "union", + "description": "Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats.", "refs": [], "closed": false - } - }, - "coverImage": { - "type": "blob", - "accept": [ - "image/*" - ], - "maxSize": 1000000 - }, - "description": { - "type": "string", - "maxLength": 3000, - "maxGraphemes": 300 - }, - "path": { - "type": "string", - "description": "combined with the publications url to construct a full url to the document" - }, - "publication": { - "type": "string", - "format": "at-uri" - }, - "publishedAt": { - "type": "string", - "format": "datetime" - }, - "tags": { - "type": "array", - "items": { + }, + "coverImage": { + "type": "blob", + "description": "Image to used for thumbnail or cover image. Less than 1MB is size.", + "accept": [ + "image/*" + ], + "maxSize": 1000000 + }, + "description": { + "type": "string", + "description": "A brief description or excerpt from the document.", + "maxLength": 3000, + "maxGraphemes": 300 + }, + "path": { + "type": "string", + "description": "Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash." + }, + "publishedAt": { + "type": "string", + "description": "Timestamp of the documents publish time.", + "format": "datetime" + }, + "site": { + "type": "string", + "description": "Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes.", + "format": "uri" + }, + "tags": { + "type": "array", + "description": "Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags.", + "items": { + "type": "string", + "maxLength": 100, + "maxGraphemes": 50 + } + }, + "textContent": { + "type": "string", + "description": "Plaintext representation of the documents contents. Should not contain markdown or other formatting." + }, + "title": { + "type": "string", + "description": "Title of the document.", + "maxLength": 1280, + "maxGraphemes": 128 + }, + "updatedAt": { "type": "string", - "maxLength": 100, - "maxGraphemes": 50 + "description": "Timestamp of the documents last edit.", + "format": "datetime" } - }, - "textContent": { - "type": "string" - }, - "title": { - "type": "string", - "maxLength": 1280, - "maxGraphemes": 128 - }, - "updatedAt": { - "type": "string", - "format": "datetime" } } } diff --git a/crates/weaver-api/lexicons/site_standard_graph_subscription.json b/crates/weaver-api/lexicons/site_standard_graph_subscription.json new file mode 100644 index 0000000..6099f15 --- /dev/null +++ b/crates/weaver-api/lexicons/site_standard_graph_subscription.json @@ -0,0 +1,24 @@ +{ + "lexicon": 1, + "id": "site.standard.graph.subscription", + "defs": { + "main": { + "type": "record", + "description": "Record declaring a subscription to a publication", + "key": "tid", + "record": { + "type": "object", + "required": [ + "publication" + ], + "properties": { + "publication": { + "type": "string", + "description": "AT-URI reference to the publication record being subscribed to (ex: at://did:plc:abc123/site.standard.publication/xyz789).", + "format": "at-uri" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/site_standard_publication.json b/crates/weaver-api/lexicons/site_standard_publication.json index 6bbce37..dbc7405 100644 --- a/crates/weaver-api/lexicons/site_standard_publication.json +++ b/crates/weaver-api/lexicons/site_standard_publication.json @@ -3,48 +3,61 @@ "id": "site.standard.publication", "defs": { "main": { - "type": "object", - "required": [ - "url", - "name" - ], - "properties": { - "basicTheme": { - "type": "ref", - "ref": "site.standard.theme.basic" - }, - "description": { - "type": "string", - "maxLength": 3000, - "maxGraphemes": 300 - }, - "icon": { - "type": "blob", - "accept": [ - "image/*" - ], - "maxSize": 1000000 - }, - "name": { - "type": "string", - "maxLength": 1280, - "maxGraphemes": 128 - }, - "preferences": { - "type": "ref", - "ref": "#preferences" - }, - "url": { - "type": "string", - "format": "uri" + "type": "record", + "description": "A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "url", + "name" + ], + "properties": { + "basicTheme": { + "type": "ref", + "description": "Simplified publication theme for tools and apps to utilize when displaying content.", + "ref": "site.standard.theme.basic" + }, + "description": { + "type": "string", + "description": "Brief description of the publication.", + "maxLength": 3000, + "maxGraphemes": 300 + }, + "icon": { + "type": "blob", + "description": "Square image to identify the publication. Should be at least 256x256.", + "accept": [ + "image/*" + ], + "maxSize": 1000000 + }, + "name": { + "type": "string", + "description": "Name of the publication.", + "maxLength": 1280, + "maxGraphemes": 128 + }, + "preferences": { + "type": "ref", + "description": "Object containing platform specific preferences (with a few shared properties).", + "ref": "#preferences" + }, + "url": { + "type": "string", + "description": "Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path.", + "format": "uri" + } } } }, "preferences": { "type": "object", + "description": "Platform-specific preferences for the publication, including discovery and visibility settings.", "properties": { "showInDiscover": { "type": "boolean", + "description": "Boolean which decides whether the publication should appear in discovery feeds.", "default": true } } diff --git a/crates/weaver-api/lexicons/site_standard_theme_basic.json b/crates/weaver-api/lexicons/site_standard_theme_basic.json index 771f1ab..5a2c374 100644 --- a/crates/weaver-api/lexicons/site_standard_theme_basic.json +++ b/crates/weaver-api/lexicons/site_standard_theme_basic.json @@ -4,6 +4,7 @@ "defs": { "main": { "type": "object", + "description": "A simplified theme definition for publications, providing basic color customization for content display across different platforms and applications.", "required": [ "background", "foreground", @@ -13,24 +14,28 @@ "properties": { "accent": { "type": "union", + "description": "Color used for links and button backgrounds.", "refs": [ "site.standard.theme.color#rgb" ] }, "accentForeground": { "type": "union", + "description": "Color used for button text.", "refs": [ "site.standard.theme.color#rgb" ] }, "background": { "type": "union", + "description": "Color used for content background.", "refs": [ "site.standard.theme.color#rgb" ] }, "foreground": { "type": "union", + "description": "Color used for content text.", "refs": [ "site.standard.theme.color#rgb" ] diff --git a/crates/weaver-api/src/app_bsky/actor.rs b/crates/weaver-api/src/app_bsky/actor.rs index f39de99..93acf72 100644 --- a/crates/weaver-api/src/app_bsky/actor.rs +++ b/crates/weaver-api/src/app_bsky/actor.rs @@ -3627,37 +3627,37 @@ pub mod muted_word_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Targets; type Value; + type Targets; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Targets = Unset; type Value = Unset; - } - ///State transition - sets the `targets` field to Set - pub struct SetTargets(PhantomData S>); - impl sealed::Sealed for SetTargets {} - impl State for SetTargets { - type Targets = Set; - type Value = S::Value; + type Targets = Unset; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Targets = S::Targets; type Value = Set; + type Targets = S::Targets; + } + ///State transition - sets the `targets` field to Set + pub struct SetTargets(PhantomData S>); + impl sealed::Sealed for SetTargets {} + impl State for SetTargets { + type Value = S::Value; + type Targets = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `targets` field - pub struct targets(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `targets` field + pub struct targets(()); } } @@ -3784,8 +3784,8 @@ where impl<'a, S> MutedWordBuilder<'a, S> where S: muted_word_state::State, - S::Targets: muted_word_state::IsSet, S::Value: muted_word_state::IsSet, + S::Targets: muted_word_state::IsSet, { /// Build the final struct pub fn build(self) -> MutedWord<'a> { @@ -5007,37 +5007,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(()); } } @@ -5362,8 +5362,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> { @@ -6040,37 +6040,37 @@ pub mod profile_view_detailed_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(()); } } @@ -6524,8 +6524,8 @@ impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S impl<'a, S> ProfileViewDetailedBuilder<'a, S> where S: profile_view_detailed_state::State, - S::Did: profile_view_detailed_state::IsSet, S::Handle: profile_view_detailed_state::IsSet, + S::Did: profile_view_detailed_state::IsSet, { /// Build the final struct pub fn build(self) -> ProfileViewDetailed<'a> { @@ -6697,67 +6697,67 @@ pub mod saved_feed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Type; - type Pinned; - type Id; type Value; + type Id; + type Pinned; + type Type; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Type = Unset; - type Pinned = Unset; - type Id = Unset; type Value = Unset; + type Id = Unset; + type Pinned = Unset; + type Type = Unset; } - ///State transition - sets the `type` field to Set - pub struct SetType(PhantomData S>); - impl sealed::Sealed for SetType {} - impl State for SetType { - type Type = Set; - type Pinned = S::Pinned; + ///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 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 Pinned = S::Pinned; type Type = S::Type; - type Pinned = Set; - type Id = S::Id; - type Value = S::Value; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type Type = S::Type; - type Pinned = S::Pinned; - type Id = Set; type Value = S::Value; + type Id = Set; + type Pinned = S::Pinned; + 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 { + ///State transition - sets the `pinned` field to Set + pub struct SetPinned(PhantomData S>); + impl sealed::Sealed for SetPinned {} + impl State for SetPinned { + type Value = S::Value; + type Id = S::Id; + type Pinned = Set; type Type = S::Type; - type Pinned = S::Pinned; + } + ///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 Value = Set; + type Pinned = S::Pinned; + type Type = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `type` field - pub struct r#type(()); - ///Marker type for the `pinned` field - pub struct pinned(()); - ///Marker type for the `id` field - pub struct id(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `id` field + pub struct id(()); + ///Marker type for the `pinned` field + pub struct pinned(()); + ///Marker type for the `type` field + pub struct r#type(()); } } @@ -6870,10 +6870,10 @@ where impl<'a, S> SavedFeedBuilder<'a, S> where S: saved_feed_state::State, - S::Type: saved_feed_state::IsSet, - S::Pinned: saved_feed_state::IsSet, - S::Id: saved_feed_state::IsSet, S::Value: saved_feed_state::IsSet, + S::Id: saved_feed_state::IsSet, + S::Pinned: saved_feed_state::IsSet, + S::Type: saved_feed_state::IsSet, { /// Build the final struct pub fn build(self) -> SavedFeed<'a> { @@ -7383,37 +7383,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(()); } } @@ -7540,8 +7540,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> { @@ -7884,51 +7884,51 @@ pub mod verification_state_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type VerifiedStatus; type Verifications; type TrustedVerifierStatus; - type VerifiedStatus; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type VerifiedStatus = Unset; type Verifications = Unset; type TrustedVerifierStatus = Unset; - type VerifiedStatus = Unset; + } + ///State transition - sets the `verified_status` field to Set + pub struct SetVerifiedStatus(PhantomData S>); + impl sealed::Sealed for SetVerifiedStatus {} + impl State for SetVerifiedStatus { + type VerifiedStatus = Set; + type Verifications = S::Verifications; + type TrustedVerifierStatus = S::TrustedVerifierStatus; } ///State transition - sets the `verifications` field to Set pub struct SetVerifications(PhantomData S>); impl sealed::Sealed for SetVerifications {} impl State for SetVerifications { + type VerifiedStatus = S::VerifiedStatus; type Verifications = Set; type TrustedVerifierStatus = S::TrustedVerifierStatus; - type VerifiedStatus = S::VerifiedStatus; } ///State transition - sets the `trusted_verifier_status` field to Set pub struct SetTrustedVerifierStatus(PhantomData S>); impl sealed::Sealed for SetTrustedVerifierStatus {} impl State for SetTrustedVerifierStatus { - type Verifications = S::Verifications; - type TrustedVerifierStatus = Set; type VerifiedStatus = S::VerifiedStatus; - } - ///State transition - sets the `verified_status` field to Set - pub struct SetVerifiedStatus(PhantomData S>); - impl sealed::Sealed for SetVerifiedStatus {} - impl State for SetVerifiedStatus { type Verifications = S::Verifications; - type TrustedVerifierStatus = S::TrustedVerifierStatus; - type VerifiedStatus = Set; + type TrustedVerifierStatus = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `verified_status` field + pub struct verified_status(()); ///Marker type for the `verifications` field pub struct verifications(()); ///Marker type for the `trusted_verifier_status` field pub struct trusted_verifier_status(()); - ///Marker type for the `verified_status` field - pub struct verified_status(()); } } @@ -8024,9 +8024,9 @@ where impl<'a, S> VerificationStateBuilder<'a, S> where S: verification_state_state::State, + S::VerifiedStatus: verification_state_state::IsSet, S::Verifications: verification_state_state::IsSet, S::TrustedVerifierStatus: verification_state_state::IsSet, - S::VerifiedStatus: verification_state_state::IsSet, { /// Build the final struct pub fn build(self) -> VerificationState<'a> { diff --git a/crates/weaver-api/src/app_bsky/ageassurance.rs b/crates/weaver-api/src/app_bsky/ageassurance.rs index 462ba49..0b2d95f 100644 --- a/crates/weaver-api/src/app_bsky/ageassurance.rs +++ b/crates/weaver-api/src/app_bsky/ageassurance.rs @@ -2088,37 +2088,37 @@ pub mod config_region_rule_if_assured_under_age_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Age; type Access; + type Age; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Age = Unset; type Access = Unset; - } - ///State transition - sets the `age` field to Set - pub struct SetAge(PhantomData S>); - impl sealed::Sealed for SetAge {} - impl State for SetAge { - type Age = Set; - type Access = S::Access; + type Age = Unset; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { - type Age = S::Age; type Access = Set; + type Age = S::Age; + } + ///State transition - sets the `age` field to Set + pub struct SetAge(PhantomData S>); + impl sealed::Sealed for SetAge {} + impl State for SetAge { + type Access = S::Access; + type Age = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `age` field - pub struct age(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `age` field + pub struct age(()); } } @@ -2208,8 +2208,8 @@ where impl<'a, S> ConfigRegionRuleIfAssuredUnderAgeBuilder<'a, S> where S: config_region_rule_if_assured_under_age_state::State, - S::Age: config_region_rule_if_assured_under_age_state::IsSet, S::Access: config_region_rule_if_assured_under_age_state::IsSet, + S::Age: config_region_rule_if_assured_under_age_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfAssuredUnderAge<'a> { @@ -2476,37 +2476,37 @@ pub mod config_region_rule_if_declared_under_age_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Age; type Access; + type Age; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Age = Unset; type Access = Unset; - } - ///State transition - sets the `age` field to Set - pub struct SetAge(PhantomData S>); - impl sealed::Sealed for SetAge {} - impl State for SetAge { - type Age = Set; - type Access = S::Access; + type Age = Unset; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { - type Age = S::Age; type Access = Set; + type Age = S::Age; + } + ///State transition - sets the `age` field to Set + pub struct SetAge(PhantomData S>); + impl sealed::Sealed for SetAge {} + impl State for SetAge { + type Access = S::Access; + type Age = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `age` field - pub struct age(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `age` field + pub struct age(()); } } @@ -2596,8 +2596,8 @@ where impl<'a, S> ConfigRegionRuleIfDeclaredUnderAgeBuilder<'a, S> where S: config_region_rule_if_declared_under_age_state::State, - S::Age: config_region_rule_if_declared_under_age_state::IsSet, S::Access: config_region_rule_if_declared_under_age_state::IsSet, + S::Age: config_region_rule_if_declared_under_age_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfDeclaredUnderAge<'a> { @@ -2704,85 +2704,85 @@ pub mod event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; + type CountryCode; + type AttemptId; type Access; + type CreatedAt; type Status; - type AttemptId; - type CountryCode; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; + type CountryCode = Unset; + type AttemptId = Unset; type Access = Unset; + type CreatedAt = Unset; type Status = Unset; - type AttemptId = Unset; - type CountryCode = 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 `country_code` field to Set + pub struct SetCountryCode(PhantomData S>); + impl sealed::Sealed for SetCountryCode {} + impl State for SetCountryCode { + type CountryCode = Set; + type AttemptId = S::AttemptId; type Access = S::Access; + type CreatedAt = S::CreatedAt; type Status = S::Status; - 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 CountryCode = S::CountryCode; + type AttemptId = Set; + type Access = S::Access; + type CreatedAt = S::CreatedAt; + type Status = S::Status; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { - type CreatedAt = S::CreatedAt; + type CountryCode = S::CountryCode; + type AttemptId = S::AttemptId; type Access = Set; + type CreatedAt = S::CreatedAt; type Status = S::Status; - type AttemptId = S::AttemptId; + } + ///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 AttemptId = S::AttemptId; + type Access = S::Access; + 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 Access = S::Access; - type Status = Set; - type AttemptId = S::AttemptId; 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 CreatedAt = S::CreatedAt; + type AttemptId = S::AttemptId; type Access = S::Access; - type Status = S::Status; - type AttemptId = 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 CreatedAt = S::CreatedAt; - type Access = S::Access; - type Status = S::Status; - type AttemptId = S::AttemptId; - type CountryCode = Set; + 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 `country_code` field + pub struct country_code(()); + ///Marker type for the `attempt_id` field + pub struct attempt_id(()); ///Marker type for the `access` field pub struct access(()); + ///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(()); - ///Marker type for the `country_code` field - pub struct country_code(()); } } @@ -3038,11 +3038,11 @@ where impl<'a, S> EventBuilder<'a, S> where S: event_state::State, - S::CreatedAt: event_state::IsSet, + S::CountryCode: event_state::IsSet, + S::AttemptId: event_state::IsSet, S::Access: event_state::IsSet, + S::CreatedAt: event_state::IsSet, S::Status: event_state::IsSet, - S::AttemptId: event_state::IsSet, - S::CountryCode: event_state::IsSet, { /// Build the final struct pub fn build(self) -> Event<'a> { @@ -3333,37 +3333,37 @@ pub mod state_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Status; type Access; + type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Status = Unset; type Access = Unset; - } - ///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 Access = S::Access; + type Status = Unset; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { - type Status = S::Status; type Access = 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 Access = S::Access; + type Status = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `status` field - pub struct status(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `status` field + pub struct status(()); } } @@ -3456,8 +3456,8 @@ where impl<'a, S> StateBuilder<'a, S> where S: state_state::State, - S::Status: state_state::IsSet, S::Access: state_state::IsSet, + S::Status: state_state::IsSet, { /// Build the final struct pub fn build(self) -> State<'a> { diff --git a/crates/weaver-api/src/app_bsky/bookmark.rs b/crates/weaver-api/src/app_bsky/bookmark.rs index 300946d..ac81a96 100644 --- a/crates/weaver-api/src/app_bsky/bookmark.rs +++ b/crates/weaver-api/src/app_bsky/bookmark.rs @@ -281,37 +281,37 @@ pub mod bookmark_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Item; type Subject; + type Item; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Item = Unset; type Subject = Unset; - } - ///State transition - sets the `item` field to Set - pub struct SetItem(PhantomData S>); - impl sealed::Sealed for SetItem {} - impl State for SetItem { - type Item = Set; - type Subject = S::Subject; + type Item = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Item = S::Item; type Subject = Set; + type Item = S::Item; + } + ///State transition - sets the `item` field to Set + pub struct SetItem(PhantomData S>); + impl sealed::Sealed for SetItem {} + impl State for SetItem { + type Subject = S::Subject; + type Item = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `item` field - pub struct item(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `item` field + pub struct item(()); } } @@ -404,8 +404,8 @@ where impl<'a, S> BookmarkViewBuilder<'a, S> where S: bookmark_view_state::State, - S::Item: bookmark_view_state::IsSet, S::Subject: bookmark_view_state::IsSet, + S::Item: bookmark_view_state::IsSet, { /// Build the final struct pub fn build(self) -> BookmarkView<'a> { diff --git a/crates/weaver-api/src/app_bsky/bookmark/create_bookmark.rs b/crates/weaver-api/src/app_bsky/bookmark/create_bookmark.rs index f592179..6cdf6a4 100644 --- a/crates/weaver-api/src/app_bsky/bookmark/create_bookmark.rs +++ b/crates/weaver-api/src/app_bsky/bookmark/create_bookmark.rs @@ -33,37 +33,37 @@ pub mod create_bookmark_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> CreateBookmarkBuilder<'a, S> where S: create_bookmark_state::State, - S::Uri: create_bookmark_state::IsSet, S::Cid: create_bookmark_state::IsSet, + S::Uri: create_bookmark_state::IsSet, { /// Build the final struct pub fn build(self) -> CreateBookmark<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/external.rs b/crates/weaver-api/src/app_bsky/embed/external.rs index 76316dc..cc0be95 100644 --- a/crates/weaver-api/src/app_bsky/embed/external.rs +++ b/crates/weaver-api/src/app_bsky/embed/external.rs @@ -39,50 +39,50 @@ pub mod external_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Title; - type Description; type Uri; + type Description; } /// 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; } ///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 Description = S::Description; - type Uri = S::Uri; - } - ///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; + type Description = S::Description; } ///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 Description = S::Description; 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 Title = S::Title; + type Uri = S::Uri; + type Description = 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(()); } } @@ -196,8 +196,8 @@ impl<'a, S> ExternalBuilder<'a, S> where S: external_state::State, S::Title: external_state::IsSet, - S::Description: external_state::IsSet, S::Uri: external_state::IsSet, + S::Description: external_state::IsSet, { /// Build the final struct pub fn build(self) -> External<'a> { @@ -784,49 +784,49 @@ pub mod view_external_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; type Uri; + type Title; type Description; } /// 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 Title = Unset; type Description = 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 Description = S::Description; - } ///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; + 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; } ///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 Uri = S::Uri; + type Title = S::Title; type Description = 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(()); ///Marker type for the `description` field pub struct description(()); } @@ -941,8 +941,8 @@ 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::Title: view_external_state::IsSet, S::Description: view_external_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/embed/images.rs b/crates/weaver-api/src/app_bsky/embed/images.rs index b277b40..fc4af35 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 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(()); } } @@ -160,8 +160,8 @@ where 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> { @@ -760,51 +760,51 @@ pub mod view_image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Thumb; type Fullsize; type Alt; - type Thumb; } /// 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 Alt = Unset; - type Thumb = 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 Alt = S::Alt; - type Thumb = S::Thumb; } ///State transition - sets the `alt` field to Set pub struct SetAlt(PhantomData S>); impl sealed::Sealed for SetAlt {} impl State for SetAlt { - type Fullsize = S::Fullsize; - type Alt = Set; type Thumb = S::Thumb; - } - ///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 Alt = S::Alt; - type Thumb = Set; + 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 `alt` field pub struct alt(()); - ///Marker type for the `thumb` field - pub struct thumb(()); } } @@ -917,9 +917,9 @@ 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::Alt: view_image_state::IsSet, - S::Thumb: view_image_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewImage<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/record.rs b/crates/weaver-api/src/app_bsky/embed/record.rs index bfc1f7d..8a755aa 100644 --- a/crates/weaver-api/src/app_bsky/embed/record.rs +++ b/crates/weaver-api/src/app_bsky/embed/record.rs @@ -723,51 +723,51 @@ pub mod view_blocked_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Author; type Uri; type Blocked; - 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 Uri = Unset; type Blocked = Unset; - type Author = 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 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; - type Author = S::Author; } ///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; - } - ///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 Blocked = 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 `uri` field pub struct uri(()); ///Marker type for the `blocked` field pub struct blocked(()); - ///Marker type for the `author` field - pub struct author(()); } } @@ -860,9 +860,9 @@ where impl<'a, S> ViewBlockedBuilder<'a, S> where S: view_blocked_state::State, + S::Author: view_blocked_state::IsSet, S::Uri: view_blocked_state::IsSet, S::Blocked: view_blocked_state::IsSet, - S::Author: view_blocked_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewBlocked<'a> { @@ -934,37 +934,37 @@ pub mod view_detached_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Detached; type Uri; + type Detached; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Detached = Unset; 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 Detached = Set; - type Uri = S::Uri; + 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 Detached = S::Detached; type Uri = Set; + type Detached = S::Detached; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `detached` field - pub struct detached(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `detached` field + pub struct detached(()); } } @@ -1037,8 +1037,8 @@ where impl<'a, S> ViewDetachedBuilder<'a, S> where S: view_detached_state::State, - S::Detached: view_detached_state::IsSet, S::Uri: view_detached_state::IsSet, + S::Detached: view_detached_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewDetached<'a> { @@ -1108,37 +1108,37 @@ pub mod view_not_found_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type NotFound; type Uri; + 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 Uri = 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 Uri = S::Uri; + type NotFound = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type NotFound = S::NotFound; type Uri = 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 Uri = S::Uri; + 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 `uri` field pub struct uri(()); + ///Marker type for the `not_found` field + pub struct not_found(()); } } @@ -1211,8 +1211,8 @@ where impl<'a, S> ViewNotFoundBuilder<'a, S> where S: view_not_found_state::State, - S::NotFound: view_not_found_state::IsSet, S::Uri: view_not_found_state::IsSet, + S::NotFound: view_not_found_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewNotFound<'a> { @@ -1303,85 +1303,85 @@ pub mod view_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; + type Uri; type Author; - type Value; type IndexedAt; - type Uri; + type Cid; + type Value; } /// 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 Author = Unset; - type Value = Unset; type IndexedAt = Unset; - type Uri = Unset; + type Cid = Unset; + 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 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 Author = S::Author; - type Value = S::Value; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; + type Cid = S::Cid; + type Value = S::Value; } ///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 Uri = S::Uri; type Author = Set; - type Value = S::Value; type IndexedAt = S::IndexedAt; - 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 Cid = S::Cid; - type Author = S::Author; - type Value = Set; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; + type Value = S::Value; } ///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 Author = S::Author; - type Value = S::Value; 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; + type Value = S::Value; + } + ///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 Author = S::Author; + type IndexedAt = S::IndexedAt; + type Cid = 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 Author = S::Author; type IndexedAt = S::IndexedAt; - type Uri = Set; + type Cid = S::Cid; + type Value = 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 `author` field pub struct author(()); - ///Marker type for the `value` field - pub struct value(()); ///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 `value` field + pub struct value(()); } } @@ -1619,11 +1619,11 @@ where impl<'a, S> ViewRecordBuilder<'a, S> where S: view_record_state::State, - S::Cid: view_record_state::IsSet, + S::Uri: view_record_state::IsSet, S::Author: view_record_state::IsSet, - S::Value: view_record_state::IsSet, S::IndexedAt: view_record_state::IsSet, - S::Uri: view_record_state::IsSet, + S::Cid: view_record_state::IsSet, + S::Value: 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 c02886f..8e4fcac 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 @@ -322,37 +322,37 @@ pub mod view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; type Media; + 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 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 Record = Set; - type Media = S::Media; + 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 Record = S::Record; type Media = 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 Media = S::Media; + 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 `media` field pub struct media(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -425,8 +425,8 @@ where impl<'a, S> ViewBuilder<'a, S> where S: view_state::State, - S::Record: view_state::IsSet, S::Media: view_state::IsSet, + S::Record: view_state::IsSet, { /// Build the final struct pub fn build(self) -> View<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/video.rs b/crates/weaver-api/src/app_bsky/embed/video.rs index 4a3cf80..03e866e 100644 --- a/crates/weaver-api/src/app_bsky/embed/video.rs +++ b/crates/weaver-api/src/app_bsky/embed/video.rs @@ -687,37 +687,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(()); } } @@ -844,8 +844,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/app_bsky/feed.rs b/crates/weaver-api/src/app_bsky/feed.rs index ac604e2..a48c379 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 Author; type Blocked; type Uri; + 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 Blocked = Unset; type Uri = 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 Blocked = S::Blocked; - type Uri = S::Uri; + type Author = Unset; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData S>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { - type Author = S::Author; type Blocked = Set; type Uri = S::Uri; + 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 Blocked = S::Blocked; type Uri = Set; + 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 Blocked = S::Blocked; + type Uri = S::Uri; + 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 `blocked` field pub struct blocked(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `author` field + pub struct author(()); } } @@ -1746,9 +1746,9 @@ where impl<'a, S> BlockedPostBuilder<'a, S> where S: blocked_post_state::State, - S::Author: blocked_post_state::IsSet, S::Blocked: blocked_post_state::IsSet, S::Uri: blocked_post_state::IsSet, + S::Author: 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 Uri; + type Creator; + type DisplayName; type Cid; type Did; type IndexedAt; - type Creator; - type DisplayName; + 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 Creator = Unset; + type DisplayName = Unset; type Cid = Unset; type Did = Unset; type IndexedAt = Unset; - type Creator = Unset; - type DisplayName = 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 `creator` field to Set + pub struct SetCreator(PhantomData S>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type Creator = Set; + type DisplayName = S::DisplayName; type Cid = S::Cid; type Did = S::Did; type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + } + ///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 DisplayName = S::DisplayName; + type DisplayName = Set; + type Cid = S::Cid; + type Did = S::Did; + type IndexedAt = S::IndexedAt; + 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 Uri = S::Uri; + type Creator = S::Creator; + type DisplayName = S::DisplayName; type Cid = Set; type Did = S::Did; type IndexedAt = S::IndexedAt; - type Creator = S::Creator; - type DisplayName = S::DisplayName; + type Uri = S::Uri; } ///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 Creator = S::Creator; + type DisplayName = S::DisplayName; type Cid = S::Cid; type Did = Set; type IndexedAt = S::IndexedAt; - type Creator = S::Creator; - type DisplayName = S::DisplayName; + 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 Uri = S::Uri; - type Cid = S::Cid; - type Did = S::Did; - type IndexedAt = Set; type Creator = S::Creator; type DisplayName = S::DisplayName; - } - ///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 Did = S::Did; - type IndexedAt = S::IndexedAt; - type Creator = Set; - type DisplayName = S::DisplayName; - } - ///State transition - sets the `display_name` field to Set - pub struct SetDisplayName(PhantomData S>); - impl sealed::Sealed for SetDisplayName {} - impl State for SetDisplayName { + 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 Creator = S::Creator; + type DisplayName = S::DisplayName; type Cid = S::Cid; type Did = S::Did; type IndexedAt = S::IndexedAt; - type Creator = S::Creator; - type DisplayName = 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 `creator` field + pub struct creator(()); + ///Marker type for the `display_name` field + pub struct display_name(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `creator` field - pub struct creator(()); - ///Marker type for the `display_name` field - pub struct display_name(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -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::Uri: generator_view_state::IsSet, + S::Creator: generator_view_state::IsSet, + S::DisplayName: generator_view_state::IsSet, S::Cid: generator_view_state::IsSet, S::Did: generator_view_state::IsSet, S::IndexedAt: generator_view_state::IsSet, - S::Creator: generator_view_state::IsSet, - S::DisplayName: generator_view_state::IsSet, + S::Uri: generator_view_state::IsSet, { /// Build the final struct pub fn build(self) -> GeneratorView<'a> { @@ -3235,37 +3235,37 @@ pub mod not_found_post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type NotFound; type Uri; + 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 Uri = 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 Uri = S::Uri; + type NotFound = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type NotFound = S::NotFound; type Uri = 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 Uri = S::Uri; + 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 `uri` field pub struct uri(()); + ///Marker type for the `not_found` field + pub struct not_found(()); } } @@ -3338,8 +3338,8 @@ where impl<'a, S> NotFoundPostBuilder<'a, S> where S: not_found_post_state::State, - S::NotFound: not_found_post_state::IsSet, S::Uri: not_found_post_state::IsSet, + S::NotFound: not_found_post_state::IsSet, { /// Build the final struct pub fn build(self) -> NotFoundPost<'a> { @@ -3442,84 +3442,84 @@ pub mod post_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Record; - type Author; - type IndexedAt; type Cid; type Uri; + type Author; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Record = Unset; - type Author = Unset; - type IndexedAt = Unset; type Cid = Unset; type Uri = Unset; + type Author = Unset; + type IndexedAt = 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 Author = S::Author; - type IndexedAt = S::IndexedAt; type Cid = S::Cid; 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 Record = S::Record; - type Author = Set; - type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - 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 Author = S::Author; - type IndexedAt = 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 Author = S::Author; - type IndexedAt = S::IndexedAt; type Cid = Set; type Uri = S::Uri; + type Author = S::Author; + 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 Cid = S::Cid; + type Uri = Set; type Author = S::Author; 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 Record = S::Record; + type Cid = S::Cid; + type Uri = S::Uri; + type Author = 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; type Cid = S::Cid; - type Uri = Set; + type Uri = S::Uri; + type Author = S::Author; + type IndexedAt = 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 `author` field - pub struct author(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `cid` field pub struct cid(()); ///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(()); } } @@ -3833,10 +3833,10 @@ impl<'a, S> PostViewBuilder<'a, S> where S: post_view_state::State, S::Record: post_view_state::IsSet, - S::Author: post_view_state::IsSet, - S::IndexedAt: post_view_state::IsSet, S::Cid: post_view_state::IsSet, S::Uri: post_view_state::IsSet, + S::Author: post_view_state::IsSet, + S::IndexedAt: post_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PostView<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/generator.rs b/crates/weaver-api/src/app_bsky/feed/generator.rs index d8661a0..b8927e3 100644 --- a/crates/weaver-api/src/app_bsky/feed/generator.rs +++ b/crates/weaver-api/src/app_bsky/feed/generator.rs @@ -57,50 +57,50 @@ pub mod generator_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Did; - type CreatedAt; type DisplayName; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; - type CreatedAt = 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 CreatedAt = S::CreatedAt; - type DisplayName = S::DisplayName; - } - ///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 CreatedAt = Set; 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 Did = S::Did; - type CreatedAt = S::CreatedAt; type DisplayName = 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 DisplayName = S::DisplayName; + type CreatedAt = 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 `created_at` field - pub struct created_at(()); ///Marker type for the `display_name` field pub struct display_name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -318,8 +318,8 @@ impl<'a, S> GeneratorBuilder<'a, S> where S: generator_state::State, S::Did: generator_state::IsSet, - S::CreatedAt: generator_state::IsSet, S::DisplayName: generator_state::IsSet, + S::CreatedAt: 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 c7f7068..19b72bf 100644 --- a/crates/weaver-api/src/app_bsky/feed/get_likes.rs +++ b/crates/weaver-api/src/app_bsky/feed/get_likes.rs @@ -33,49 +33,49 @@ pub mod like_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type IndexedAt; type Actor; + type IndexedAt; 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 Actor = Unset; + type IndexedAt = 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 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 Actor = Set; + type IndexedAt = S::IndexedAt; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Actor = S::Actor; + type IndexedAt = 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 IndexedAt = S::IndexedAt; 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 `actor` field pub struct actor(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `created_at` field pub struct created_at(()); } @@ -170,8 +170,8 @@ where impl<'a, S> LikeBuilder<'a, S> where S: like_state::State, - S::IndexedAt: like_state::IsSet, S::Actor: like_state::IsSet, + S::IndexedAt: like_state::IsSet, S::CreatedAt: like_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/feed/like.rs b/crates/weaver-api/src/app_bsky/feed/like.rs index a326a4b..0f43928 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 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: like_state::State> LikeBuilder<'a, S> { impl<'a, S> LikeBuilder<'a, S> where S: like_state::State, - S::Subject: like_state::IsSet, S::CreatedAt: like_state::IsSet, + S::Subject: 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 da43f84..87de036 100644 --- a/crates/weaver-api/src/app_bsky/feed/post.rs +++ b/crates/weaver-api/src/app_bsky/feed/post.rs @@ -1271,37 +1271,37 @@ pub mod text_slice_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type End; type Start; + type End; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type End = Unset; type Start = Unset; - } - ///State transition - sets the `end` field to Set - pub struct SetEnd(PhantomData S>); - impl sealed::Sealed for SetEnd {} - impl State for SetEnd { - type End = Set; - type Start = S::Start; + type End = Unset; } ///State transition - sets the `start` field to Set pub struct SetStart(PhantomData S>); impl sealed::Sealed for SetStart {} impl State for SetStart { - type End = S::End; type Start = Set; + type End = S::End; + } + ///State transition - sets the `end` field to Set + pub struct SetEnd(PhantomData S>); + impl sealed::Sealed for SetEnd {} + impl State for SetEnd { + type Start = S::Start; + type End = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `end` field - pub struct end(()); ///Marker type for the `start` field pub struct start(()); + ///Marker type for the `end` field + pub struct end(()); } } @@ -1371,8 +1371,8 @@ where impl<'a, S> TextSliceBuilder<'a, S> where S: text_slice_state::State, - S::End: text_slice_state::IsSet, S::Start: text_slice_state::IsSet, + S::End: text_slice_state::IsSet, { /// Build the final struct pub fn build(self) -> TextSlice<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/postgate.rs b/crates/weaver-api/src/app_bsky/feed/postgate.rs index 3d1d3c7..8516296 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 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(()); } } @@ -367,8 +367,8 @@ where impl<'a, S> PostgateBuilder<'a, S> where S: postgate_state::State, - S::Post: postgate_state::IsSet, S::CreatedAt: postgate_state::IsSet, + S::Post: postgate_state::IsSet, { /// Build the final struct pub fn build(self) -> Postgate<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/threadgate.rs b/crates/weaver-api/src/app_bsky/feed/threadgate.rs index 1282b43..2bdeef9 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 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(()); } } @@ -603,8 +603,8 @@ where impl<'a, S> ThreadgateBuilder<'a, S> where S: threadgate_state::State, - S::CreatedAt: threadgate_state::IsSet, S::Post: threadgate_state::IsSet, + S::CreatedAt: 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 aba181f..16183c3 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> { @@ -1283,105 +1283,105 @@ pub mod list_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Uri; + type IndexedAt; + type Creator; + type Cid; type Purpose; type Name; - type Cid; - type Creator; - type IndexedAt; - 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 IndexedAt = Unset; + type Creator = Unset; + type Cid = Unset; type Purpose = Unset; type Name = Unset; - type Cid = Unset; - type Creator = Unset; - type IndexedAt = Unset; - type Uri = 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 Cid = S::Cid; - 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 IndexedAt = S::IndexedAt; - type Uri = S::Uri; - } - ///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 Cid = S::Cid; type Creator = S::Creator; - type IndexedAt = S::IndexedAt; - 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 Cid = S::Cid; type Purpose = S::Purpose; type Name = S::Name; - type Cid = Set; - type Creator = S::Creator; - 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 IndexedAt = Set; + type Creator = S::Creator; + type Cid = S::Cid; + type Purpose = S::Purpose; + type Name = S::Name; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { - type Purpose = S::Purpose; - type Name = S::Name; - type Cid = S::Cid; - type Creator = Set; - type IndexedAt = S::IndexedAt; 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 IndexedAt = S::IndexedAt; + type Creator = Set; + type Cid = S::Cid; type Purpose = S::Purpose; type Name = S::Name; - type Cid = S::Cid; - 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 { + ///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 Creator = S::Creator; + type Cid = Set; type Purpose = S::Purpose; type Name = S::Name; - type Cid = S::Cid; + } + ///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 IndexedAt = S::IndexedAt; type Creator = S::Creator; + type Cid = S::Cid; + type Purpose = 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 Uri = S::Uri; type IndexedAt = S::IndexedAt; - type Uri = Set; + type Creator = S::Creator; + type Cid = S::Cid; + type Purpose = S::Purpose; + type Name = 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 `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `cid` field + pub struct cid(()); ///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 `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(()); } } @@ -1661,12 +1661,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::IndexedAt: list_view_state::IsSet, + S::Creator: list_view_state::IsSet, + S::Cid: list_view_state::IsSet, S::Purpose: list_view_state::IsSet, S::Name: list_view_state::IsSet, - S::Cid: list_view_state::IsSet, - S::Creator: list_view_state::IsSet, - S::IndexedAt: list_view_state::IsSet, - S::Uri: list_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListView<'a> { @@ -1841,67 +1841,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 Uri; - type Cid; + type Purpose; } /// 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 Uri = Unset; - type Cid = Unset; + type Purpose = 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 Name = S::Name; + type Uri = S::Uri; + type Purpose = S::Purpose; } ///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 Purpose = S::Purpose; - type Uri = S::Uri; type Cid = S::Cid; - } - ///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 Name = Set; type Uri = S::Uri; - type Cid = S::Cid; + type Purpose = S::Purpose; } ///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 Uri = Set; - type Cid = S::Cid; + type Purpose = S::Purpose; } - ///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 `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 = S::Purpose; type Uri = S::Uri; - type Cid = Set; + type Purpose = 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 `uri` field pub struct uri(()); - ///Marker type for the `cid` field - pub struct cid(()); + ///Marker type for the `purpose` field + pub struct purpose(()); } } @@ -2118,10 +2118,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::Uri: list_view_basic_state::IsSet, - S::Cid: list_view_basic_state::IsSet, + S::Purpose: list_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> ListViewBasic<'a> { @@ -2298,37 +2298,37 @@ pub mod not_found_actor_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Actor; type NotFound; + 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 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 Actor = Set; - type NotFound = S::NotFound; + 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 Actor = S::Actor; type NotFound = 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 NotFound = S::NotFound; + 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 `not_found` field pub struct not_found(()); + ///Marker type for the `actor` field + pub struct actor(()); } } @@ -2401,8 +2401,8 @@ where impl<'a, S> NotFoundActorBuilder<'a, S> where S: not_found_actor_state::State, - S::Actor: not_found_actor_state::IsSet, S::NotFound: not_found_actor_state::IsSet, + S::Actor: not_found_actor_state::IsSet, { /// Build the final struct pub fn build(self) -> NotFoundActor<'a> { @@ -2706,84 +2706,84 @@ pub mod starter_pack_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Creator; - type Uri; - type Record; type IndexedAt; + type Uri; type Cid; + type Record; } /// 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 Record = Unset; type IndexedAt = Unset; + type Uri = Unset; type Cid = Unset; + type Record = 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 Record = S::Record; 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 Creator = S::Creator; - type Uri = Set; - type Record = S::Record; - type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Creator = S::Creator; type Uri = S::Uri; - type Record = Set; - type IndexedAt = S::IndexedAt; type Cid = S::Cid; + 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 Creator = S::Creator; + type IndexedAt = Set; type Uri = S::Uri; + type Cid = S::Cid; type Record = S::Record; - type IndexedAt = Set; + } + ///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 IndexedAt = S::IndexedAt; + type Uri = Set; 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 Creator = S::Creator; + type IndexedAt = S::IndexedAt; type Uri = S::Uri; + type Cid = 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 Creator = S::Creator; type IndexedAt = S::IndexedAt; - type Cid = Set; + type Uri = S::Uri; + type Cid = S::Cid; + type Record = 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 `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 `cid` field pub struct cid(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -3037,10 +3037,10 @@ impl<'a, S> StarterPackViewBuilder<'a, S> where S: starter_pack_view_state::State, S::Creator: starter_pack_view_state::IsSet, - S::Uri: starter_pack_view_state::IsSet, - S::Record: starter_pack_view_state::IsSet, S::IndexedAt: starter_pack_view_state::IsSet, + S::Uri: starter_pack_view_state::IsSet, S::Cid: starter_pack_view_state::IsSet, + S::Record: starter_pack_view_state::IsSet, { /// Build the final struct pub fn build(self) -> StarterPackView<'a> { @@ -3189,85 +3189,85 @@ pub mod starter_pack_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Creator; type IndexedAt; - type Uri; type Record; + 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 Creator = Unset; type IndexedAt = Unset; - type Uri = Unset; type Record = 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 Creator = S::Creator; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - type Record = S::Record; + type Uri = 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 Cid = S::Cid; type Creator = Set; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; type Record = S::Record; + 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 Creator = S::Creator; type IndexedAt = Set; - type Uri = S::Uri; type Record = S::Record; + type Uri = S::Uri; + type Cid = S::Cid; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Creator = S::Creator; + type IndexedAt = S::IndexedAt; + type Record = 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 Cid = S::Cid; type Creator = S::Creator; type IndexedAt = S::IndexedAt; - type Uri = 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 = 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 IndexedAt = S::IndexedAt; + type Record = S::Record; type Uri = S::Uri; - type Record = 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 `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 `record` field pub struct record(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -3478,11 +3478,11 @@ where impl<'a, S> StarterPackViewBasicBuilder<'a, S> where S: starter_pack_view_basic_state::State, - S::Cid: starter_pack_view_basic_state::IsSet, S::Creator: starter_pack_view_basic_state::IsSet, S::IndexedAt: starter_pack_view_basic_state::IsSet, - S::Uri: starter_pack_view_basic_state::IsSet, S::Record: starter_pack_view_basic_state::IsSet, + S::Uri: starter_pack_view_basic_state::IsSet, + S::Cid: 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/follow.rs b/crates/weaver-api/src/app_bsky/graph/follow.rs index 648570c..c145fac 100644 --- a/crates/weaver-api/src/app_bsky/graph/follow.rs +++ b/crates/weaver-api/src/app_bsky/graph/follow.rs @@ -36,37 +36,37 @@ pub mod follow_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: follow_state::State> FollowBuilder<'a, S> { impl<'a, S> FollowBuilder<'a, S> where S: follow_state::State, - S::Subject: follow_state::IsSet, S::CreatedAt: follow_state::IsSet, + S::Subject: follow_state::IsSet, { /// Build the final struct pub fn build(self) -> Follow<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/list.rs b/crates/weaver-api/src/app_bsky/graph/list.rs index 33d85fa..53f4a3a 100644 --- a/crates/weaver-api/src/app_bsky/graph/list.rs +++ b/crates/weaver-api/src/app_bsky/graph/list.rs @@ -51,51 +51,51 @@ pub mod list_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; - type CreatedAt; type Purpose; + 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 Purpose = 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 `purpose` field to Set + pub struct SetPurpose(PhantomData S>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type Purpose = Set; type CreatedAt = S::CreatedAt; - type Purpose = S::Purpose; + 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 Purpose = S::Purpose; - } - ///State transition - sets the `purpose` field to Set - pub struct SetPurpose(PhantomData S>); - impl sealed::Sealed for SetPurpose {} - impl State for SetPurpose { + 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 Purpose = S::Purpose; type CreatedAt = S::CreatedAt; - type Purpose = 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 `purpose` field pub struct purpose(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -268,9 +268,9 @@ where impl<'a, S> ListBuilder<'a, S> where S: list_state::State, - S::Name: list_state::IsSet, - S::CreatedAt: list_state::IsSet, S::Purpose: list_state::IsSet, + S::CreatedAt: list_state::IsSet, + S::Name: list_state::IsSet, { /// Build the final struct pub fn build(self) -> List<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/listitem.rs b/crates/weaver-api/src/app_bsky/graph/listitem.rs index 4deb4ad..b54c6f8 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 Subject; - type List; type CreatedAt; + type List; + 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 List = Unset; type CreatedAt = Unset; + type List = 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 List = S::List; - type CreatedAt = S::CreatedAt; + type Subject = S::Subject; } ///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 = 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 List = S::List; - 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 `list` field - pub struct list(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `list` field + pub struct list(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -174,9 +174,9 @@ where impl<'a, S> ListitemBuilder<'a, S> where S: listitem_state::State, - S::Subject: listitem_state::IsSet, - S::List: listitem_state::IsSet, S::CreatedAt: listitem_state::IsSet, + S::List: listitem_state::IsSet, + S::Subject: 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 c05964c..5052ac7 100644 --- a/crates/weaver-api/src/app_bsky/graph/starterpack.rs +++ b/crates/weaver-api/src/app_bsky/graph/starterpack.rs @@ -367,50 +367,50 @@ 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 List; } /// 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; + type List = 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; - } - ///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 List = S::List; } ///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 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 Name = S::Name; + type CreatedAt = S::CreatedAt; + type List = 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 `list` field + pub struct list(()); } } @@ -564,8 +564,8 @@ 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::List: 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 4987865..c6bf270 100644 --- a/crates/weaver-api/src/app_bsky/graph/verification.rs +++ b/crates/weaver-api/src/app_bsky/graph/verification.rs @@ -43,8 +43,8 @@ pub mod verification_state { pub trait State: sealed::Sealed { type Handle; type DisplayName; - type Subject; type CreatedAt; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -52,8 +52,8 @@ pub mod verification_state { impl State for Empty { type Handle = Unset; type DisplayName = Unset; - type Subject = Unset; type CreatedAt = Unset; + type Subject = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); @@ -61,8 +61,8 @@ pub mod verification_state { impl State for SetHandle { type Handle = Set; type DisplayName = S::DisplayName; - type Subject = S::Subject; type CreatedAt = S::CreatedAt; + type Subject = S::Subject; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); @@ -70,17 +70,8 @@ pub mod verification_state { impl State for SetDisplayName { type Handle = S::Handle; type DisplayName = 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 Handle = S::Handle; - type DisplayName = S::DisplayName; - type Subject = Set; type CreatedAt = S::CreatedAt; + type Subject = S::Subject; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); @@ -88,8 +79,17 @@ pub mod verification_state { impl State for SetCreatedAt { type Handle = S::Handle; type DisplayName = S::DisplayName; - 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 Handle = S::Handle; + type DisplayName = S::DisplayName; + type CreatedAt = S::CreatedAt; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -98,10 +98,10 @@ pub mod verification_state { 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 `created_at` field pub struct created_at(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -216,8 +216,8 @@ where S: verification_state::State, S::Handle: verification_state::IsSet, S::DisplayName: verification_state::IsSet, - S::Subject: verification_state::IsSet, S::CreatedAt: verification_state::IsSet, + S::Subject: verification_state::IsSet, { /// Build the final struct pub fn build(self) -> Verification<'a> { diff --git a/crates/weaver-api/src/app_bsky/labeler.rs b/crates/weaver-api/src/app_bsky/labeler.rs index f332dd2..11f00a4 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 IndexedAt; type Creator; type Uri; type Cid; - type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type IndexedAt = Unset; type Creator = Unset; type Uri = Unset; type Cid = Unset; - type IndexedAt = 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 Creator = S::Creator; + 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 IndexedAt = S::IndexedAt; type Creator = Set; type Uri = S::Uri; type Cid = S::Cid; - 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 IndexedAt = S::IndexedAt; type Creator = S::Creator; 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 Creator = S::Creator; - 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 Creator = S::Creator; type Uri = S::Uri; - type Cid = S::Cid; - type IndexedAt = Set; + 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 `creator` field pub struct creator(()); ///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(()); } } @@ -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::IndexedAt: labeler_view_state::IsSet, S::Creator: labeler_view_state::IsSet, S::Uri: labeler_view_state::IsSet, S::Cid: labeler_view_state::IsSet, - S::IndexedAt: labeler_view_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerView<'a> { @@ -988,8 +988,8 @@ pub mod labeler_view_detailed_state { type Uri; type Policies; type IndexedAt; - type Creator; type Cid; + type Creator; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -998,8 +998,8 @@ pub mod labeler_view_detailed_state { type Uri = Unset; type Policies = Unset; type IndexedAt = Unset; - type Creator = Unset; type Cid = Unset; + type Creator = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); @@ -1008,8 +1008,8 @@ pub mod labeler_view_detailed_state { type Uri = Set; type Policies = S::Policies; type IndexedAt = S::IndexedAt; - type Creator = S::Creator; type Cid = S::Cid; + type Creator = S::Creator; } ///State transition - sets the `policies` field to Set pub struct SetPolicies(PhantomData S>); @@ -1018,8 +1018,8 @@ pub mod labeler_view_detailed_state { type Uri = S::Uri; type Policies = Set; type IndexedAt = S::IndexedAt; - type Creator = S::Creator; type Cid = S::Cid; + type Creator = S::Creator; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); @@ -1028,18 +1028,8 @@ pub mod labeler_view_detailed_state { type Uri = S::Uri; type Policies = S::Policies; type IndexedAt = Set; - type Creator = S::Creator; - 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 Policies = S::Policies; - type IndexedAt = S::IndexedAt; - type Creator = Set; type Cid = S::Cid; + type Creator = S::Creator; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); @@ -1048,8 +1038,18 @@ pub mod labeler_view_detailed_state { type Uri = S::Uri; type Policies = S::Policies; type IndexedAt = S::IndexedAt; - type Creator = S::Creator; type Cid = Set; + 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 Policies = S::Policies; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type Creator = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -1060,10 +1060,10 @@ pub mod labeler_view_detailed_state { pub struct policies(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `creator` field - pub struct creator(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `creator` field + pub struct creator(()); } } @@ -1325,8 +1325,8 @@ where S::Uri: labeler_view_detailed_state::IsSet, S::Policies: labeler_view_detailed_state::IsSet, S::IndexedAt: labeler_view_detailed_state::IsSet, - S::Creator: labeler_view_detailed_state::IsSet, S::Cid: labeler_view_detailed_state::IsSet, + S::Creator: labeler_view_detailed_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerViewDetailed<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification.rs b/crates/weaver-api/src/app_bsky/notification.rs index 63f6c3f..d48aed4 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> { @@ -601,37 +601,37 @@ pub mod chat_preference_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Push; type Include; + 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 Include = 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 Include = S::Include; + type Push = Unset; } ///State transition - sets the `include` field to Set pub struct SetInclude(PhantomData S>); impl sealed::Sealed for SetInclude {} impl State for SetInclude { - type Push = S::Push; type Include = 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 Include = S::Include; + 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 `include` field pub struct include(()); + ///Marker type for the `push` field + pub struct push(()); } } @@ -704,8 +704,8 @@ where impl<'a, S> ChatPreferenceBuilder<'a, S> where S: chat_preference_state::State, - S::Push: chat_preference_state::IsSet, S::Include: chat_preference_state::IsSet, + S::Push: chat_preference_state::IsSet, { /// Build the final struct pub fn build(self) -> ChatPreference<'a> { @@ -1360,301 +1360,301 @@ pub mod preferences_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type SubscribedPost; + type StarterpackJoined; type RepostViaRepost; + type SubscribedPost; type Unverified; + type Follow; type Verified; - type Like; - type Repost; type Quote; + type Like; + type LikeViaRepost; + type Chat; type Mention; - type StarterpackJoined; - type Follow; type Reply; - type Chat; - type LikeViaRepost; + type Repost; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type SubscribedPost = Unset; + type StarterpackJoined = Unset; type RepostViaRepost = Unset; + type SubscribedPost = Unset; type Unverified = Unset; + type Follow = Unset; type Verified = Unset; - type Like = Unset; - type Repost = Unset; type Quote = Unset; + type Like = Unset; + type LikeViaRepost = Unset; + type Chat = Unset; type Mention = Unset; - type StarterpackJoined = Unset; - type Follow = Unset; type Reply = Unset; - type Chat = Unset; - type LikeViaRepost = Unset; + type Repost = Unset; } - ///State transition - sets the `subscribed_post` field to Set - pub struct SetSubscribedPost(PhantomData S>); - impl sealed::Sealed for SetSubscribedPost {} - impl State for SetSubscribedPost { - type SubscribedPost = Set; + ///State transition - sets the `starterpack_joined` field to Set + pub struct SetStarterpackJoined(PhantomData S>); + impl sealed::Sealed for SetStarterpackJoined {} + impl State for SetStarterpackJoined { + type StarterpackJoined = Set; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Follow = S::Follow; type Verified = S::Verified; - type Like = S::Like; - type Repost = S::Repost; type Quote = S::Quote; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Chat = S::Chat; type Mention = S::Mention; - type StarterpackJoined = S::StarterpackJoined; - type Follow = S::Follow; type Reply = S::Reply; - type Chat = S::Chat; - type LikeViaRepost = S::LikeViaRepost; + type Repost = S::Repost; } ///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 SubscribedPost = S::SubscribedPost; + type StarterpackJoined = S::StarterpackJoined; type RepostViaRepost = Set; + type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Follow = S::Follow; type Verified = S::Verified; - type Like = S::Like; - type Repost = S::Repost; type Quote = S::Quote; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Chat = S::Chat; type Mention = S::Mention; + type Reply = S::Reply; + type Repost = S::Repost; + } + ///State transition - sets the `subscribed_post` field to Set + pub struct SetSubscribedPost(PhantomData S>); + impl sealed::Sealed for SetSubscribedPost {} + impl State for SetSubscribedPost { type StarterpackJoined = S::StarterpackJoined; + type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = Set; + type Unverified = S::Unverified; type Follow = S::Follow; - type Reply = S::Reply; - type Chat = S::Chat; + type Verified = S::Verified; + type Quote = S::Quote; + type Like = S::Like; type LikeViaRepost = S::LikeViaRepost; + type Chat = S::Chat; + type Mention = S::Mention; + type Reply = S::Reply; + type Repost = S::Repost; } ///State transition - sets the `unverified` field to Set pub struct SetUnverified(PhantomData S>); impl sealed::Sealed for SetUnverified {} impl State for SetUnverified { - type SubscribedPost = S::SubscribedPost; + type StarterpackJoined = S::StarterpackJoined; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; type Unverified = Set; + type Follow = S::Follow; type Verified = S::Verified; + type Quote = S::Quote; type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Chat = S::Chat; + type Mention = S::Mention; + type Reply = S::Reply; type Repost = S::Repost; + } + ///State transition - sets the `follow` field to Set + pub struct SetFollow(PhantomData S>); + impl sealed::Sealed for SetFollow {} + impl State for SetFollow { + type StarterpackJoined = S::StarterpackJoined; + type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; + type Follow = Set; + type Verified = S::Verified; type Quote = S::Quote; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Chat = S::Chat; type Mention = S::Mention; - type StarterpackJoined = S::StarterpackJoined; - type Follow = S::Follow; type Reply = S::Reply; - type Chat = S::Chat; - type LikeViaRepost = S::LikeViaRepost; + type Repost = S::Repost; } ///State transition - sets the `verified` field to Set pub struct SetVerified(PhantomData S>); impl sealed::Sealed for SetVerified {} impl State for SetVerified { - type SubscribedPost = S::SubscribedPost; + type StarterpackJoined = S::StarterpackJoined; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Follow = S::Follow; type Verified = Set; - type Like = S::Like; - type Repost = S::Repost; type Quote = S::Quote; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Chat = S::Chat; type Mention = S::Mention; + type Reply = S::Reply; + type Repost = S::Repost; + } + ///State transition - sets the `quote` field to Set + pub struct SetQuote(PhantomData S>); + impl sealed::Sealed for SetQuote {} + impl State for SetQuote { type StarterpackJoined = S::StarterpackJoined; + type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type Unverified = S::Unverified; type Follow = S::Follow; - type Reply = S::Reply; - type Chat = S::Chat; + type Verified = S::Verified; + type Quote = Set; + type Like = S::Like; type LikeViaRepost = S::LikeViaRepost; + type Chat = S::Chat; + type Mention = S::Mention; + type Reply = S::Reply; + type Repost = S::Repost; } ///State transition - sets the `like` field to Set pub struct SetLike(PhantomData S>); impl sealed::Sealed for SetLike {} impl State for SetLike { - type SubscribedPost = S::SubscribedPost; + type StarterpackJoined = S::StarterpackJoined; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Follow = S::Follow; type Verified = S::Verified; - type Like = Set; - type Repost = S::Repost; type Quote = S::Quote; + type Like = Set; + type LikeViaRepost = S::LikeViaRepost; + type Chat = S::Chat; type Mention = S::Mention; - type StarterpackJoined = S::StarterpackJoined; - type Follow = S::Follow; type Reply = S::Reply; - type Chat = S::Chat; - type LikeViaRepost = S::LikeViaRepost; + type Repost = S::Repost; } - ///State transition - sets the `repost` field to Set - pub struct SetRepost(PhantomData S>); - impl sealed::Sealed for SetRepost {} - impl State for SetRepost { - type SubscribedPost = S::SubscribedPost; + ///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 StarterpackJoined = S::StarterpackJoined; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Follow = S::Follow; type Verified = S::Verified; - type Like = S::Like; - type Repost = Set; type Quote = S::Quote; + type Like = S::Like; + type LikeViaRepost = Set; + type Chat = S::Chat; type Mention = S::Mention; - type StarterpackJoined = S::StarterpackJoined; - type Follow = S::Follow; type Reply = S::Reply; - type Chat = S::Chat; - type LikeViaRepost = S::LikeViaRepost; + type Repost = S::Repost; } - ///State transition - sets the `quote` field to Set - pub struct SetQuote(PhantomData S>); - impl sealed::Sealed for SetQuote {} - impl State for SetQuote { - type SubscribedPost = S::SubscribedPost; + ///State transition - sets the `chat` field to Set + pub struct SetChat(PhantomData S>); + impl sealed::Sealed for SetChat {} + impl State for SetChat { + type StarterpackJoined = S::StarterpackJoined; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Follow = S::Follow; type Verified = S::Verified; + type Quote = S::Quote; type Like = S::Like; - type Repost = S::Repost; - type Quote = Set; + type LikeViaRepost = S::LikeViaRepost; + type Chat = Set; type Mention = S::Mention; - type StarterpackJoined = S::StarterpackJoined; - type Follow = S::Follow; type Reply = S::Reply; - type Chat = S::Chat; - type LikeViaRepost = S::LikeViaRepost; + type Repost = S::Repost; } ///State transition - sets the `mention` field to Set pub struct SetMention(PhantomData S>); impl sealed::Sealed for SetMention {} impl State for SetMention { - type SubscribedPost = S::SubscribedPost; - type RepostViaRepost = S::RepostViaRepost; - type Unverified = S::Unverified; - type Verified = S::Verified; - type Like = S::Like; - type Repost = S::Repost; - type Quote = S::Quote; - type Mention = Set; type StarterpackJoined = S::StarterpackJoined; - type Follow = S::Follow; - type Reply = S::Reply; - type Chat = S::Chat; - type LikeViaRepost = S::LikeViaRepost; - } - ///State transition - sets the `starterpack_joined` field to Set - pub struct SetStarterpackJoined(PhantomData S>); - impl sealed::Sealed for SetStarterpackJoined {} - impl State for SetStarterpackJoined { - type SubscribedPost = S::SubscribedPost; type RepostViaRepost = S::RepostViaRepost; - type Unverified = S::Unverified; - type Verified = S::Verified; - type Like = S::Like; - type Repost = S::Repost; - type Quote = S::Quote; - type Mention = S::Mention; - type StarterpackJoined = Set; - type Follow = S::Follow; - type Reply = S::Reply; - type Chat = S::Chat; - type LikeViaRepost = S::LikeViaRepost; - } - ///State transition - sets the `follow` field to Set - pub struct SetFollow(PhantomData S>); - impl sealed::Sealed for SetFollow {} - impl State for SetFollow { type SubscribedPost = S::SubscribedPost; - type RepostViaRepost = S::RepostViaRepost; type Unverified = S::Unverified; + type Follow = S::Follow; type Verified = S::Verified; - type Like = S::Like; - type Repost = S::Repost; type Quote = S::Quote; - type Mention = S::Mention; - type StarterpackJoined = S::StarterpackJoined; - type Follow = Set; - type Reply = S::Reply; - type Chat = S::Chat; + type Like = S::Like; type LikeViaRepost = S::LikeViaRepost; + type Chat = S::Chat; + type Mention = Set; + type Reply = S::Reply; + type Repost = S::Repost; } ///State transition - sets the `reply` field to Set pub struct SetReply(PhantomData S>); impl sealed::Sealed for SetReply {} impl State for SetReply { - type SubscribedPost = S::SubscribedPost; + type StarterpackJoined = S::StarterpackJoined; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Follow = S::Follow; type Verified = S::Verified; - type Like = S::Like; - type Repost = S::Repost; type Quote = S::Quote; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Chat = S::Chat; type Mention = S::Mention; - type StarterpackJoined = S::StarterpackJoined; - type Follow = S::Follow; type Reply = Set; - type Chat = S::Chat; - type LikeViaRepost = S::LikeViaRepost; - } - ///State transition - sets the `chat` field to Set - pub struct SetChat(PhantomData S>); - impl sealed::Sealed for SetChat {} - impl State for SetChat { - type SubscribedPost = S::SubscribedPost; - type RepostViaRepost = S::RepostViaRepost; - type Unverified = S::Unverified; - type Verified = S::Verified; - type Like = S::Like; type Repost = S::Repost; - type Quote = S::Quote; - type Mention = S::Mention; - type StarterpackJoined = S::StarterpackJoined; - type Follow = S::Follow; - type Reply = S::Reply; - type Chat = Set; - type LikeViaRepost = S::LikeViaRepost; } - ///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 SubscribedPost = S::SubscribedPost; + ///State transition - sets the `repost` field to Set + pub struct SetRepost(PhantomData S>); + impl sealed::Sealed for SetRepost {} + impl State for SetRepost { + type StarterpackJoined = S::StarterpackJoined; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; type Unverified = S::Unverified; + type Follow = S::Follow; type Verified = S::Verified; - type Like = S::Like; - type Repost = S::Repost; type Quote = S::Quote; + type Like = S::Like; + type LikeViaRepost = S::LikeViaRepost; + type Chat = S::Chat; type Mention = S::Mention; - type StarterpackJoined = S::StarterpackJoined; - type Follow = S::Follow; type Reply = S::Reply; - type Chat = S::Chat; - type LikeViaRepost = Set; + type Repost = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subscribed_post` field - pub struct subscribed_post(()); + ///Marker type for the `starterpack_joined` field + pub struct starterpack_joined(()); ///Marker type for the `repost_via_repost` field pub struct repost_via_repost(()); + ///Marker type for the `subscribed_post` field + pub struct subscribed_post(()); ///Marker type for the `unverified` field pub struct unverified(()); + ///Marker type for the `follow` field + pub struct follow(()); ///Marker type for the `verified` field pub struct verified(()); - ///Marker type for the `like` field - pub struct like(()); - ///Marker type for the `repost` field - pub struct repost(()); ///Marker type for the `quote` field pub struct quote(()); + ///Marker type for the `like` field + pub struct like(()); + ///Marker type for the `like_via_repost` field + pub struct like_via_repost(()); + ///Marker type for the `chat` field + pub struct chat(()); ///Marker type for the `mention` field pub struct mention(()); - ///Marker type for the `starterpack_joined` field - pub struct starterpack_joined(()); - ///Marker type for the `follow` field - pub struct follow(()); ///Marker type for the `reply` field pub struct reply(()); - ///Marker type for the `chat` field - pub struct chat(()); - ///Marker type for the `like_via_repost` field - pub struct like_via_repost(()); + ///Marker type for the `repost` field + pub struct repost(()); } } @@ -1961,19 +1961,19 @@ where impl<'a, S> PreferencesBuilder<'a, S> where S: preferences_state::State, - S::SubscribedPost: preferences_state::IsSet, + S::StarterpackJoined: preferences_state::IsSet, S::RepostViaRepost: preferences_state::IsSet, + S::SubscribedPost: preferences_state::IsSet, S::Unverified: preferences_state::IsSet, + S::Follow: preferences_state::IsSet, S::Verified: preferences_state::IsSet, - S::Like: preferences_state::IsSet, - S::Repost: preferences_state::IsSet, S::Quote: preferences_state::IsSet, + S::Like: preferences_state::IsSet, + S::LikeViaRepost: preferences_state::IsSet, + S::Chat: preferences_state::IsSet, S::Mention: preferences_state::IsSet, - S::StarterpackJoined: preferences_state::IsSet, - S::Follow: preferences_state::IsSet, S::Reply: preferences_state::IsSet, - S::Chat: preferences_state::IsSet, - S::LikeViaRepost: preferences_state::IsSet, + S::Repost: preferences_state::IsSet, { /// Build the final struct pub fn build(self) -> Preferences<'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 f2dd158..d4e8e94 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 Cid; - type Author; - type Record; - type IsRead; type Reason; - type Uri; + type IsRead; + type Author; type IndexedAt; + type Uri; + type Cid; + type Record; } /// 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 Record = Unset; - type IsRead = Unset; type Reason = Unset; - type Uri = Unset; + type IsRead = Unset; + type Author = Unset; type IndexedAt = Unset; + type Uri = Unset; + type Cid = Unset; + type Record = 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 `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Reason = Set; + type IsRead = S::IsRead; type Author = S::Author; + type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Cid = S::Cid; type Record = S::Record; - type IsRead = S::IsRead; + } + ///State transition - sets the `is_read` field to Set + pub struct SetIsRead(PhantomData S>); + impl sealed::Sealed for SetIsRead {} + impl State for SetIsRead { type Reason = S::Reason; - type Uri = S::Uri; + type IsRead = Set; + type Author = S::Author; type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Cid = S::Cid; + 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 Cid = S::Cid; - type Author = Set; - type Record = S::Record; - type IsRead = S::IsRead; type Reason = S::Reason; - type Uri = S::Uri; - 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 Cid = S::Cid; - type Author = S::Author; - type Record = Set; type IsRead = S::IsRead; - type Reason = S::Reason; - type Uri = S::Uri; + type Author = Set; 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 Uri = S::Uri; type Cid = S::Cid; - type Author = S::Author; type Record = S::Record; - type IsRead = 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 Reason = S::Reason; + type IsRead = S::IsRead; + type Author = S::Author; + type IndexedAt = Set; type Uri = S::Uri; - 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 Author = S::Author; type Record = S::Record; - type IsRead = S::IsRead; - type Reason = Set; - type Uri = S::Uri; - 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 Author = S::Author; - type Record = S::Record; - type IsRead = S::IsRead; type Reason = S::Reason; - type Uri = Set; + type IsRead = S::IsRead; + type Author = S::Author; 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 = Set; type Cid = S::Cid; - type Author = S::Author; 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 Reason = S::Reason; type IsRead = S::IsRead; + type Author = S::Author; + type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Cid = 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 Reason = S::Reason; + type IsRead = S::IsRead; + type Author = S::Author; + type IndexedAt = S::IndexedAt; type Uri = S::Uri; - type IndexedAt = Set; + type Cid = S::Cid; + type Record = 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 `record` field - pub struct record(()); - ///Marker type for the `is_read` field - pub struct is_read(()); ///Marker type for the `reason` field pub struct reason(()); - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `is_read` field + pub struct is_read(()); + ///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(()); + ///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::Cid: notification_state::IsSet, - S::Author: notification_state::IsSet, - S::Record: notification_state::IsSet, - S::IsRead: notification_state::IsSet, S::Reason: notification_state::IsSet, - S::Uri: notification_state::IsSet, + S::IsRead: notification_state::IsSet, + S::Author: notification_state::IsSet, S::IndexedAt: notification_state::IsSet, + S::Uri: notification_state::IsSet, + S::Cid: 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/register_push.rs b/crates/weaver-api/src/app_bsky/notification/register_push.rs index 476058c..a99bb8f 100644 --- a/crates/weaver-api/src/app_bsky/notification/register_push.rs +++ b/crates/weaver-api/src/app_bsky/notification/register_push.rs @@ -40,67 +40,67 @@ pub mod register_push_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Platform; - type AppId; type ServiceDid; type Token; + type Platform; + type AppId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Platform = Unset; - type AppId = Unset; type ServiceDid = Unset; type Token = Unset; - } - ///State transition - sets the `platform` field to Set - pub struct SetPlatform(PhantomData S>); - impl sealed::Sealed for SetPlatform {} - impl State for SetPlatform { - type Platform = Set; - type AppId = S::AppId; - type ServiceDid = S::ServiceDid; - type Token = S::Token; - } - ///State transition - sets the `app_id` field to Set - pub struct SetAppId(PhantomData S>); - impl sealed::Sealed for SetAppId {} - impl State for SetAppId { - type Platform = S::Platform; - type AppId = Set; - type ServiceDid = S::ServiceDid; - type Token = S::Token; + type Platform = Unset; + type AppId = 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 Platform = S::Platform; - type AppId = S::AppId; type ServiceDid = Set; type Token = S::Token; + type Platform = S::Platform; + type AppId = S::AppId; } ///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 Platform = S::Platform; type AppId = S::AppId; + } + ///State transition - sets the `platform` field to Set + pub struct SetPlatform(PhantomData S>); + impl sealed::Sealed for SetPlatform {} + impl State for SetPlatform { type ServiceDid = S::ServiceDid; - type Token = Set; + type Token = S::Token; + type Platform = Set; + type AppId = S::AppId; + } + ///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 Platform = S::Platform; + type AppId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `platform` field - pub struct platform(()); - ///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 `token` field pub struct token(()); + ///Marker type for the `platform` field + pub struct platform(()); + ///Marker type for the `app_id` field + pub struct app_id(()); } } @@ -227,10 +227,10 @@ where impl<'a, S> RegisterPushBuilder<'a, S> where S: register_push_state::State, - S::Platform: register_push_state::IsSet, - S::AppId: register_push_state::IsSet, S::ServiceDid: register_push_state::IsSet, S::Token: register_push_state::IsSet, + S::Platform: register_push_state::IsSet, + S::AppId: register_push_state::IsSet, { /// Build the final struct pub fn build(self) -> RegisterPush<'a> { 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 d7ccc38..231cd0a 100644 --- a/crates/weaver-api/src/app_bsky/notification/unregister_push.rs +++ b/crates/weaver-api/src/app_bsky/notification/unregister_push.rs @@ -38,66 +38,66 @@ pub mod unregister_push_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type AppId; - type ServiceDid; - type Token; type Platform; + type Token; + type ServiceDid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type AppId = Unset; - type ServiceDid = Unset; - type Token = Unset; type Platform = Unset; + type Token = Unset; + type ServiceDid = 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; + type Token = S::Token; + type ServiceDid = S::ServiceDid; } - ///State transition - sets the `service_did` field to Set - pub struct SetServiceDid(PhantomData S>); - impl sealed::Sealed for SetServiceDid {} - impl State for SetServiceDid { + ///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 ServiceDid = Set; + type Platform = Set; type Token = S::Token; - type Platform = S::Platform; + type ServiceDid = S::ServiceDid; } ///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 ServiceDid = S::ServiceDid; - type Token = Set; type Platform = S::Platform; + type Token = Set; + type ServiceDid = S::ServiceDid; } - ///State transition - sets the `platform` field to Set - pub struct SetPlatform(PhantomData S>); - impl sealed::Sealed for SetPlatform {} - impl State for SetPlatform { + ///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 = S::ServiceDid; + type Platform = S::Platform; type Token = S::Token; - type Platform = Set; + type ServiceDid = 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 `token` field - pub struct token(()); ///Marker type for the `platform` field pub struct platform(()); + ///Marker type for the `token` field + pub struct token(()); + ///Marker type for the `service_did` field + pub struct service_did(()); } } @@ -211,9 +211,9 @@ impl<'a, S> UnregisterPushBuilder<'a, S> where S: unregister_push_state::State, S::AppId: unregister_push_state::IsSet, - S::ServiceDid: unregister_push_state::IsSet, - S::Token: unregister_push_state::IsSet, S::Platform: unregister_push_state::IsSet, + S::Token: unregister_push_state::IsSet, + S::ServiceDid: unregister_push_state::IsSet, { /// Build the final struct pub fn build(self) -> UnregisterPush<'a> { diff --git a/crates/weaver-api/src/app_bsky/unspecced.rs b/crates/weaver-api/src/app_bsky/unspecced.rs index b027f98..19a50bf 100644 --- a/crates/weaver-api/src/app_bsky/unspecced.rs +++ b/crates/weaver-api/src/app_bsky/unspecced.rs @@ -81,51 +81,51 @@ pub mod age_assurance_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Status; type CreatedAt; type AttemptId; + type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Status = Unset; type CreatedAt = Unset; type AttemptId = Unset; - } - ///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 CreatedAt = S::CreatedAt; - type AttemptId = S::AttemptId; + 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 Status = S::Status; 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 Status = S::Status; type CreatedAt = S::CreatedAt; type AttemptId = 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 Status = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `status` field - pub struct status(()); ///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 `status` field + pub struct status(()); } } @@ -309,9 +309,9 @@ where impl<'a, S> AgeAssuranceEventBuilder<'a, S> where S: age_assurance_event_state::State, - S::Status: age_assurance_event_state::IsSet, S::CreatedAt: age_assurance_event_state::IsSet, S::AttemptId: age_assurance_event_state::IsSet, + S::Status: age_assurance_event_state::IsSet, { /// Build the final struct pub fn build(self) -> AgeAssuranceEvent<'a> { @@ -1940,105 +1940,105 @@ pub mod skeleton_trend_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Dids; - type Link; type Topic; type StartedAt; type PostCount; + type Dids; type DisplayName; + type Link; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Dids = Unset; - type Link = Unset; type Topic = Unset; type StartedAt = Unset; type PostCount = Unset; + type Dids = Unset; type DisplayName = Unset; - } - ///State transition - sets the `dids` field to Set - pub struct SetDids(PhantomData S>); - impl sealed::Sealed for SetDids {} - impl State for SetDids { - type Dids = Set; - type Link = S::Link; - type Topic = S::Topic; - type StartedAt = S::StartedAt; - type PostCount = S::PostCount; - type DisplayName = S::DisplayName; - } - ///State transition - sets the `link` field to Set - pub struct SetLink(PhantomData S>); - impl sealed::Sealed for SetLink {} - impl State for SetLink { - type Dids = S::Dids; - type Link = Set; - type Topic = S::Topic; - type StartedAt = S::StartedAt; - type PostCount = S::PostCount; - type DisplayName = S::DisplayName; + type Link = Unset; } ///State transition - sets the `topic` field to Set pub struct SetTopic(PhantomData S>); impl sealed::Sealed for SetTopic {} impl State for SetTopic { - type Dids = S::Dids; - type Link = S::Link; type Topic = Set; type StartedAt = S::StartedAt; type PostCount = S::PostCount; + type Dids = S::Dids; type DisplayName = S::DisplayName; + type Link = S::Link; } ///State transition - sets the `started_at` field to Set pub struct SetStartedAt(PhantomData S>); impl sealed::Sealed for SetStartedAt {} impl State for SetStartedAt { - type Dids = S::Dids; - type Link = S::Link; type Topic = S::Topic; type StartedAt = Set; type PostCount = S::PostCount; + type Dids = S::Dids; type DisplayName = S::DisplayName; + type Link = S::Link; } ///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 StartedAt = S::StartedAt; + type PostCount = Set; type Dids = S::Dids; + type DisplayName = S::DisplayName; type Link = S::Link; + } + ///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 StartedAt = S::StartedAt; - type PostCount = Set; + type PostCount = S::PostCount; + type Dids = Set; type DisplayName = S::DisplayName; + type Link = S::Link; } ///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; + type StartedAt = S::StartedAt; + type PostCount = S::PostCount; type Dids = S::Dids; + type DisplayName = Set; type Link = S::Link; + } + ///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 StartedAt = S::StartedAt; type PostCount = S::PostCount; - type DisplayName = Set; + type Dids = S::Dids; + type DisplayName = S::DisplayName; + type Link = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `dids` field - pub struct dids(()); - ///Marker type for the `link` field - pub struct link(()); ///Marker type for the `topic` field pub struct topic(()); ///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 `dids` field + pub struct dids(()); ///Marker type for the `display_name` field pub struct display_name(()); + ///Marker type for the `link` field + pub struct link(()); } } @@ -2222,12 +2222,12 @@ where impl<'a, S> SkeletonTrendBuilder<'a, S> where S: skeleton_trend_state::State, - S::Dids: skeleton_trend_state::IsSet, - S::Link: skeleton_trend_state::IsSet, S::Topic: skeleton_trend_state::IsSet, S::StartedAt: skeleton_trend_state::IsSet, S::PostCount: skeleton_trend_state::IsSet, + S::Dids: skeleton_trend_state::IsSet, S::DisplayName: skeleton_trend_state::IsSet, + S::Link: skeleton_trend_state::IsSet, { /// Build the final struct pub fn build(self) -> SkeletonTrend<'a> { @@ -2599,105 +2599,105 @@ pub mod thread_item_post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type MutedByViewer; - type MoreParents; - type MoreReplies; - type OpThread; type Post; + type MoreReplies; type HiddenByThreadgate; + type OpThread; + type MutedByViewer; + type MoreParents; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type MutedByViewer = Unset; - type MoreParents = Unset; - type MoreReplies = Unset; - type OpThread = Unset; type Post = Unset; + type MoreReplies = Unset; type HiddenByThreadgate = Unset; + type OpThread = Unset; + type MutedByViewer = Unset; + type MoreParents = Unset; } - ///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 MutedByViewer = Set; - type MoreParents = S::MoreParents; + ///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 MoreReplies = S::MoreReplies; - type OpThread = S::OpThread; - type Post = S::Post; type HiddenByThreadgate = S::HiddenByThreadgate; - } - ///State transition - sets the `more_parents` field to Set - pub struct SetMoreParents(PhantomData S>); - impl sealed::Sealed for SetMoreParents {} - impl State for SetMoreParents { - type MutedByViewer = S::MutedByViewer; - type MoreParents = Set; - type MoreReplies = S::MoreReplies; type OpThread = S::OpThread; - type Post = S::Post; - type HiddenByThreadgate = S::HiddenByThreadgate; + type MutedByViewer = S::MutedByViewer; + 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 MutedByViewer = S::MutedByViewer; - type MoreParents = S::MoreParents; + type Post = S::Post; type MoreReplies = Set; + type HiddenByThreadgate = S::HiddenByThreadgate; type OpThread = S::OpThread; + type MutedByViewer = S::MutedByViewer; + 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 HiddenByThreadgate = S::HiddenByThreadgate; + type MoreReplies = S::MoreReplies; + type HiddenByThreadgate = Set; + type OpThread = S::OpThread; + type MutedByViewer = S::MutedByViewer; + type MoreParents = S::MoreParents; } ///State transition - sets the `op_thread` field to Set pub struct SetOpThread(PhantomData S>); impl sealed::Sealed for SetOpThread {} impl State for SetOpThread { - type MutedByViewer = S::MutedByViewer; - type MoreParents = S::MoreParents; - type MoreReplies = S::MoreReplies; - type OpThread = Set; type Post = S::Post; + type MoreReplies = S::MoreReplies; type HiddenByThreadgate = S::HiddenByThreadgate; - } - ///State transition - sets the `post` field to Set - pub struct SetPost(PhantomData S>); - impl sealed::Sealed for SetPost {} - impl State for SetPost { + type OpThread = Set; type MutedByViewer = S::MutedByViewer; 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 MoreReplies = S::MoreReplies; - type OpThread = S::OpThread; - type Post = Set; type HiddenByThreadgate = S::HiddenByThreadgate; - } - ///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 MutedByViewer = S::MutedByViewer; + type OpThread = S::OpThread; + type MutedByViewer = 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 Post = S::Post; type MoreReplies = S::MoreReplies; + type HiddenByThreadgate = S::HiddenByThreadgate; type OpThread = S::OpThread; - type Post = S::Post; - type HiddenByThreadgate = Set; + type MutedByViewer = S::MutedByViewer; + type MoreParents = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `muted_by_viewer` field - pub struct muted_by_viewer(()); - ///Marker type for the `more_parents` field - pub struct more_parents(()); - ///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 `post` field pub struct post(()); + ///Marker type for the `more_replies` field + pub struct more_replies(()); ///Marker type for the `hidden_by_threadgate` field pub struct hidden_by_threadgate(()); + ///Marker type for the `op_thread` field + pub struct op_thread(()); + ///Marker type for the `muted_by_viewer` field + pub struct muted_by_viewer(()); + ///Marker type for the `more_parents` field + pub struct more_parents(()); } } @@ -2850,12 +2850,12 @@ where impl<'a, S> ThreadItemPostBuilder<'a, S> where S: thread_item_post_state::State, - S::MutedByViewer: thread_item_post_state::IsSet, - S::MoreParents: thread_item_post_state::IsSet, - S::MoreReplies: thread_item_post_state::IsSet, - S::OpThread: thread_item_post_state::IsSet, S::Post: thread_item_post_state::IsSet, + S::MoreReplies: thread_item_post_state::IsSet, S::HiddenByThreadgate: thread_item_post_state::IsSet, + S::OpThread: thread_item_post_state::IsSet, + S::MutedByViewer: thread_item_post_state::IsSet, + S::MoreParents: thread_item_post_state::IsSet, { /// Build the final struct pub fn build(self) -> ThreadItemPost<'a> { @@ -2946,105 +2946,105 @@ pub mod trend_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Topic; - type Actors; - type StartedAt; type PostCount; - type Link; type DisplayName; + type StartedAt; + type Topic; + type Link; + type Actors; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Topic = Unset; - type Actors = Unset; - type StartedAt = Unset; type PostCount = Unset; - type Link = Unset; type DisplayName = Unset; + type StartedAt = Unset; + type Topic = Unset; + type Link = Unset; + type Actors = 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 Actors = S::Actors; + ///State transition - sets the `post_count` field to Set + pub struct SetPostCount(PhantomData S>); + impl sealed::Sealed for SetPostCount {} + impl State for SetPostCount { + type PostCount = Set; + type DisplayName = S::DisplayName; type StartedAt = S::StartedAt; - type PostCount = S::PostCount; + type Topic = S::Topic; type Link = S::Link; - type DisplayName = S::DisplayName; + 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 Topic = S::Topic; - type Actors = Set; - 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 PostCount = S::PostCount; + type DisplayName = Set; + type StartedAt = S::StartedAt; + type Topic = S::Topic; type Link = S::Link; - type DisplayName = S::DisplayName; + type Actors = S::Actors; } ///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; - type Actors = S::Actors; - type StartedAt = Set; type PostCount = S::PostCount; - type Link = S::Link; type DisplayName = S::DisplayName; - } - ///State transition - sets the `post_count` field to Set - pub struct SetPostCount(PhantomData S>); - impl sealed::Sealed for SetPostCount {} - impl State for SetPostCount { + type StartedAt = Set; type Topic = S::Topic; + type Link = S::Link; 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 PostCount = S::PostCount; + type DisplayName = S::DisplayName; type StartedAt = S::StartedAt; - type PostCount = Set; + type Topic = Set; type Link = S::Link; - type DisplayName = S::DisplayName; + type Actors = S::Actors; } ///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 Actors = S::Actors; - type StartedAt = S::StartedAt; type PostCount = S::PostCount; - type Link = Set; type DisplayName = S::DisplayName; - } - ///State transition - sets the `display_name` field to Set - pub struct SetDisplayName(PhantomData S>); - impl sealed::Sealed for SetDisplayName {} - impl State for SetDisplayName { + type StartedAt = S::StartedAt; type Topic = S::Topic; + type Link = Set; type Actors = S::Actors; - type StartedAt = S::StartedAt; + } + ///State transition - sets the `actors` field to Set + pub struct SetActors(PhantomData S>); + impl sealed::Sealed for SetActors {} + impl State for SetActors { type PostCount = S::PostCount; + type DisplayName = S::DisplayName; + type StartedAt = S::StartedAt; + type Topic = S::Topic; type Link = S::Link; - type DisplayName = Set; + type Actors = 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 `actors` field - pub struct actors(()); - ///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 `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 `topic` field + pub struct topic(()); + ///Marker type for the `link` field + pub struct link(()); + ///Marker type for the `actors` field + pub struct actors(()); } } @@ -3228,12 +3228,12 @@ where impl<'a, S> TrendViewBuilder<'a, S> where S: trend_view_state::State, - S::Topic: trend_view_state::IsSet, - S::Actors: trend_view_state::IsSet, - S::StartedAt: trend_view_state::IsSet, S::PostCount: trend_view_state::IsSet, - S::Link: trend_view_state::IsSet, S::DisplayName: trend_view_state::IsSet, + S::StartedAt: trend_view_state::IsSet, + S::Topic: trend_view_state::IsSet, + S::Link: trend_view_state::IsSet, + S::Actors: 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_config.rs b/crates/weaver-api/src/app_bsky/unspecced/get_config.rs index 1cb09d3..d932f1b 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_config.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_config.rs @@ -33,37 +33,37 @@ pub mod live_now_config_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Domains; + 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 Domains = 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 Domains = S::Domains; + type Did = Unset; } ///State transition - sets the `domains` field to Set pub struct SetDomains(PhantomData S>); impl sealed::Sealed for SetDomains {} impl State for SetDomains { - type Did = S::Did; type Domains = 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 Domains = S::Domains; + 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 `domains` field pub struct domains(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> LiveNowConfigBuilder<'a, S> where S: live_now_config_state::State, - S::Did: live_now_config_state::IsSet, S::Domains: live_now_config_state::IsSet, + S::Did: live_now_config_state::IsSet, { /// Build the final struct pub fn build(self) -> LiveNowConfig<'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 23c1266..95c8e55 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 @@ -189,51 +189,51 @@ pub mod thread_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Depth; - type Value; 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 Value = Unset; type Uri = Unset; + type Value = Unset; + type Depth = 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; + ///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 Uri = S::Uri; + 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 Value = 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 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 Uri = Set; + 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 `value` field - pub struct value(()); ///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(()); } } @@ -326,9 +326,9 @@ where impl<'a, S> ThreadItemBuilder<'a, S> where S: thread_item_state::State, - S::Depth: thread_item_state::IsSet, - S::Value: 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/unspecced/get_post_thread_v2.rs b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs index d30616d..254db21 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 Uri; + 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; + type Uri = Unset; + type Depth = 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; + ///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 Uri = S::Uri; - type Value = S::Value; + type Depth = S::Depth; } ///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; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { + type Uri = 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 Value = S::Value; type Uri = S::Uri; - type Value = Set; + 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 `uri` field + pub struct uri(()); + ///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::Uri: 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/unspecced/get_tagged_suggestions.rs b/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs index 3092de2..45793aa 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs @@ -91,50 +91,50 @@ pub mod suggestion_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type SubjectType; - type Tag; type Subject; + type Tag; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type SubjectType = Unset; - type Tag = Unset; type Subject = Unset; + type Tag = Unset; } ///State transition - sets the `subject_type` field to Set pub struct SetSubjectType(PhantomData S>); impl sealed::Sealed for SetSubjectType {} impl State for SetSubjectType { type SubjectType = Set; - type Tag = S::Tag; - 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 SubjectType = S::SubjectType; - type Tag = Set; type Subject = S::Subject; + type Tag = S::Tag; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { type SubjectType = S::SubjectType; - type Tag = S::Tag; type Subject = Set; + type Tag = S::Tag; + } + ///State transition - sets the `tag` field to Set + pub struct SetTag(PhantomData S>); + impl sealed::Sealed for SetTag {} + impl State for SetTag { + type SubjectType = S::SubjectType; + type Subject = S::Subject; + type Tag = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `subject_type` field pub struct subject_type(()); - ///Marker type for the `tag` field - pub struct tag(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `tag` field + pub struct tag(()); } } @@ -228,8 +228,8 @@ impl<'a, S> SuggestionBuilder<'a, S> where S: suggestion_state::State, S::SubjectType: suggestion_state::IsSet, - S::Tag: suggestion_state::IsSet, S::Subject: suggestion_state::IsSet, + S::Tag: suggestion_state::IsSet, { /// Build the final struct pub fn build(self) -> Suggestion<'a> { diff --git a/crates/weaver-api/src/blog_pckt.rs b/crates/weaver-api/src/blog_pckt.rs index 5eeca3a..0463857 100644 --- a/crates/weaver-api/src/blog_pckt.rs +++ b/crates/weaver-api/src/blog_pckt.rs @@ -5,6 +5,7 @@ pub mod block; pub mod blog; +pub mod content; pub mod document; pub mod mark; pub mod post; diff --git a/crates/weaver-api/src/blog_pckt/block/image.rs b/crates/weaver-api/src/blog_pckt/block/image.rs index 315dd54..7b11ce6 100644 --- a/crates/weaver-api/src/blog_pckt/block/image.rs +++ b/crates/weaver-api/src/blog_pckt/block/image.rs @@ -34,37 +34,37 @@ pub mod aspect_ratio_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Width; type Height; + type Width; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Width = Unset; 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 Width = Set; - type Height = S::Height; + 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 Width = S::Width; type Height = Set; + type Width = S::Width; + } + ///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; } /// 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 `height` field pub struct height(()); + ///Marker type for the `width` field + pub struct width(()); } } @@ -134,8 +134,8 @@ where impl<'a, S> AspectRatioBuilder<'a, S> where S: aspect_ratio_state::State, - S::Width: aspect_ratio_state::IsSet, S::Height: aspect_ratio_state::IsSet, + S::Width: aspect_ratio_state::IsSet, { /// Build the final struct pub fn build(self) -> AspectRatio<'a> { diff --git a/crates/weaver-api/src/blog_pckt/block/mention.rs b/crates/weaver-api/src/blog_pckt/block/mention.rs index 6b65622..bb7c274 100644 --- a/crates/weaver-api/src/blog_pckt/block/mention.rs +++ b/crates/weaver-api/src/blog_pckt/block/mention.rs @@ -35,37 +35,37 @@ pub mod mention_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(()); } } @@ -138,8 +138,8 @@ where impl<'a, S> MentionBuilder<'a, S> where S: mention_state::State, - S::Did: mention_state::IsSet, S::Handle: mention_state::IsSet, + S::Did: mention_state::IsSet, { /// Build the final struct pub fn build(self) -> Mention<'a> { diff --git a/crates/weaver-api/src/blog_pckt/block/task_item.rs b/crates/weaver-api/src/blog_pckt/block/task_item.rs index 8caef90..aee720a 100644 --- a/crates/weaver-api/src/blog_pckt/block/task_item.rs +++ b/crates/weaver-api/src/blog_pckt/block/task_item.rs @@ -34,37 +34,37 @@ pub mod task_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Content; type Checked; + type Content; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Content = Unset; type Checked = Unset; - } - ///State transition - sets the `content` field to Set - pub struct SetContent(PhantomData S>); - impl sealed::Sealed for SetContent {} - impl State for SetContent { - type Content = Set; - type Checked = S::Checked; + type Content = Unset; } ///State transition - sets the `checked` field to Set pub struct SetChecked(PhantomData S>); impl sealed::Sealed for SetChecked {} impl State for SetChecked { - type Content = S::Content; type Checked = 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 Checked = S::Checked; + type Content = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `content` field - pub struct content(()); ///Marker type for the `checked` field pub struct checked(()); + ///Marker type for the `content` field + pub struct content(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> TaskItemBuilder<'a, S> where S: task_item_state::State, - S::Content: task_item_state::IsSet, S::Checked: task_item_state::IsSet, + S::Content: task_item_state::IsSet, { /// Build the final struct pub fn build(self) -> TaskItem<'a> { diff --git a/crates/weaver-api/src/blog_pckt/content.rs b/crates/weaver-api/src/blog_pckt/content.rs new file mode 100644 index 0000000..d34f19d --- /dev/null +++ b/crates/weaver-api/src/blog_pckt/content.rs @@ -0,0 +1,190 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: blog.pckt.content +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Content<'a> { + /// Array of content blocks + #[serde(borrow)] + pub items: Vec>, +} + +pub mod content_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 Items; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Items = Unset; + } + ///State transition - sets the `items` field to Set + pub struct SetItems(PhantomData S>); + impl sealed::Sealed for SetItems {} + impl State for SetItems { + type Items = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `items` field + pub struct items(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ContentBuilder<'a, S: content_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Content<'a> { + /// Create a new builder for this type + pub fn new() -> ContentBuilder<'a, content_state::Empty> { + ContentBuilder::new() + } +} + +impl<'a> ContentBuilder<'a, content_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ContentBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ContentBuilder<'a, S> +where + S: content_state::State, + S::Items: content_state::IsUnset, +{ + /// Set the `items` field (required) + pub fn items( + mut self, + value: impl Into>>, + ) -> ContentBuilder<'a, content_state::SetItems> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ContentBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ContentBuilder<'a, S> +where + S: content_state::State, + S::Items: content_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Content<'a> { + Content { + items: self.__unsafe_private_named.0.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>, + >, + ) -> Content<'a> { + Content { + items: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_blog_pckt_content() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("blog.pckt.content"), + revision: None, + description: None, + defs: { + let mut map = ::alloc::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("items")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::alloc::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("items"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Array of content blocks", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![], + closed: Some(false), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Content<'a> { + fn nsid() -> &'static str { + "blog.pckt.content" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_content() + } + fn validate( + &self, + ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/blog_pckt/post.rs b/crates/weaver-api/src/blog_pckt/post.rs index dbd5f0e..8c6dae6 100644 --- a/crates/weaver-api/src/blog_pckt/post.rs +++ b/crates/weaver-api/src/blog_pckt/post.rs @@ -53,67 +53,67 @@ pub mod post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Blog; + type Title; type Blocks; + type Blog; type Url; - type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Blog = Unset; + type Title = Unset; type Blocks = Unset; + type Blog = Unset; type Url = Unset; - type Title = Unset; } - ///State transition - sets the `blog` field to Set - pub struct SetBlog(PhantomData S>); - impl sealed::Sealed for SetBlog {} - impl State for SetBlog { - type Blog = Set; + ///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 Blocks = S::Blocks; + type Blog = S::Blog; type Url = S::Url; - type Title = S::Title; } ///State transition - sets the `blocks` field to Set pub struct SetBlocks(PhantomData S>); impl sealed::Sealed for SetBlocks {} impl State for SetBlocks { - type Blog = S::Blog; + type Title = S::Title; type Blocks = Set; + type Blog = S::Blog; type Url = S::Url; + } + ///State transition - sets the `blog` field to Set + pub struct SetBlog(PhantomData S>); + impl sealed::Sealed for SetBlog {} + impl State for SetBlog { type Title = S::Title; + type Blocks = S::Blocks; + type Blog = 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 Blog = S::Blog; - type Blocks = S::Blocks; - type Url = 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 Blog = S::Blog; type Blocks = S::Blocks; - type Url = S::Url; - type Title = Set; + type Blog = S::Blog; + type Url = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `blog` field - pub struct blog(()); + ///Marker type for the `title` field + pub struct title(()); ///Marker type for the `blocks` field pub struct blocks(()); + ///Marker type for the `blog` field + pub struct blog(()); ///Marker type for the `url` field pub struct url(()); - ///Marker type for the `title` field - pub struct title(()); } } @@ -357,10 +357,10 @@ where impl<'a, S> PostBuilder<'a, S> where S: post_state::State, - S::Blog: post_state::IsSet, + S::Title: post_state::IsSet, S::Blocks: post_state::IsSet, + S::Blog: post_state::IsSet, S::Url: post_state::IsSet, - S::Title: post_state::IsSet, { /// Build the final struct pub fn build(self) -> Post<'a> { diff --git a/crates/weaver-api/src/blog_pckt/richtext/facet.rs b/crates/weaver-api/src/blog_pckt/richtext/facet.rs index 7beda8e..77c2c9f 100644 --- a/crates/weaver-api/src/blog_pckt/richtext/facet.rs +++ b/crates/weaver-api/src/blog_pckt/richtext/facet.rs @@ -552,37 +552,37 @@ pub mod byte_slice_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ByteEnd; type ByteStart; + type ByteEnd; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ByteEnd = Unset; 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 ByteEnd = Set; - type ByteStart = S::ByteStart; + 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 ByteEnd = S::ByteEnd; type ByteStart = Set; + type ByteEnd = S::ByteEnd; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `byte_end` field - pub struct byte_end(()); ///Marker type for the `byte_start` field pub struct byte_start(()); + ///Marker type for the `byte_end` field + pub struct byte_end(()); } } @@ -652,8 +652,8 @@ where impl<'a, S> ByteSliceBuilder<'a, S> where S: byte_slice_state::State, - S::ByteEnd: byte_slice_state::IsSet, S::ByteStart: byte_slice_state::IsSet, + S::ByteEnd: byte_slice_state::IsSet, { /// Build the final struct pub fn build(self) -> ByteSlice<'a> { diff --git a/crates/weaver-api/src/chat_bsky/convo.rs b/crates/weaver-api/src/chat_bsky/convo.rs index b5c5d65..8c587d5 100644 --- a/crates/weaver-api/src/chat_bsky/convo.rs +++ b/crates/weaver-api/src/chat_bsky/convo.rs @@ -66,85 +66,85 @@ pub mod convo_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; type Muted; type UnreadCount; - type Rev; + type Id; type Members; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; type Muted = Unset; type UnreadCount = Unset; - type Rev = Unset; + type Id = Unset; type Members = 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 Muted = S::Muted; - type UnreadCount = S::UnreadCount; - type Rev = S::Rev; - type Members = S::Members; + type Rev = Unset; } ///State transition - sets the `muted` field to Set pub struct SetMuted(PhantomData S>); impl sealed::Sealed for SetMuted {} impl State for SetMuted { - type Id = S::Id; type Muted = Set; type UnreadCount = S::UnreadCount; - type Rev = S::Rev; + type Id = S::Id; type Members = S::Members; + type Rev = S::Rev; } ///State transition - sets the `unread_count` field to Set pub struct SetUnreadCount(PhantomData S>); impl sealed::Sealed for SetUnreadCount {} impl State for SetUnreadCount { - type Id = S::Id; type Muted = S::Muted; type UnreadCount = Set; - type Rev = S::Rev; + type Id = S::Id; type Members = S::Members; + 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 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 Muted = S::Muted; type UnreadCount = S::UnreadCount; - type Rev = Set; + type Id = Set; type Members = S::Members; + type Rev = S::Rev; } ///State transition - sets the `members` field to Set pub struct SetMembers(PhantomData S>); impl sealed::Sealed for SetMembers {} impl State for SetMembers { - type Id = S::Id; type Muted = S::Muted; type UnreadCount = S::UnreadCount; - type Rev = S::Rev; + type Id = S::Id; type Members = 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 Muted = S::Muted; + type UnreadCount = S::UnreadCount; + type Id = S::Id; + type Members = S::Members; + type Rev = 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 `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(()); ///Marker type for the `members` field pub struct members(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -331,11 +331,11 @@ where impl<'a, S> ConvoViewBuilder<'a, S> where S: convo_view_state::State, - S::Id: 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, S::Members: convo_view_state::IsSet, + S::Rev: convo_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ConvoView<'a> { @@ -1733,67 +1733,67 @@ pub mod deleted_message_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; - type Sender; type Id; + type Rev; type SentAt; + type Sender; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rev = Unset; - type Sender = Unset; type Id = Unset; + type Rev = Unset; type SentAt = 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 Sender = S::Sender; - type Id = S::Id; - 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 Sender = Set; - type Id = S::Id; - type SentAt = S::SentAt; + type Sender = 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 Rev = S::Rev; + type SentAt = S::SentAt; type Sender = S::Sender; - type Id = Set; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Id = S::Id; + type Rev = Set; type SentAt = S::SentAt; + 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 Id = S::Id; type Rev = S::Rev; + type SentAt = Set; type Sender = S::Sender; + } + ///State transition - sets the `sender` field to Set + pub struct SetSender(PhantomData S>); + impl sealed::Sealed for SetSender {} + impl State for SetSender { type Id = S::Id; - type SentAt = Set; + type Rev = S::Rev; + type SentAt = S::SentAt; + type Sender = 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 `sender` field - pub struct sender(()); ///Marker type for the `id` field pub struct id(()); + ///Marker type for the `rev` field + pub struct rev(()); ///Marker type for the `sent_at` field pub struct sent_at(()); + ///Marker type for the `sender` field + pub struct sender(()); } } @@ -1906,10 +1906,10 @@ where impl<'a, S> DeletedMessageViewBuilder<'a, S> where S: deleted_message_view_state::State, - S::Rev: deleted_message_view_state::IsSet, - S::Sender: deleted_message_view_state::IsSet, S::Id: deleted_message_view_state::IsSet, + S::Rev: deleted_message_view_state::IsSet, S::SentAt: deleted_message_view_state::IsSet, + S::Sender: deleted_message_view_state::IsSet, { /// Build the final struct pub fn build(self) -> DeletedMessageView<'a> { @@ -2024,67 +2024,67 @@ pub mod log_add_reaction_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; type ConvoId; - type Reaction; + type Rev; type Message; + type Reaction; } /// 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 Reaction = Unset; + type Rev = 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 Reaction = S::Reaction; - type Message = S::Message; + type Reaction = 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 Reaction = S::Reaction; + type Rev = S::Rev; type Message = S::Message; + 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 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 Reaction = Set; + type Rev = Set; type Message = S::Message; + type Reaction = S::Reaction; } ///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 Reaction = S::Reaction; + type Rev = S::Rev; 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 ConvoId = S::ConvoId; + type Rev = S::Rev; + type Message = S::Message; + type Reaction = 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 `reaction` field - pub struct reaction(()); + ///Marker type for the `rev` field + pub struct rev(()); ///Marker type for the `message` field pub struct message(()); + ///Marker type for the `reaction` field + pub struct reaction(()); } } @@ -2197,10 +2197,10 @@ where impl<'a, S> LogAddReactionBuilder<'a, S> where S: log_add_reaction_state::State, - 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, + S::Reaction: log_add_reaction_state::IsSet, { /// Build the final struct pub fn build(self) -> LogAddReaction<'a> { @@ -2332,51 +2332,51 @@ pub mod log_create_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; - type Message = 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; } ///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 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; + type ConvoId = 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(()); } } @@ -2469,9 +2469,9 @@ where impl<'a, S> LogCreateMessageBuilder<'a, S> where S: log_create_message_state::State, + S::Message: log_create_message_state::IsSet, S::Rev: log_create_message_state::IsSet, S::ConvoId: log_create_message_state::IsSet, - S::Message: log_create_message_state::IsSet, { /// Build the final struct pub fn build(self) -> LogCreateMessage<'a> { @@ -2565,49 +2565,49 @@ pub mod log_delete_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; type ConvoId; + type Rev; type Message; } /// 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 Rev = 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; - } ///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 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 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 Rev = S::Rev; type ConvoId = S::ConvoId; + type Rev = S::Rev; type Message = 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 `rev` field + pub struct rev(()); ///Marker type for the `message` field pub struct message(()); } @@ -2702,8 +2702,8 @@ where impl<'a, S> LogDeleteMessageBuilder<'a, S> where S: log_delete_message_state::State, - S::Rev: log_delete_message_state::IsSet, S::ConvoId: log_delete_message_state::IsSet, + S::Rev: log_delete_message_state::IsSet, S::Message: log_delete_message_state::IsSet, { /// Build the final struct @@ -3105,67 +3105,67 @@ pub mod log_remove_reaction_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reaction; - type ConvoId; type Rev; 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 Reaction = Unset; - type ConvoId = Unset; type Rev = 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 ConvoId = S::ConvoId; - type Rev = S::Rev; - 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 Reaction = S::Reaction; - type ConvoId = Set; - type Rev = S::Rev; - type Message = S::Message; + 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 Reaction = S::Reaction; - type ConvoId = S::ConvoId; type Rev = 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 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 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 = Set; + 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 `reaction` field - pub struct reaction(()); - ///Marker type for the `convo_id` field - pub struct convo_id(()); ///Marker type for the `rev` field pub struct rev(()); ///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(()); } } @@ -3278,10 +3278,10 @@ where impl<'a, S> LogRemoveReactionBuilder<'a, S> where S: log_remove_reaction_state::State, - S::Reaction: log_remove_reaction_state::IsSet, - S::ConvoId: log_remove_reaction_state::IsSet, S::Rev: 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> { @@ -3411,37 +3411,37 @@ pub mod message_and_reaction_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Message; type Reaction; + 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 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 Reaction = S::Reaction; + 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 Message = S::Message; type Reaction = 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 Reaction = S::Reaction; + 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 `reaction` field pub struct reaction(()); + ///Marker type for the `message` field + pub struct message(()); } } @@ -3523,8 +3523,8 @@ where impl<'a, S> MessageAndReactionViewBuilder<'a, S> where S: message_and_reaction_view_state::State, - S::Message: message_and_reaction_view_state::IsSet, S::Reaction: message_and_reaction_view_state::IsSet, + S::Message: message_and_reaction_view_state::IsSet, { /// Build the final struct pub fn build(self) -> MessageAndReactionView<'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 c5f4847..1780c82 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 @@ -185,67 +185,67 @@ pub mod metadata_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type MessagesReceived; type ConvosStarted; type Convos; type MessagesSent; + type MessagesReceived; } /// 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 Convos = Unset; type MessagesSent = 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 Convos = S::Convos; - type MessagesSent = S::MessagesSent; + type MessagesReceived = Unset; } ///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 Convos = S::Convos; type MessagesSent = S::MessagesSent; + type MessagesReceived = S::MessagesReceived; } ///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 ConvosStarted = S::ConvosStarted; type Convos = Set; type MessagesSent = S::MessagesSent; + type MessagesReceived = S::MessagesReceived; } ///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 Convos = S::Convos; type MessagesSent = Set; + type MessagesReceived = S::MessagesReceived; + } + ///State transition - sets the `messages_received` field to Set + pub struct SetMessagesReceived(PhantomData S>); + impl sealed::Sealed for SetMessagesReceived {} + impl State for SetMessagesReceived { + type ConvosStarted = S::ConvosStarted; + type Convos = S::Convos; + type MessagesSent = S::MessagesSent; + type MessagesReceived = 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 `convos` field pub struct convos(()); ///Marker type for the `messages_sent` field pub struct messages_sent(()); + ///Marker type for the `messages_received` field + pub struct messages_received(()); } } @@ -358,10 +358,10 @@ where impl<'a, S> MetadataBuilder<'a, S> where S: metadata_state::State, - S::MessagesReceived: metadata_state::IsSet, S::ConvosStarted: metadata_state::IsSet, S::Convos: metadata_state::IsSet, S::MessagesSent: metadata_state::IsSet, + S::MessagesReceived: metadata_state::IsSet, { /// Build the final struct pub fn build(self) -> Metadata<'a> { diff --git a/crates/weaver-api/src/com_atproto/admin.rs b/crates/weaver-api/src/com_atproto/admin.rs index f4dbd7c..be51833 100644 --- a/crates/weaver-api/src/com_atproto/admin.rs +++ b/crates/weaver-api/src/com_atproto/admin.rs @@ -907,37 +907,37 @@ pub mod repo_blob_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Did; + 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 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 Cid = Set; - type Did = S::Did; + 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 Cid = S::Cid; type Did = 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 Did = S::Did; + 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 `did` field pub struct did(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -1030,8 +1030,8 @@ impl<'a, S: repo_blob_ref_state::State> RepoBlobRefBuilder<'a, S> { impl<'a, S> RepoBlobRefBuilder<'a, S> where S: repo_blob_ref_state::State, - S::Cid: repo_blob_ref_state::IsSet, S::Did: repo_blob_ref_state::IsSet, + S::Cid: repo_blob_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> RepoBlobRef<'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 6a048cf..b386221 100644 --- a/crates/weaver-api/src/com_atproto/admin/send_email.rs +++ b/crates/weaver-api/src/com_atproto/admin/send_email.rs @@ -42,49 +42,49 @@ pub mod send_email_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type RecipientDid; type SenderDid; + type RecipientDid; 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 SenderDid = Unset; + type RecipientDid = 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 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 SenderDid = Set; + type RecipientDid = S::RecipientDid; + type Content = S::Content; + } + ///State transition - sets the `recipient_did` field to Set + pub struct SetRecipientDid(PhantomData S>); + impl sealed::Sealed for SetRecipientDid {} + impl State for SetRecipientDid { + type SenderDid = S::SenderDid; + type RecipientDid = 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 RecipientDid = S::RecipientDid; 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 `sender_did` field pub struct sender_did(()); + ///Marker type for the `recipient_did` field + pub struct recipient_did(()); ///Marker type for the `content` field pub struct content(()); } @@ -213,8 +213,8 @@ impl<'a, S: send_email_state::State> SendEmailBuilder<'a, S> { impl<'a, S> SendEmailBuilder<'a, S> where S: send_email_state::State, - S::RecipientDid: send_email_state::IsSet, S::SenderDid: send_email_state::IsSet, + S::RecipientDid: send_email_state::IsSet, S::Content: send_email_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/com_atproto/admin/update_account_password.rs b/crates/weaver-api/src/com_atproto/admin/update_account_password.rs index 47c11d7..fdf105f 100644 --- a/crates/weaver-api/src/com_atproto/admin/update_account_password.rs +++ b/crates/weaver-api/src/com_atproto/admin/update_account_password.rs @@ -33,37 +33,37 @@ pub mod update_account_password_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Password; type Did; + type Password; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Password = Unset; type Did = Unset; - } - ///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 Did = S::Did; + type Password = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Password = S::Password; type Did = 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 Did = S::Did; + type Password = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///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(()); } } @@ -142,8 +142,8 @@ where impl<'a, S> UpdateAccountPasswordBuilder<'a, S> where S: update_account_password_state::State, - S::Password: update_account_password_state::IsSet, S::Did: update_account_password_state::IsSet, + S::Password: update_account_password_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateAccountPassword<'a> { diff --git a/crates/weaver-api/src/com_atproto/identity.rs b/crates/weaver-api/src/com_atproto/identity.rs index 9cbacff..4e1b7a0 100644 --- a/crates/weaver-api/src/com_atproto/identity.rs +++ b/crates/weaver-api/src/com_atproto/identity.rs @@ -47,49 +47,49 @@ pub mod identity_info_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - 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 DidDoc = Unset; type Handle = Unset; + type DidDoc = Unset; type Did = Unset; } - ///State transition - sets the `did_doc` field to Set - pub struct SetDidDoc(PhantomData S>); - impl sealed::Sealed for SetDidDoc {} - impl State for SetDidDoc { - type DidDoc = Set; - type Handle = S::Handle; - type Did = S::Did; - } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type DidDoc = S::DidDoc; type Handle = Set; + type DidDoc = S::DidDoc; + 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 Handle = S::Handle; + 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 DidDoc = S::DidDoc; type Handle = S::Handle; + type DidDoc = S::DidDoc; type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///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,8 +184,8 @@ where impl<'a, S> IdentityInfoBuilder<'a, S> where S: identity_info_state::State, - 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 diff --git a/crates/weaver-api/src/com_atproto/label.rs b/crates/weaver-api/src/com_atproto/label.rs index 9f3edc8..3789e54 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 Uri; - type Cts; - type Src; type Val; + type Src; + type Cts; + 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 Cts = Unset; - type Src = Unset; type Val = Unset; + type Src = Unset; + type Cts = 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; - type Cts = S::Cts; + ///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 Src = S::Src; - type Val = S::Val; - } - ///State transition - sets the `cts` field to Set - pub struct SetCts(PhantomData S>); - impl sealed::Sealed for SetCts {} - impl State for SetCts { + type Cts = S::Cts; type Uri = S::Uri; - type Cts = Set; - type Src = S::Src; - 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 Uri = S::Uri; - type Cts = S::Cts; - type Src = Set; type Val = S::Val; + type Src = Set; + type Cts = S::Cts; + type Uri = S::Uri; } - ///State transition - sets the `val` field to Set - pub struct SetVal(PhantomData S>); - impl sealed::Sealed for SetVal {} - impl State for SetVal { + ///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 Src = S::Src; + type Cts = Set; type Uri = S::Uri; - type Cts = S::Cts; + } + ///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 Src = S::Src; - type Val = Set; + type Cts = S::Cts; + 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 `cts` field - pub struct cts(()); - ///Marker type for the `src` field - pub struct src(()); ///Marker type for the `val` field pub struct val(()); + ///Marker type for the `src` field + pub struct src(()); + ///Marker type for the `cts` field + pub struct cts(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -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::Uri: label_state::IsSet, - S::Cts: label_state::IsSet, - S::Src: label_state::IsSet, S::Val: label_state::IsSet, + S::Src: label_state::IsSet, + S::Cts: label_state::IsSet, + S::Uri: label_state::IsSet, { /// Build the final struct pub fn build(self) -> Label<'a> { @@ -1059,65 +1059,65 @@ pub mod label_value_definition_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Severity; - type Identifier; type Blurs; + type Identifier; + type Severity; 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 Identifier = Unset; type Blurs = Unset; + type Identifier = Unset; + type Severity = Unset; type Locales = 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; + ///State transition - sets the `blurs` field to Set + pub struct SetBlurs(PhantomData S>); + impl sealed::Sealed for SetBlurs {} + impl State for SetBlurs { + type Blurs = Set; type Identifier = S::Identifier; - type Blurs = S::Blurs; + type Severity = S::Severity; type Locales = S::Locales; } ///State transition - sets the `identifier` field to Set pub struct SetIdentifier(PhantomData S>); impl sealed::Sealed for SetIdentifier {} impl State for SetIdentifier { - type Severity = S::Severity; - type Identifier = Set; type Blurs = S::Blurs; + type Identifier = Set; + type Severity = S::Severity; 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 Severity = S::Severity; + ///State transition - sets the `severity` field to Set + pub struct SetSeverity(PhantomData S>); + impl sealed::Sealed for SetSeverity {} + impl State for SetSeverity { + type Blurs = S::Blurs; type Identifier = S::Identifier; - type Blurs = Set; + type Severity = 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 Severity = S::Severity; - type Identifier = S::Identifier; type Blurs = S::Blurs; + type Identifier = S::Identifier; + type Severity = S::Severity; 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 `identifier` field - pub struct identifier(()); ///Marker type for the `blurs` field pub struct blurs(()); + ///Marker type for the `identifier` field + pub struct identifier(()); + ///Marker type for the `severity` field + pub struct severity(()); ///Marker type for the `locales` field pub struct locales(()); } @@ -1274,9 +1274,9 @@ where impl<'a, S> LabelValueDefinitionBuilder<'a, S> where S: label_value_definition_state::State, - S::Severity: label_value_definition_state::IsSet, - S::Identifier: label_value_definition_state::IsSet, S::Blurs: label_value_definition_state::IsSet, + S::Identifier: label_value_definition_state::IsSet, + S::Severity: label_value_definition_state::IsSet, S::Locales: label_value_definition_state::IsSet, { /// Build the final struct @@ -1687,51 +1687,51 @@ pub mod label_value_definition_strings_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; type Lang; type Description; + 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 Lang = Unset; type Description = 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 Lang = S::Lang; - type Description = S::Description; + type Name = Unset; } ///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 Lang = Set; type Description = S::Description; + type Name = S::Name; } ///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 Lang = S::Lang; type Description = 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 Lang = S::Lang; + type Description = S::Description; + 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 `lang` field pub struct lang(()); ///Marker type for the `description` field pub struct description(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -1841,9 +1841,9 @@ where impl<'a, S> LabelValueDefinitionStringsBuilder<'a, S> where S: label_value_definition_strings_state::State, - S::Name: label_value_definition_strings_state::IsSet, S::Lang: label_value_definition_strings_state::IsSet, S::Description: label_value_definition_strings_state::IsSet, + S::Name: 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/moderation/create_report.rs b/crates/weaver-api/src/com_atproto/moderation/create_report.rs index 5768a05..94bdf88 100644 --- a/crates/weaver-api/src/com_atproto/moderation/create_report.rs +++ b/crates/weaver-api/src/com_atproto/moderation/create_report.rs @@ -43,37 +43,37 @@ pub mod create_report_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ReasonType; type Subject; + type ReasonType; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ReasonType = Unset; type Subject = Unset; - } - ///State transition - sets the `reason_type` field to Set - pub struct SetReasonType(PhantomData S>); - impl sealed::Sealed for SetReasonType {} - impl State for SetReasonType { - type ReasonType = Set; - type Subject = S::Subject; + type ReasonType = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type ReasonType = S::ReasonType; type Subject = Set; + type ReasonType = S::ReasonType; + } + ///State transition - sets the `reason_type` field to Set + pub struct SetReasonType(PhantomData S>); + impl sealed::Sealed for SetReasonType {} + impl State for SetReasonType { + type Subject = S::Subject; + type ReasonType = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reason_type` field - pub struct reason_type(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `reason_type` field + pub struct reason_type(()); } } @@ -187,8 +187,8 @@ where impl<'a, S> CreateReportBuilder<'a, S> where S: create_report_state::State, - S::ReasonType: create_report_state::IsSet, S::Subject: create_report_state::IsSet, + S::ReasonType: create_report_state::IsSet, { /// Build the final struct pub fn build(self) -> CreateReport<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo.rs b/crates/weaver-api/src/com_atproto/repo.rs index a43999f..9668377 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 Cid; type Rev; + 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 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 Cid = Set; - type Rev = S::Rev; + 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 Cid = S::Cid; type Rev = 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 Rev = S::Rev; + 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 `rev` field pub struct rev(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -147,8 +147,8 @@ where impl<'a, S> CommitMetaBuilder<'a, S> where S: commit_meta_state::State, - S::Cid: commit_meta_state::IsSet, S::Rev: commit_meta_state::IsSet, + S::Cid: 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 99176db..ae10fc9 100644 --- a/crates/weaver-api/src/com_atproto/repo/apply_writes.rs +++ b/crates/weaver-api/src/com_atproto/repo/apply_writes.rs @@ -1241,37 +1241,37 @@ pub mod apply_writes_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Writes; type Repo; + type Writes; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Writes = Unset; type Repo = Unset; - } - ///State transition - sets the `writes` field to Set - pub struct SetWrites(PhantomData S>); - impl sealed::Sealed for SetWrites {} - impl State for SetWrites { - type Writes = Set; - type Repo = S::Repo; + type Writes = Unset; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Writes = S::Writes; type Repo = Set; + type Writes = S::Writes; + } + ///State transition - sets the `writes` field to Set + pub struct SetWrites(PhantomData S>); + impl sealed::Sealed for SetWrites {} + impl State for SetWrites { + type Repo = S::Repo; + type Writes = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `writes` field - pub struct writes(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `writes` field + pub struct writes(()); } } @@ -1378,8 +1378,8 @@ where impl<'a, S> ApplyWritesBuilder<'a, S> where S: apply_writes_state::State, - S::Writes: apply_writes_state::IsSet, S::Repo: apply_writes_state::IsSet, + S::Writes: apply_writes_state::IsSet, { /// Build the final struct pub fn build(self) -> ApplyWrites<'a> { @@ -1569,50 +1569,50 @@ pub mod update_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Collection; - type Rkey; type Value; + 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 Value = 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 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; + type Rkey = S::Rkey; } ///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 = 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 Value = S::Value; + type Rkey = 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 `value` field pub struct value(()); + ///Marker type for the `rkey` field + pub struct rkey(()); } } @@ -1714,8 +1714,8 @@ impl<'a, S> UpdateBuilder<'a, S> where S: update_state::State, S::Collection: update_state::IsSet, - S::Rkey: update_state::IsSet, S::Value: update_state::IsSet, + S::Rkey: 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 712de3d..0f919ee 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 Collection; type Record; type Repo; - 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 Record = Unset; type Repo = 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; + type Record = S::Record; + type Repo = S::Repo; } ///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 Record = Set; type Repo = S::Repo; - type Collection = S::Collection; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Record = S::Record; - type Repo = 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 Record = S::Record; - type Repo = S::Repo; - type Collection = Set; + type Repo = 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 `record` field pub struct record(()); ///Marker type for the `repo` field pub struct repo(()); - ///Marker type for the `collection` field - pub struct collection(()); } } @@ -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::Collection: create_record_state::IsSet, S::Record: create_record_state::IsSet, S::Repo: create_record_state::IsSet, - S::Collection: 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 1529a1e..54cbe85 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 Repo; type Collection; type Rkey; + type Repo; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Repo = Unset; type Collection = Unset; type Rkey = 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 Collection = S::Collection; - type Rkey = S::Rkey; + type Repo = Unset; } ///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 Collection = Set; type Rkey = S::Rkey; + type Repo = S::Repo; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Repo = S::Repo; 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 Collection = S::Collection; + type Rkey = S::Rkey; + type Repo = 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 `collection` field pub struct collection(()); ///Marker type for the `rkey` field pub struct rkey(()); + ///Marker type for the `repo` field + pub struct repo(()); } } @@ -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::Repo: delete_record_state::IsSet, S::Collection: delete_record_state::IsSet, S::Rkey: delete_record_state::IsSet, + S::Repo: 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 ff78415..1e2bb9b 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 ad621d4..968fa1b 100644 --- a/crates/weaver-api/src/com_atproto/repo/list_records.rs +++ b/crates/weaver-api/src/com_atproto/repo/list_records.rs @@ -279,50 +279,50 @@ pub mod record_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; - type Cid; type Value; + 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; type Value = 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 Value = S::Value; - } - ///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 Value = S::Value; + type Cid = S::Cid; } ///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 Cid = S::Cid; type Value = 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 Value = S::Value; + 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(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -416,8 +416,8 @@ impl<'a, S> RecordBuilder<'a, S> where S: record_state::State, S::Uri: record_state::IsSet, - S::Cid: record_state::IsSet, S::Value: record_state::IsSet, + S::Cid: 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 c954b32..2bd3a07 100644 --- a/crates/weaver-api/src/com_atproto/repo/put_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/put_record.rs @@ -56,8 +56,8 @@ pub mod put_record_state { pub trait State: sealed::Sealed { type Record; type Repo; - type Collection; type Rkey; + type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -65,8 +65,8 @@ pub mod put_record_state { impl State for Empty { type Record = Unset; type Repo = Unset; - type Collection = Unset; type Rkey = Unset; + type Collection = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); @@ -74,8 +74,8 @@ pub mod put_record_state { impl State for SetRecord { type Record = Set; type Repo = S::Repo; - type Collection = S::Collection; type Rkey = S::Rkey; + type Collection = S::Collection; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); @@ -83,17 +83,8 @@ pub mod put_record_state { impl State for SetRepo { type Record = S::Record; type Repo = 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 Record = S::Record; - type Repo = S::Repo; - type Collection = Set; type Rkey = S::Rkey; + type Collection = S::Collection; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); @@ -101,8 +92,17 @@ pub mod put_record_state { impl State for SetRkey { type Record = S::Record; type Repo = S::Repo; - type Collection = S::Collection; 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 Record = S::Record; + type Repo = S::Repo; + type Rkey = S::Rkey; + type Collection = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -111,10 +111,10 @@ pub mod put_record_state { pub struct record(()); ///Marker type for the `repo` field pub struct repo(()); - ///Marker type for the `collection` field - pub struct collection(()); ///Marker type for the `rkey` field pub struct rkey(()); + ///Marker type for the `collection` field + pub struct collection(()); } } @@ -291,8 +291,8 @@ where S: put_record_state::State, S::Record: put_record_state::IsSet, S::Repo: put_record_state::IsSet, - S::Collection: put_record_state::IsSet, S::Rkey: put_record_state::IsSet, + S::Collection: 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 7d44605..f934e76 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 2d8f10d..e7a6623 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 ForAccount; + type CreatedBy; + type Uses; type Available; + type Disabled; type CreatedAt; type Code; - type Uses; - type Disabled; - type CreatedBy; - type ForAccount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type ForAccount = Unset; + type CreatedBy = Unset; + type Uses = Unset; type Available = Unset; + type Disabled = Unset; type CreatedAt = Unset; type Code = Unset; - type Uses = Unset; - type Disabled = Unset; - type CreatedBy = Unset; - type ForAccount = Unset; } - ///State transition - sets the `available` field to Set - pub struct SetAvailable(PhantomData S>); - impl sealed::Sealed for SetAvailable {} - impl State for SetAvailable { - type Available = Set; - type CreatedAt = S::CreatedAt; - type Code = S::Code; - type Uses = S::Uses; - type Disabled = S::Disabled; + ///State transition - sets the `for_account` field to Set + pub struct SetForAccount(PhantomData S>); + impl sealed::Sealed for SetForAccount {} + impl State for SetForAccount { + type ForAccount = Set; type CreatedBy = S::CreatedBy; - type ForAccount = S::ForAccount; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Available = S::Available; - type CreatedAt = Set; - type Code = S::Code; type Uses = S::Uses; - type Disabled = S::Disabled; - type CreatedBy = S::CreatedBy; - type ForAccount = S::ForAccount; - } - ///State transition - sets the `code` field to Set - pub struct SetCode(PhantomData S>); - impl sealed::Sealed for SetCode {} - impl State for SetCode { type Available = S::Available; + type Disabled = S::Disabled; type CreatedAt = S::CreatedAt; - type Code = Set; + 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 ForAccount = S::ForAccount; + type CreatedBy = Set; type Uses = S::Uses; + type Available = S::Available; type Disabled = S::Disabled; - type CreatedBy = S::CreatedBy; - type ForAccount = S::ForAccount; + type CreatedAt = S::CreatedAt; + 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 ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; + type Uses = Set; type Available = S::Available; + type Disabled = S::Disabled; type CreatedAt = S::CreatedAt; type Code = S::Code; - type Uses = Set; - type Disabled = S::Disabled; - type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `available` field to Set + pub struct SetAvailable(PhantomData S>); + impl sealed::Sealed for SetAvailable {} + impl State for SetAvailable { type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; + type Uses = S::Uses; + type Available = Set; + type Disabled = S::Disabled; + type CreatedAt = S::CreatedAt; + type Code = S::Code; } ///State transition - sets the `disabled` field to Set pub struct SetDisabled(PhantomData S>); impl sealed::Sealed for SetDisabled {} impl State for SetDisabled { - type Available = S::Available; - type CreatedAt = S::CreatedAt; - type Code = S::Code; - type Uses = S::Uses; - type Disabled = Set; - type CreatedBy = S::CreatedBy; type ForAccount = S::ForAccount; - } - ///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 = S::CreatedBy; + type Uses = S::Uses; type Available = S::Available; + type Disabled = Set; type CreatedAt = S::CreatedAt; type Code = S::Code; - type Uses = S::Uses; - type Disabled = S::Disabled; - type CreatedBy = Set; - type ForAccount = S::ForAccount; } - ///State transition - sets the `for_account` field to Set - pub struct SetForAccount(PhantomData S>); - impl sealed::Sealed for SetForAccount {} - impl State for SetForAccount { + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; + type Uses = S::Uses; type Available = S::Available; - type CreatedAt = S::CreatedAt; + type Disabled = S::Disabled; + type CreatedAt = 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 ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; type Uses = S::Uses; + type Available = S::Available; type Disabled = S::Disabled; - type CreatedBy = S::CreatedBy; - type ForAccount = Set; + type CreatedAt = S::CreatedAt; + type Code = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `for_account` field + pub struct for_account(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `uses` field + pub struct uses(()); ///Marker type for the `available` field pub struct available(()); + ///Marker type for the `disabled` field + pub struct disabled(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `code` field pub struct code(()); - ///Marker type for the `uses` field - pub struct uses(()); - ///Marker type for the `disabled` field - pub struct disabled(()); - ///Marker type for the `created_by` field - pub struct created_by(()); - ///Marker type for the `for_account` field - pub struct for_account(()); } } @@ -359,13 +359,13 @@ where impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, + S::ForAccount: invite_code_state::IsSet, + S::CreatedBy: invite_code_state::IsSet, + S::Uses: invite_code_state::IsSet, S::Available: invite_code_state::IsSet, + S::Disabled: invite_code_state::IsSet, S::CreatedAt: invite_code_state::IsSet, S::Code: invite_code_state::IsSet, - S::Uses: invite_code_state::IsSet, - S::Disabled: invite_code_state::IsSet, - S::CreatedBy: invite_code_state::IsSet, - S::ForAccount: invite_code_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteCode<'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 d046e27..9488bca 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 @@ -33,37 +33,37 @@ pub mod account_codes_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Account; type Codes; + type Account; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Account = Unset; type Codes = Unset; - } - ///State transition - sets the `account` field to Set - pub struct SetAccount(PhantomData S>); - impl sealed::Sealed for SetAccount {} - impl State for SetAccount { - type Account = Set; - type Codes = S::Codes; + type Account = Unset; } ///State transition - sets the `codes` field to Set pub struct SetCodes(PhantomData S>); impl sealed::Sealed for SetCodes {} impl State for SetCodes { - type Account = S::Account; type Codes = Set; + type Account = S::Account; + } + ///State transition - sets the `account` field to Set + pub struct SetAccount(PhantomData S>); + impl sealed::Sealed for SetAccount {} + impl State for SetAccount { + type Codes = S::Codes; + type Account = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `account` field - pub struct account(()); ///Marker type for the `codes` field pub struct codes(()); + ///Marker type for the `account` field + pub struct account(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> AccountCodesBuilder<'a, S> where S: account_codes_state::State, - S::Account: account_codes_state::IsSet, S::Codes: account_codes_state::IsSet, + S::Account: account_codes_state::IsSet, { /// Build the final struct pub fn build(self) -> AccountCodes<'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 ff3927b..49e46ce 100644 --- a/crates/weaver-api/src/com_atproto/server/delete_account.rs +++ b/crates/weaver-api/src/com_atproto/server/delete_account.rs @@ -35,49 +35,49 @@ pub mod delete_account_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Password; + type Did; type Token; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Password = Unset; + type Did = Unset; type Token = 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 Password = S::Password; - 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 Did = S::Did; type Password = Set; + type Did = S::Did; + type Token = S::Token; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Password = S::Password; + type Did = 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 = S::Did; type Token = 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 `password` field pub struct password(()); + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `token` field pub struct token(()); } @@ -172,8 +172,8 @@ where impl<'a, S> DeleteAccountBuilder<'a, S> where S: delete_account_state::State, - S::Did: delete_account_state::IsSet, S::Password: delete_account_state::IsSet, + S::Did: delete_account_state::IsSet, S::Token: delete_account_state::IsSet, { /// Build the final struct 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 01aa0e5..ecefe89 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 edc9741..19d72c4 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_record.rs b/crates/weaver-api/src/com_atproto/sync/get_record.rs index b72791f..3bcb7e2 100644 --- a/crates/weaver-api/src/com_atproto/sync/get_record.rs +++ b/crates/weaver-api/src/com_atproto/sync/get_record.rs @@ -36,49 +36,49 @@ pub mod get_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - 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 Collection = Unset; type Did = Unset; + type Collection = 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 Did = S::Did; - type Rkey = S::Rkey; - } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Collection = S::Collection; type Did = 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 Did = S::Did; + 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 Collection = S::Collection; type Did = S::Did; + type Collection = S::Collection; type Rkey = 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 `did` field pub struct did(()); + ///Marker type for the `collection` field + pub struct collection(()); ///Marker type for the `rkey` field pub struct rkey(()); } @@ -181,8 +181,8 @@ where impl<'a, S> GetRecordBuilder<'a, S> where S: get_record_state::State, - 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 diff --git a/crates/weaver-api/src/com_atproto/sync/list_repos.rs b/crates/weaver-api/src/com_atproto/sync/list_repos.rs index 74421fb..a525cf5 100644 --- a/crates/weaver-api/src/com_atproto/sync/list_repos.rs +++ b/crates/weaver-api/src/com_atproto/sync/list_repos.rs @@ -194,51 +194,51 @@ pub mod repo_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; - type Rev; type Head; + type Rev; + 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 Rev = Unset; type Head = Unset; + type Rev = 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 `head` field to Set + pub struct SetHead(PhantomData S>); + impl sealed::Sealed for SetHead {} + impl State for SetHead { + type Head = Set; type Rev = S::Rev; - type Head = S::Head; + type Did = S::Did; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Did = S::Did; - type Rev = Set; type Head = S::Head; - } - ///State transition - sets the `head` field to Set - pub struct SetHead(PhantomData S>); - impl sealed::Sealed for SetHead {} - impl State for SetHead { + type Rev = 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 Head = S::Head; type Rev = S::Rev; - type Head = 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 `rev` field - pub struct rev(()); ///Marker type for the `head` field pub struct head(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -359,9 +359,9 @@ impl<'a, S: repo_state::State> RepoBuilder<'a, S> { impl<'a, S> RepoBuilder<'a, S> where S: repo_state::State, - S::Did: repo_state::IsSet, - S::Rev: repo_state::IsSet, S::Head: repo_state::IsSet, + S::Rev: repo_state::IsSet, + S::Did: repo_state::IsSet, { /// Build the final struct pub fn build(self) -> Repo<'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 8891e75..194c965 100644 --- a/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs +++ b/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs @@ -41,8 +41,8 @@ pub mod account_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Did; - type Active; type Time; + type Active; type Seq; } /// Empty state - all required fields are unset @@ -50,8 +50,8 @@ pub mod account_state { impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; - type Active = Unset; type Time = Unset; + type Active = Unset; type Seq = Unset; } ///State transition - sets the `did` field to Set @@ -59,17 +59,8 @@ pub mod account_state { impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; - type Active = S::Active; - type Time = S::Time; - type Seq = S::Seq; - } - ///State transition - sets the `active` field to Set - pub struct SetActive(PhantomData S>); - impl sealed::Sealed for SetActive {} - impl State for SetActive { - type Did = S::Did; - type Active = Set; type Time = S::Time; + type Active = S::Active; type Seq = S::Seq; } ///State transition - sets the `time` field to Set @@ -77,8 +68,17 @@ pub mod account_state { impl sealed::Sealed for SetTime {} impl State for SetTime { type Did = S::Did; - type Active = S::Active; type Time = Set; + type Active = S::Active; + type Seq = S::Seq; + } + ///State transition - sets the `active` field to Set + pub struct SetActive(PhantomData S>); + impl sealed::Sealed for SetActive {} + impl State for SetActive { + type Did = S::Did; + type Time = S::Time; + type Active = Set; type Seq = S::Seq; } ///State transition - sets the `seq` field to Set @@ -86,8 +86,8 @@ pub mod account_state { impl sealed::Sealed for SetSeq {} impl State for SetSeq { type Did = S::Did; - type Active = S::Active; type Time = S::Time; + type Active = S::Active; type Seq = Set; } /// Marker types for field names @@ -95,10 +95,10 @@ pub mod account_state { pub mod members { ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `active` field - pub struct active(()); ///Marker type for the `time` field pub struct time(()); + ///Marker type for the `active` field + pub struct active(()); ///Marker type for the `seq` field pub struct seq(()); } @@ -228,8 +228,8 @@ impl<'a, S> AccountBuilder<'a, S> where S: account_state::State, S::Did: account_state::IsSet, - S::Active: account_state::IsSet, S::Time: account_state::IsSet, + S::Active: account_state::IsSet, S::Seq: account_state::IsSet, { /// Build the final struct @@ -1073,205 +1073,205 @@ pub mod commit_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type TooBig; - type Blobs; - type Repo; + type Seq; + type Blocks; type Time; type Rev; + type Blobs; + type Repo; + type Rebase; type Commit; - type Blocks; type Ops; - type Rebase; - type Seq; + type TooBig; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type TooBig = Unset; - type Blobs = Unset; - type Repo = Unset; + type Seq = Unset; + type Blocks = Unset; type Time = Unset; type Rev = Unset; + type Blobs = Unset; + type Repo = Unset; + type Rebase = Unset; type Commit = Unset; - type Blocks = Unset; type Ops = Unset; - type Rebase = Unset; - type Seq = Unset; + type TooBig = Unset; } - ///State transition - sets the `too_big` field to Set - pub struct SetTooBig(PhantomData S>); - impl sealed::Sealed for SetTooBig {} - impl State for SetTooBig { - type TooBig = Set; + ///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; + type Time = S::Time; + type Rev = S::Rev; type Blobs = S::Blobs; type Repo = S::Repo; + type Rebase = S::Rebase; + type Commit = S::Commit; + type Ops = S::Ops; + type TooBig = S::TooBig; + } + ///State transition - sets the `blocks` field to Set + pub struct SetBlocks(PhantomData S>); + impl sealed::Sealed for SetBlocks {} + impl State for SetBlocks { + type Seq = S::Seq; + type Blocks = Set; type Time = S::Time; type Rev = S::Rev; + type Blobs = S::Blobs; + type Repo = S::Repo; + type Rebase = S::Rebase; type Commit = S::Commit; - type Blocks = S::Blocks; type Ops = S::Ops; + type TooBig = S::TooBig; + } + ///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 Time = Set; + type Rev = S::Rev; + type Blobs = S::Blobs; + type Repo = S::Repo; type Rebase = S::Rebase; + type Commit = S::Commit; + type Ops = S::Ops; + type TooBig = S::TooBig; + } + ///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 Time = S::Time; + type Rev = Set; + type Blobs = S::Blobs; + type Repo = S::Repo; + type Rebase = S::Rebase; + type Commit = S::Commit; + type Ops = S::Ops; + type TooBig = S::TooBig; } ///State transition - sets the `blobs` field to Set pub struct SetBlobs(PhantomData S>); impl sealed::Sealed for SetBlobs {} impl State for SetBlobs { - type TooBig = S::TooBig; - type Blobs = Set; - type Repo = S::Repo; + type Seq = S::Seq; + type Blocks = S::Blocks; type Time = S::Time; type Rev = S::Rev; + type Blobs = Set; + type Repo = S::Repo; + type Rebase = S::Rebase; type Commit = S::Commit; - type Blocks = S::Blocks; type Ops = S::Ops; - type Rebase = S::Rebase; - type Seq = S::Seq; + type TooBig = S::TooBig; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type TooBig = S::TooBig; - type Blobs = S::Blobs; - type Repo = Set; + type Seq = S::Seq; + type Blocks = S::Blocks; type Time = S::Time; type Rev = S::Rev; - type Commit = S::Commit; - type Blocks = S::Blocks; - type Ops = S::Ops; - type Rebase = S::Rebase; - 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 TooBig = S::TooBig; type Blobs = S::Blobs; - type Repo = S::Repo; - type Time = Set; - type Rev = S::Rev; + type Repo = Set; + type Rebase = S::Rebase; type Commit = S::Commit; - type Blocks = S::Blocks; type Ops = S::Ops; - type Rebase = S::Rebase; - type Seq = S::Seq; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { type TooBig = S::TooBig; + } + ///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 Time = S::Time; + type Rev = S::Rev; type Blobs = S::Blobs; type Repo = S::Repo; - type Time = S::Time; - type Rev = Set; + type Rebase = Set; type Commit = S::Commit; - type Blocks = S::Blocks; type Ops = S::Ops; - type Rebase = S::Rebase; - type Seq = S::Seq; + type TooBig = S::TooBig; } ///State transition - sets the `commit` field to Set pub struct SetCommit(PhantomData S>); impl sealed::Sealed for SetCommit {} impl State for SetCommit { - type TooBig = S::TooBig; - type Blobs = S::Blobs; - type Repo = S::Repo; + type Seq = S::Seq; + type Blocks = S::Blocks; type Time = S::Time; type Rev = S::Rev; - type Commit = Set; - type Blocks = S::Blocks; - type Ops = S::Ops; - type Rebase = S::Rebase; - type Seq = S::Seq; - } - ///State transition - sets the `blocks` field to Set - pub struct SetBlocks(PhantomData S>); - impl sealed::Sealed for SetBlocks {} - impl State for SetBlocks { - type TooBig = S::TooBig; type Blobs = S::Blobs; type Repo = S::Repo; - type Time = S::Time; - type Rev = S::Rev; - type Commit = S::Commit; - type Blocks = Set; - type Ops = S::Ops; type Rebase = S::Rebase; - type Seq = S::Seq; + type Commit = Set; + type Ops = S::Ops; + type TooBig = S::TooBig; } ///State transition - sets the `ops` field to Set pub struct SetOps(PhantomData S>); impl sealed::Sealed for SetOps {} impl State for SetOps { - type TooBig = S::TooBig; - type Blobs = S::Blobs; - type Repo = S::Repo; + type Seq = S::Seq; + type Blocks = S::Blocks; type Time = S::Time; type Rev = S::Rev; + type Blobs = S::Blobs; + type Repo = S::Repo; + type Rebase = S::Rebase; type Commit = S::Commit; - type Blocks = S::Blocks; type Ops = Set; - type Rebase = S::Rebase; - type Seq = S::Seq; - } - ///State transition - sets the `rebase` field to Set - pub struct SetRebase(PhantomData S>); - impl sealed::Sealed for SetRebase {} - impl State for SetRebase { type TooBig = S::TooBig; - type Blobs = S::Blobs; - 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 Time = S::Time; type Rev = S::Rev; - type Commit = S::Commit; - type Blocks = S::Blocks; - type Ops = S::Ops; - type Rebase = 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 TooBig = S::TooBig; type Blobs = S::Blobs; type Repo = S::Repo; - type Time = S::Time; - type Rev = S::Rev; + type Rebase = S::Rebase; type Commit = S::Commit; - type Blocks = S::Blocks; type Ops = S::Ops; - type Rebase = S::Rebase; - type Seq = Set; + type TooBig = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `too_big` field - pub struct too_big(()); - ///Marker type for the `blobs` field - pub struct blobs(()); - ///Marker type for the `repo` field - pub struct repo(()); + ///Marker type for the `seq` field + pub struct seq(()); + ///Marker type for the `blocks` field + pub struct blocks(()); ///Marker type for the `time` field pub struct time(()); ///Marker type for the `rev` field pub struct rev(()); + ///Marker type for the `blobs` field + pub struct blobs(()); + ///Marker type for the `repo` field + pub struct repo(()); + ///Marker type for the `rebase` field + pub struct rebase(()); ///Marker type for the `commit` field pub struct commit(()); - ///Marker type for the `blocks` field - pub struct blocks(()); ///Marker type for the `ops` field pub struct ops(()); - ///Marker type for the `rebase` field - pub struct rebase(()); - ///Marker type for the `seq` field - pub struct seq(()); + ///Marker type for the `too_big` field + pub struct too_big(()); } } @@ -1559,16 +1559,16 @@ where impl<'a, S> CommitBuilder<'a, S> where S: commit_state::State, - S::TooBig: commit_state::IsSet, - S::Blobs: commit_state::IsSet, - S::Repo: commit_state::IsSet, + S::Seq: commit_state::IsSet, + S::Blocks: commit_state::IsSet, S::Time: commit_state::IsSet, S::Rev: commit_state::IsSet, + S::Blobs: commit_state::IsSet, + S::Repo: commit_state::IsSet, + S::Rebase: commit_state::IsSet, S::Commit: commit_state::IsSet, - S::Blocks: commit_state::IsSet, S::Ops: commit_state::IsSet, - S::Rebase: commit_state::IsSet, - S::Seq: commit_state::IsSet, + S::TooBig: commit_state::IsSet, { /// Build the final struct pub fn build(self) -> Commit<'a> { @@ -1677,51 +1677,51 @@ pub mod identity_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Seq; 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 Seq = Unset; type Did = Unset; type Time = 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 Did = S::Did; - type Time = S::Time; + type Seq = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Seq = S::Seq; 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 Seq = S::Seq; 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 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 `seq` field - pub struct seq(()); ///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(()); } } @@ -1834,9 +1834,9 @@ where impl<'a, S> IdentityBuilder<'a, S> where S: identity_state::State, - S::Seq: identity_state::IsSet, S::Did: identity_state::IsSet, S::Time: identity_state::IsSet, + S::Seq: identity_state::IsSet, { /// Build the final struct pub fn build(self) -> Identity<'a> { @@ -2579,9 +2579,9 @@ pub mod sync_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; - type Blocks; type Did; + type Blocks; + type Rev; type Seq; type Time; } @@ -2589,19 +2589,19 @@ pub mod sync_state { pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rev = Unset; - type Blocks = Unset; type Did = Unset; + type Blocks = Unset; + type Rev = Unset; type Seq = Unset; type Time = 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; + ///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 Blocks = S::Blocks; - type Did = S::Did; + type Rev = S::Rev; type Seq = S::Seq; type Time = S::Time; } @@ -2609,19 +2609,19 @@ pub mod sync_state { pub struct SetBlocks(PhantomData S>); impl sealed::Sealed for SetBlocks {} impl State for SetBlocks { - type Rev = S::Rev; - type Blocks = Set; type Did = S::Did; + type Blocks = Set; + type Rev = S::Rev; type Seq = S::Seq; type Time = S::Time; } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - 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 Did = S::Did; type Blocks = S::Blocks; - type Did = Set; + type Rev = Set; type Seq = S::Seq; type Time = S::Time; } @@ -2629,9 +2629,9 @@ pub mod sync_state { pub struct SetSeq(PhantomData S>); impl sealed::Sealed for SetSeq {} impl State for SetSeq { - type Rev = S::Rev; - type Blocks = S::Blocks; type Did = S::Did; + type Blocks = S::Blocks; + type Rev = S::Rev; type Seq = Set; type Time = S::Time; } @@ -2639,21 +2639,21 @@ pub mod sync_state { pub struct SetTime(PhantomData S>); impl sealed::Sealed for SetTime {} impl State for SetTime { - type Rev = S::Rev; - type Blocks = S::Blocks; type Did = S::Did; + type Blocks = S::Blocks; + type Rev = S::Rev; type Seq = S::Seq; type Time = 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 `blocks` field - pub struct blocks(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `blocks` field + pub struct blocks(()); + ///Marker type for the `rev` field + pub struct rev(()); ///Marker type for the `seq` field pub struct seq(()); ///Marker type for the `time` field @@ -2790,9 +2790,9 @@ where impl<'a, S> SyncBuilder<'a, S> where S: sync_state::State, - S::Rev: sync_state::IsSet, - S::Blocks: sync_state::IsSet, S::Did: sync_state::IsSet, + S::Blocks: sync_state::IsSet, + S::Rev: sync_state::IsSet, S::Seq: sync_state::IsSet, S::Time: sync_state::IsSet, { diff --git a/crates/weaver-api/src/com_deckbelcher/deck/list.rs b/crates/weaver-api/src/com_deckbelcher/deck/list.rs index 9cf7114..a08f1b7 100644 --- a/crates/weaver-api/src/com_deckbelcher/deck/list.rs +++ b/crates/weaver-api/src/com_deckbelcher/deck/list.rs @@ -42,51 +42,51 @@ pub mod card_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Section; type ScryfallId; type Quantity; - type Section; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Section = Unset; type ScryfallId = Unset; type Quantity = Unset; - type Section = Unset; + } + ///State transition - sets the `section` field to Set + pub struct SetSection(PhantomData S>); + impl sealed::Sealed for SetSection {} + impl State for SetSection { + type Section = Set; + type ScryfallId = S::ScryfallId; + type Quantity = S::Quantity; } ///State transition - sets the `scryfall_id` field to Set pub struct SetScryfallId(PhantomData S>); impl sealed::Sealed for SetScryfallId {} impl State for SetScryfallId { + type Section = S::Section; type ScryfallId = Set; type Quantity = S::Quantity; - type Section = S::Section; } ///State transition - sets the `quantity` field to Set pub struct SetQuantity(PhantomData S>); impl sealed::Sealed for SetQuantity {} impl State for SetQuantity { - type ScryfallId = S::ScryfallId; - type Quantity = Set; type Section = S::Section; - } - ///State transition - sets the `section` field to Set - pub struct SetSection(PhantomData S>); - impl sealed::Sealed for SetSection {} - impl State for SetSection { type ScryfallId = S::ScryfallId; - type Quantity = S::Quantity; - type Section = Set; + type Quantity = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `section` field + pub struct section(()); ///Marker type for the `scryfall_id` field pub struct scryfall_id(()); ///Marker type for the `quantity` field pub struct quantity(()); - ///Marker type for the `section` field - pub struct section(()); } } @@ -199,9 +199,9 @@ impl<'a, S: card_state::State> CardBuilder<'a, S> { impl<'a, S> CardBuilder<'a, S> where S: card_state::State, + S::Section: card_state::IsSet, S::ScryfallId: card_state::IsSet, S::Quantity: card_state::IsSet, - S::Section: card_state::IsSet, { /// Build the final struct pub fn build(self) -> Card<'a> { @@ -704,51 +704,51 @@ pub mod list_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Name; type Cards; + 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; type Cards = 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 Cards = S::Cards; + 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 Cards = S::Cards; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `cards` field to Set pub struct SetCards(PhantomData S>); impl sealed::Sealed for SetCards {} impl State for SetCards { - type CreatedAt = S::CreatedAt; type Name = S::Name; type Cards = 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 Cards = S::Cards; + 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 `cards` field pub struct cards(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -915,9 +915,9 @@ impl<'a, S: list_state::State> ListBuilder<'a, S> { impl<'a, S> ListBuilder<'a, S> where S: list_state::State, - S::CreatedAt: list_state::IsSet, S::Name: list_state::IsSet, S::Cards: list_state::IsSet, + S::CreatedAt: list_state::IsSet, { /// Build the final struct pub fn build(self) -> List<'a> { diff --git a/crates/weaver-api/src/com_deckbelcher/richtext/facet.rs b/crates/weaver-api/src/com_deckbelcher/richtext/facet.rs index 6690150..47b1717 100644 --- a/crates/weaver-api/src/com_deckbelcher/richtext/facet.rs +++ b/crates/weaver-api/src/com_deckbelcher/richtext/facet.rs @@ -34,37 +34,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(()); } } @@ -134,8 +134,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/com_whtwnd/blog.rs b/crates/weaver-api/src/com_whtwnd/blog.rs index 722c65a..48f3179 100644 --- a/crates/weaver-api/src/com_whtwnd/blog.rs +++ b/crates/weaver-api/src/com_whtwnd/blog.rs @@ -454,37 +454,37 @@ pub mod comment_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type EntryUri; type Content; + type EntryUri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type EntryUri = Unset; type Content = Unset; - } - ///State transition - sets the `entry_uri` field to Set - pub struct SetEntryUri(PhantomData S>); - impl sealed::Sealed for SetEntryUri {} - impl State for SetEntryUri { - type EntryUri = Set; - type Content = S::Content; + type EntryUri = Unset; } ///State transition - sets the `content` field to Set pub struct SetContent(PhantomData S>); impl sealed::Sealed for SetContent {} impl State for SetContent { - type EntryUri = S::EntryUri; type Content = Set; + type EntryUri = S::EntryUri; + } + ///State transition - sets the `entry_uri` field to Set + pub struct SetEntryUri(PhantomData S>); + impl sealed::Sealed for SetEntryUri {} + impl State for SetEntryUri { + type Content = S::Content; + type EntryUri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `entry_uri` field - pub struct entry_uri(()); ///Marker type for the `content` field pub struct content(()); + ///Marker type for the `entry_uri` field + pub struct entry_uri(()); } } @@ -557,8 +557,8 @@ where impl<'a, S> CommentBuilder<'a, S> where S: comment_state::State, - S::EntryUri: comment_state::IsSet, S::Content: comment_state::IsSet, + S::EntryUri: comment_state::IsSet, { /// Build the final struct pub fn build(self) -> Comment<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/blocks/image.rs b/crates/weaver-api/src/pub_leaflet/blocks/image.rs index 823750d..ee8f544 100644 --- a/crates/weaver-api/src/pub_leaflet/blocks/image.rs +++ b/crates/weaver-api/src/pub_leaflet/blocks/image.rs @@ -31,37 +31,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(()); } } @@ -131,8 +131,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/pub_leaflet/comment.rs b/crates/weaver-api/src/pub_leaflet/comment.rs index 0e3ee34..fb0f421 100644 --- a/crates/weaver-api/src/pub_leaflet/comment.rs +++ b/crates/weaver-api/src/pub_leaflet/comment.rs @@ -33,37 +33,37 @@ pub mod linear_document_quote_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Quote; type Document; + type Quote; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Quote = Unset; type Document = Unset; - } - ///State transition - sets the `quote` field to Set - pub struct SetQuote(PhantomData S>); - impl sealed::Sealed for SetQuote {} - impl State for SetQuote { - type Quote = Set; - type Document = S::Document; + type Quote = Unset; } ///State transition - sets the `document` field to Set pub struct SetDocument(PhantomData S>); impl sealed::Sealed for SetDocument {} impl State for SetDocument { - type Quote = S::Quote; type Document = 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 Document = S::Document; + type Quote = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `quote` field - pub struct quote(()); ///Marker type for the `document` field pub struct document(()); + ///Marker type for the `quote` field + pub struct quote(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> LinearDocumentQuoteBuilder<'a, S> where S: linear_document_quote_state::State, - S::Quote: linear_document_quote_state::IsSet, S::Document: linear_document_quote_state::IsSet, + S::Quote: linear_document_quote_state::IsSet, { /// Build the final struct pub fn build(self) -> LinearDocumentQuote<'a> { @@ -443,51 +443,51 @@ pub mod comment_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; - type Plaintext; type Subject; + type Plaintext; + 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 Plaintext = Unset; type Subject = Unset; + type Plaintext = 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 `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Subject = Set; type Plaintext = S::Plaintext; - type Subject = S::Subject; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `plaintext` field to Set pub struct SetPlaintext(PhantomData S>); impl sealed::Sealed for SetPlaintext {} impl State for SetPlaintext { - type CreatedAt = S::CreatedAt; - type Plaintext = 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 Plaintext = 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 Plaintext = S::Plaintext; - type Subject = 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 `plaintext` field - pub struct plaintext(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `plaintext` field + pub struct plaintext(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -657,9 +657,9 @@ where impl<'a, S> CommentBuilder<'a, S> where S: comment_state::State, - S::CreatedAt: comment_state::IsSet, - S::Plaintext: comment_state::IsSet, S::Subject: comment_state::IsSet, + S::Plaintext: comment_state::IsSet, + S::CreatedAt: comment_state::IsSet, { /// Build the final struct pub fn build(self) -> Comment<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/document.rs b/crates/weaver-api/src/pub_leaflet/document.rs index 9a3eb94..ac5a82e 100644 --- a/crates/weaver-api/src/pub_leaflet/document.rs +++ b/crates/weaver-api/src/pub_leaflet/document.rs @@ -55,51 +55,51 @@ pub mod document_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Pages; - type Author; type Title; + type Author; + type Pages; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Pages = Unset; - type Author = Unset; type Title = Unset; + type Author = Unset; + type Pages = Unset; } - ///State transition - sets the `pages` field to Set - pub struct SetPages(PhantomData S>); - impl sealed::Sealed for SetPages {} - impl State for SetPages { - type Pages = Set; + ///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 Author = S::Author; - type Title = S::Title; + type Pages = S::Pages; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Pages = S::Pages; - type Author = 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 Author = Set; type Pages = S::Pages; + } + ///State transition - sets the `pages` field to Set + pub struct SetPages(PhantomData S>); + impl sealed::Sealed for SetPages {} + impl State for SetPages { + type Title = S::Title; type Author = S::Author; - type Title = Set; + type Pages = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `pages` field - pub struct pages(()); - ///Marker type for the `author` field - pub struct author(()); ///Marker type for the `title` field pub struct title(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `pages` field + pub struct pages(()); } } @@ -322,9 +322,9 @@ where impl<'a, S> DocumentBuilder<'a, S> where S: document_state::State, - S::Pages: document_state::IsSet, - S::Author: document_state::IsSet, S::Title: document_state::IsSet, + S::Author: document_state::IsSet, + S::Pages: document_state::IsSet, { /// Build the final struct pub fn build(self) -> Document<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/pages/canvas.rs b/crates/weaver-api/src/pub_leaflet/pages/canvas.rs index 83f5f62..9c238da 100644 --- a/crates/weaver-api/src/pub_leaflet/pages/canvas.rs +++ b/crates/weaver-api/src/pub_leaflet/pages/canvas.rs @@ -39,67 +39,67 @@ pub mod block_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Y; type X; type Block; type Width; - type Y; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Y = Unset; type X = Unset; type Block = Unset; type Width = Unset; - type Y = Unset; + } + ///State transition - sets the `y` field to Set + pub struct SetY(PhantomData S>); + impl sealed::Sealed for SetY {} + impl State for SetY { + type Y = Set; + type X = S::X; + type Block = S::Block; + type Width = S::Width; } ///State transition - sets the `x` field to Set pub struct SetX(PhantomData S>); impl sealed::Sealed for SetX {} impl State for SetX { + type Y = S::Y; type X = Set; type Block = S::Block; type Width = S::Width; - type Y = S::Y; } ///State transition - sets the `block` field to Set pub struct SetBlock(PhantomData S>); impl sealed::Sealed for SetBlock {} impl State for SetBlock { + type Y = S::Y; type X = S::X; type Block = Set; type Width = S::Width; - type Y = S::Y; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData S>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { - type X = S::X; - type Block = S::Block; - type Width = Set; type Y = S::Y; - } - ///State transition - sets the `y` field to Set - pub struct SetY(PhantomData S>); - impl sealed::Sealed for SetY {} - impl State for SetY { type X = S::X; type Block = S::Block; - type Width = S::Width; - type Y = Set; + type Width = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `y` field + pub struct y(()); ///Marker type for the `x` field pub struct x(()); ///Marker type for the `block` field pub struct block(()); ///Marker type for the `width` field pub struct width(()); - ///Marker type for the `y` field - pub struct y(()); } } @@ -234,10 +234,10 @@ where impl<'a, S> BlockBuilder<'a, S> where S: block_state::State, + S::Y: block_state::IsSet, S::X: block_state::IsSet, S::Block: block_state::IsSet, S::Width: block_state::IsSet, - S::Y: block_state::IsSet, { /// Build the final struct pub fn build(self) -> Block<'a> { @@ -764,37 +764,37 @@ pub mod position_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Offset; type Block; + type Offset; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Offset = Unset; type Block = Unset; - } - ///State transition - sets the `offset` field to Set - pub struct SetOffset(PhantomData S>); - impl sealed::Sealed for SetOffset {} - impl State for SetOffset { - type Offset = Set; - type Block = S::Block; + type Offset = Unset; } ///State transition - sets the `block` field to Set pub struct SetBlock(PhantomData S>); impl sealed::Sealed for SetBlock {} impl State for SetBlock { - type Offset = S::Offset; type Block = Set; + type Offset = S::Offset; + } + ///State transition - sets the `offset` field to Set + pub struct SetOffset(PhantomData S>); + impl sealed::Sealed for SetOffset {} + impl State for SetOffset { + type Block = S::Block; + type Offset = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `offset` field - pub struct offset(()); ///Marker type for the `block` field pub struct block(()); + ///Marker type for the `offset` field + pub struct offset(()); } } @@ -867,8 +867,8 @@ where impl<'a, S> PositionBuilder<'a, S> where S: position_state::State, - S::Offset: position_state::IsSet, S::Block: position_state::IsSet, + S::Offset: position_state::IsSet, { /// Build the final struct pub fn build(self) -> Position<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/pages/linear_document.rs b/crates/weaver-api/src/pub_leaflet/pages/linear_document.rs index 82cc3f8..396d1a1 100644 --- a/crates/weaver-api/src/pub_leaflet/pages/linear_document.rs +++ b/crates/weaver-api/src/pub_leaflet/pages/linear_document.rs @@ -876,37 +876,37 @@ pub mod quote_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Start; type End; + type Start; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Start = Unset; type End = Unset; - } - ///State transition - sets the `start` field to Set - pub struct SetStart(PhantomData S>); - impl sealed::Sealed for SetStart {} - impl State for SetStart { - type Start = Set; - type End = S::End; + type Start = Unset; } ///State transition - sets the `end` field to Set pub struct SetEnd(PhantomData S>); impl sealed::Sealed for SetEnd {} impl State for SetEnd { - type Start = S::Start; type End = Set; + type Start = S::Start; + } + ///State transition - sets the `start` field to Set + pub struct SetStart(PhantomData S>); + impl sealed::Sealed for SetStart {} + impl State for SetStart { + type End = S::End; + type Start = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `start` field - pub struct start(()); ///Marker type for the `end` field pub struct end(()); + ///Marker type for the `start` field + pub struct start(()); } } @@ -979,8 +979,8 @@ where impl<'a, S> QuoteBuilder<'a, S> where S: quote_state::State, - S::Start: quote_state::IsSet, S::End: quote_state::IsSet, + S::Start: quote_state::IsSet, { /// Build the final struct pub fn build(self) -> Quote<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/poll/vote.rs b/crates/weaver-api/src/pub_leaflet/poll/vote.rs index 0c9cf82..9e9c9e4 100644 --- a/crates/weaver-api/src/pub_leaflet/poll/vote.rs +++ b/crates/weaver-api/src/pub_leaflet/poll/vote.rs @@ -34,37 +34,37 @@ pub mod vote_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Poll; type Option; + type Poll; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Poll = Unset; type Option = Unset; - } - ///State transition - sets the `poll` field to Set - pub struct SetPoll(PhantomData S>); - impl sealed::Sealed for SetPoll {} - impl State for SetPoll { - type Poll = Set; - type Option = S::Option; + type Poll = Unset; } ///State transition - sets the `option` field to Set pub struct SetOption(PhantomData S>); impl sealed::Sealed for SetOption {} impl State for SetOption { - type Poll = S::Poll; type Option = Set; + type Poll = S::Poll; + } + ///State transition - sets the `poll` field to Set + pub struct SetPoll(PhantomData S>); + impl sealed::Sealed for SetPoll {} + impl State for SetPoll { + type Option = S::Option; + type Poll = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `poll` field - pub struct poll(()); ///Marker type for the `option` field pub struct option(()); + ///Marker type for the `poll` field + pub struct poll(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> VoteBuilder<'a, S> where S: vote_state::State, - S::Poll: vote_state::IsSet, S::Option: vote_state::IsSet, + S::Poll: vote_state::IsSet, { /// Build the final struct pub fn build(self) -> Vote<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/richtext/facet.rs b/crates/weaver-api/src/pub_leaflet/richtext/facet.rs index 6e7f9e5..aabfe86 100644 --- a/crates/weaver-api/src/pub_leaflet/richtext/facet.rs +++ b/crates/weaver-api/src/pub_leaflet/richtext/facet.rs @@ -556,37 +556,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(()); } } @@ -656,8 +656,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> { @@ -1056,37 +1056,37 @@ pub mod facet_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Index; type Features; + 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 Features = 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 Features = S::Features; + type Index = Unset; } ///State transition - sets the `features` field to Set pub struct SetFeatures(PhantomData S>); impl sealed::Sealed for SetFeatures {} impl State for SetFeatures { - type Index = S::Index; type Features = 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 Features = S::Features; + 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 `features` field pub struct features(()); + ///Marker type for the `index` field + pub struct index(()); } } @@ -1159,8 +1159,8 @@ where impl<'a, S> FacetBuilder<'a, S> where S: facet_state::State, - S::Index: facet_state::IsSet, S::Features: facet_state::IsSet, + S::Index: facet_state::IsSet, { /// Build the final struct pub fn build(self) -> Facet<'a> { diff --git a/crates/weaver-api/src/pub_leaflet/theme/color.rs b/crates/weaver-api/src/pub_leaflet/theme/color.rs index f4cb3b6..c826253 100644 --- a/crates/weaver-api/src/pub_leaflet/theme/color.rs +++ b/crates/weaver-api/src/pub_leaflet/theme/color.rs @@ -438,67 +438,67 @@ pub mod rgba_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type R; - type A; - type B; type G; + type B; + type A; + type R; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type R = Unset; - type A = Unset; - type B = Unset; type G = Unset; + type B = Unset; + type A = Unset; + type R = Unset; } - ///State transition - sets the `r` field to Set - pub struct SetR(PhantomData S>); - impl sealed::Sealed for SetR {} - impl State for SetR { - type R = Set; - type A = S::A; + ///State transition - sets the `g` field to Set + pub struct SetG(PhantomData S>); + impl sealed::Sealed for SetG {} + impl State for SetG { + type G = Set; type B = S::B; - type G = S::G; - } - ///State transition - sets the `a` field to Set - pub struct SetA(PhantomData S>); - impl sealed::Sealed for SetA {} - impl State for SetA { + type A = S::A; type R = S::R; - type A = Set; - type B = S::B; - type G = S::G; } ///State transition - sets the `b` field to Set pub struct SetB(PhantomData S>); impl sealed::Sealed for SetB {} impl State for SetB { - type R = S::R; - type A = S::A; - type B = Set; type G = S::G; + type B = Set; + type A = S::A; + type R = S::R; } - ///State transition - sets the `g` field to Set - pub struct SetG(PhantomData S>); - impl sealed::Sealed for SetG {} - impl State for SetG { + ///State transition - sets the `a` field to Set + pub struct SetA(PhantomData S>); + impl sealed::Sealed for SetA {} + impl State for SetA { + type G = S::G; + type B = S::B; + type A = Set; type R = S::R; - type A = S::A; + } + ///State transition - sets the `r` field to Set + pub struct SetR(PhantomData S>); + impl sealed::Sealed for SetR {} + impl State for SetR { + type G = S::G; type B = S::B; - type G = Set; + type A = S::A; + type R = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `r` field - pub struct r(()); - ///Marker type for the `a` field - pub struct a(()); - ///Marker type for the `b` field - pub struct b(()); ///Marker type for the `g` field pub struct g(()); + ///Marker type for the `b` field + pub struct b(()); + ///Marker type for the `a` field + pub struct a(()); + ///Marker type for the `r` field + pub struct r(()); } } @@ -599,10 +599,10 @@ where impl<'a, S> RgbaBuilder<'a, S> where S: rgba_state::State, - S::R: rgba_state::IsSet, - S::A: rgba_state::IsSet, - S::B: rgba_state::IsSet, S::G: rgba_state::IsSet, + S::B: rgba_state::IsSet, + S::A: rgba_state::IsSet, + S::R: rgba_state::IsSet, { /// Build the final struct pub fn build(self) -> Rgba<'a> { diff --git a/crates/weaver-api/src/sh_weaver.rs b/crates/weaver-api/src/sh_weaver.rs index d910987..b14d285 100644 --- a/crates/weaver-api/src/sh_weaver.rs +++ b/crates/weaver-api/src/sh_weaver.rs @@ -5,6 +5,7 @@ pub mod actor; pub mod collab; +pub mod domain; pub mod edit; pub mod embed; pub mod graph; diff --git a/crates/weaver-api/src/sh_weaver/actor.rs b/crates/weaver-api/src/sh_weaver/actor.rs index d205f80..08c41ee 100644 --- a/crates/weaver-api/src/sh_weaver/actor.rs +++ b/crates/weaver-api/src/sh_weaver/actor.rs @@ -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 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(()); } } @@ -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::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> { @@ -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 Handle; + type Did; type Bluesky; } /// 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 Did = Unset; type Bluesky = 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 Bluesky = S::Bluesky; - } ///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; + type Bluesky = S::Bluesky; + } + ///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 Bluesky = S::Bluesky; } ///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 Handle = S::Handle; + type Did = S::Did; type Bluesky = 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(()); ///Marker type for the `bluesky` field pub struct bluesky(()); } @@ -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::Handle: tangled_profile_view_state::IsSet, + S::Did: tangled_profile_view_state::IsSet, S::Bluesky: 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 d3f0405..4c8b5a0 100644 --- a/crates/weaver-api/src/sh_weaver/collab.rs +++ b/crates/weaver-api/src/sh_weaver/collab.rs @@ -94,51 +94,51 @@ pub mod collaboration_state_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Resource; - type Status; type Participants; + type Status; + 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 Status = Unset; type Participants = Unset; + type Status = Unset; + 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; + ///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 Status = S::Status; - type Participants = S::Participants; + type Resource = S::Resource; } ///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 Participants = S::Participants; - } - ///State transition - sets the `participants` field to Set - pub struct SetParticipants(PhantomData S>); - impl sealed::Sealed for SetParticipants {} - impl State for SetParticipants { + type Status = 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 Participants = S::Participants; type Status = S::Status; - type Participants = Set; + 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 `status` field - pub struct status(()); ///Marker type for the `participants` field pub struct participants(()); + ///Marker type for the `status` field + pub struct status(()); + ///Marker type for the `resource` field + pub struct resource(()); } } @@ -426,9 +426,9 @@ where impl<'a, S> CollaborationStateViewBuilder<'a, S> where S: collaboration_state_view_state::State, - S::Resource: collaboration_state_view_state::IsSet, - S::Status: collaboration_state_view_state::IsSet, S::Participants: collaboration_state_view_state::IsSet, + S::Status: collaboration_state_view_state::IsSet, + S::Resource: collaboration_state_view_state::IsSet, { /// Build the final struct pub fn build(self) -> CollaborationStateView<'a> { @@ -1612,8 +1612,8 @@ pub mod former_collaborator_view_state { pub trait State: sealed::Sealed { type EndReason; type WasActiveFrom; - type WasActiveUntil; type User; + type WasActiveUntil; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -1621,8 +1621,8 @@ pub mod former_collaborator_view_state { impl State for Empty { type EndReason = Unset; type WasActiveFrom = Unset; - type WasActiveUntil = Unset; type User = Unset; + type WasActiveUntil = Unset; } ///State transition - sets the `end_reason` field to Set pub struct SetEndReason(PhantomData S>); @@ -1630,8 +1630,8 @@ pub mod former_collaborator_view_state { impl State for SetEndReason { type EndReason = Set; type WasActiveFrom = S::WasActiveFrom; - type WasActiveUntil = S::WasActiveUntil; type User = S::User; + type WasActiveUntil = S::WasActiveUntil; } ///State transition - sets the `was_active_from` field to Set pub struct SetWasActiveFrom(PhantomData S>); @@ -1639,17 +1639,8 @@ pub mod former_collaborator_view_state { impl State for SetWasActiveFrom { type EndReason = S::EndReason; type WasActiveFrom = Set; - type WasActiveUntil = S::WasActiveUntil; - type User = S::User; - } - ///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 EndReason = S::EndReason; - type WasActiveFrom = S::WasActiveFrom; - type WasActiveUntil = Set; type User = S::User; + type WasActiveUntil = S::WasActiveUntil; } ///State transition - sets the `user` field to Set pub struct SetUser(PhantomData S>); @@ -1657,8 +1648,17 @@ pub mod former_collaborator_view_state { impl State for SetUser { type EndReason = S::EndReason; type WasActiveFrom = S::WasActiveFrom; - type WasActiveUntil = S::WasActiveUntil; type User = 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 EndReason = S::EndReason; + type WasActiveFrom = S::WasActiveFrom; + type User = S::User; + type WasActiveUntil = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -1667,10 +1667,10 @@ pub mod former_collaborator_view_state { pub struct end_reason(()); ///Marker type for the `was_active_from` field pub struct was_active_from(()); - ///Marker type for the `was_active_until` field - pub struct was_active_until(()); ///Marker type for the `user` field pub struct user(()); + ///Marker type for the `was_active_until` field + pub struct was_active_until(()); } } @@ -1845,8 +1845,8 @@ where S: former_collaborator_view_state::State, S::EndReason: former_collaborator_view_state::IsSet, S::WasActiveFrom: former_collaborator_view_state::IsSet, - S::WasActiveUntil: former_collaborator_view_state::IsSet, S::User: former_collaborator_view_state::IsSet, + S::WasActiveUntil: former_collaborator_view_state::IsSet, { /// Build the final struct pub fn build(self) -> FormerCollaboratorView<'a> { @@ -2061,127 +2061,127 @@ pub mod invite_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Resource; - type Invitee; - type Cid; - type CreatedAt; type Status; type Uri; type Inviter; + type Invitee; + type Cid; + type Resource; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Resource = Unset; - type Invitee = Unset; - type Cid = Unset; - type CreatedAt = Unset; type Status = Unset; type Uri = Unset; type Inviter = Unset; + type Invitee = Unset; + type Cid = Unset; + type Resource = Unset; + type CreatedAt = 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; + ///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 Uri = S::Uri; + type Inviter = S::Inviter; type Invitee = S::Invitee; type Cid = S::Cid; + type Resource = S::Resource; 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 Status = S::Status; - type Uri = S::Uri; + type Uri = Set; type Inviter = S::Inviter; + type Invitee = S::Invitee; + type Cid = S::Cid; + type Resource = S::Resource; + 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 Status = S::Status; + type Uri = S::Uri; + type Inviter = Set; + type Invitee = S::Invitee; + type Cid = S::Cid; + type Resource = S::Resource; + 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 Resource = S::Resource; - type Invitee = Set; - type Cid = S::Cid; - type CreatedAt = S::CreatedAt; type Status = S::Status; type Uri = S::Uri; type Inviter = S::Inviter; + type Invitee = Set; + type Cid = S::Cid; + 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 Uri = S::Uri; + type Inviter = S::Inviter; type Invitee = S::Invitee; type Cid = 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 Status = S::Status; type Uri = S::Uri; type Inviter = S::Inviter; + type Invitee = S::Invitee; + type Cid = S::Cid; + type Resource = 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 Resource = S::Resource; - type Invitee = S::Invitee; - type Cid = S::Cid; - type CreatedAt = Set; type Status = S::Status; type Uri = S::Uri; type Inviter = S::Inviter; - } - ///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 Invitee = S::Invitee; - type Cid = S::Cid; - type CreatedAt = S::CreatedAt; - type Status = Set; - type Uri = S::Uri; - type Inviter = S::Inviter; - } - ///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 Invitee = S::Invitee; type Cid = S::Cid; - type CreatedAt = S::CreatedAt; - type Status = S::Status; - type Uri = Set; - type Inviter = S::Inviter; - } - ///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 Invitee = S::Invitee; - type Cid = S::Cid; - type CreatedAt = S::CreatedAt; - type Status = S::Status; - type Uri = S::Uri; - type Inviter = Set; + type CreatedAt = 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 `invitee` field - pub struct invitee(()); - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `status` field pub struct status(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `inviter` field pub struct inviter(()); + ///Marker type for the `invitee` field + pub struct invitee(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `resource` field + pub struct resource(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -2479,13 +2479,13 @@ where impl<'a, S> InviteViewBuilder<'a, S> where S: invite_view_state::State, - S::Resource: invite_view_state::IsSet, - S::Invitee: invite_view_state::IsSet, - S::Cid: invite_view_state::IsSet, - S::CreatedAt: invite_view_state::IsSet, S::Status: invite_view_state::IsSet, S::Uri: invite_view_state::IsSet, S::Inviter: invite_view_state::IsSet, + S::Invitee: invite_view_state::IsSet, + S::Cid: invite_view_state::IsSet, + S::Resource: invite_view_state::IsSet, + S::CreatedAt: invite_view_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteView<'a> { @@ -2821,51 +2821,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 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 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; + type Role = S::Role; + type Status = S::Status; } ///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; - type User = S::User; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type Role = S::Role; - type Status = 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 Role = S::Role; - type Status = S::Status; - type User = Set; + type Status = 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 `user` field - pub struct user(()); } } @@ -3127,9 +3127,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::User: participant_state_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ParticipantStateView<'a> { @@ -3544,9 +3544,9 @@ pub mod session_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Resource; - type Uri; type CreatedAt; type NodeId; + type Uri; type User; } /// Empty state - all required fields are unset @@ -3554,9 +3554,9 @@ pub mod session_view_state { impl sealed::Sealed for Empty {} impl State for Empty { type Resource = Unset; - type Uri = Unset; type CreatedAt = Unset; type NodeId = Unset; + type Uri = Unset; type User = Unset; } ///State transition - sets the `resource` field to Set @@ -3564,19 +3564,9 @@ pub mod session_view_state { impl sealed::Sealed for SetResource {} impl State for SetResource { type Resource = Set; - type Uri = S::Uri; - type CreatedAt = S::CreatedAt; - type NodeId = S::NodeId; - 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 Uri = Set; type CreatedAt = S::CreatedAt; type NodeId = S::NodeId; + type Uri = S::Uri; type User = S::User; } ///State transition - sets the `created_at` field to Set @@ -3584,9 +3574,9 @@ pub mod session_view_state { impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type Resource = S::Resource; - type Uri = S::Uri; type CreatedAt = Set; type NodeId = S::NodeId; + type Uri = S::Uri; type User = S::User; } ///State transition - sets the `node_id` field to Set @@ -3594,9 +3584,19 @@ pub mod session_view_state { impl sealed::Sealed for SetNodeId {} impl State for SetNodeId { type Resource = S::Resource; - type Uri = S::Uri; type CreatedAt = S::CreatedAt; type NodeId = 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 CreatedAt = S::CreatedAt; + type NodeId = S::NodeId; + type Uri = Set; type User = S::User; } ///State transition - sets the `user` field to Set @@ -3604,9 +3604,9 @@ pub mod session_view_state { impl sealed::Sealed for SetUser {} impl State for SetUser { type Resource = S::Resource; - type Uri = S::Uri; type CreatedAt = S::CreatedAt; type NodeId = S::NodeId; + type Uri = S::Uri; type User = Set; } /// Marker types for field names @@ -3614,12 +3614,12 @@ pub mod session_view_state { pub mod members { ///Marker type for the `resource` field pub struct resource(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `node_id` field pub struct node_id(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `user` field pub struct user(()); } @@ -3795,9 +3795,9 @@ impl<'a, S> SessionViewBuilder<'a, S> where S: session_view_state::State, S::Resource: session_view_state::IsSet, - S::Uri: session_view_state::IsSet, S::CreatedAt: session_view_state::IsSet, S::NodeId: session_view_state::IsSet, + S::Uri: session_view_state::IsSet, S::User: session_view_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/collab/invite.rs b/crates/weaver-api/src/sh_weaver/collab/invite.rs index e0cdd18..65e381e 100644 --- a/crates/weaver-api/src/sh_weaver/collab/invite.rs +++ b/crates/weaver-api/src/sh_weaver/collab/invite.rs @@ -140,51 +140,51 @@ pub mod invite_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Resource; type Invitee; type CreatedAt; - 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 Invitee = Unset; type CreatedAt = Unset; - 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; + 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 Resource = S::Resource; type Invitee = Set; type CreatedAt = S::CreatedAt; - type Resource = S::Resource; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Invitee = S::Invitee; - type CreatedAt = 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 Invitee = S::Invitee; - type CreatedAt = S::CreatedAt; - type Resource = Set; + type CreatedAt = 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 `invitee` field pub struct invitee(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `resource` field - pub struct resource(()); } } @@ -334,9 +334,9 @@ impl<'a, S: invite_state::State> InviteBuilder<'a, S> { impl<'a, S> InviteBuilder<'a, S> where S: invite_state::State, + S::Resource: invite_state::IsSet, S::Invitee: invite_state::IsSet, S::CreatedAt: invite_state::IsSet, - S::Resource: invite_state::IsSet, { /// Build the final struct pub fn build(self) -> Invite<'a> { diff --git a/crates/weaver-api/src/sh_weaver/collab/session.rs b/crates/weaver-api/src/sh_weaver/collab/session.rs index 6b839d6..c0ffe28 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 CreatedAt; type NodeId; + type CreatedAt; type Resource; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type NodeId = Unset; + type CreatedAt = Unset; type Resource = 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 NodeId = S::NodeId; - type Resource = S::Resource; - } ///State transition - sets the `node_id` field to Set pub struct SetNodeId(PhantomData S>); impl sealed::Sealed for SetNodeId {} impl State for SetNodeId { - type CreatedAt = S::CreatedAt; type NodeId = Set; + type CreatedAt = S::CreatedAt; + type Resource = S::Resource; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type NodeId = S::NodeId; + type CreatedAt = 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 CreatedAt = S::CreatedAt; type NodeId = S::NodeId; + type CreatedAt = S::CreatedAt; type Resource = 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 `node_id` field pub struct node_id(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `resource` field pub struct resource(()); } @@ -221,8 +221,8 @@ where impl<'a, S> SessionBuilder<'a, S> where S: session_state::State, - S::CreatedAt: session_state::IsSet, S::NodeId: session_state::IsSet, + S::CreatedAt: session_state::IsSet, S::Resource: session_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/domain.rs b/crates/weaver-api/src/sh_weaver/domain.rs new file mode 100644 index 0000000..2addbf7 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/domain.rs @@ -0,0 +1,1339 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.domain.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod generate_document; +pub mod resolve_by_domain; +pub mod resolve_document; + +/// Hydrated view of a document with re-hydrated content. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct DocumentView<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub entry_index: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub entry_uri: std::option::Option>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub path: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + #[serde(borrow)] + pub rkey: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub title: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod document_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 Rkey; + type IndexedAt; + type Record; + type Path; + type Uri; + type Cid; + type Title; + type Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Rkey = Unset; + type IndexedAt = Unset; + type Record = Unset; + type Path = Unset; + type Uri = Unset; + type Cid = Unset; + type Title = Unset; + type Did = 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 IndexedAt = S::IndexedAt; + type Record = S::Record; + type Path = S::Path; + type Uri = S::Uri; + type Cid = S::Cid; + type Title = S::Title; + 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 Rkey = S::Rkey; + type IndexedAt = Set; + type Record = S::Record; + type Path = S::Path; + type Uri = S::Uri; + type Cid = S::Cid; + type Title = S::Title; + type Did = S::Did; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Rkey = S::Rkey; + type IndexedAt = S::IndexedAt; + type Record = Set; + type Path = S::Path; + type Uri = S::Uri; + type Cid = S::Cid; + type Title = S::Title; + type Did = S::Did; + } + ///State transition - sets the `path` field to Set + pub struct SetPath(PhantomData S>); + impl sealed::Sealed for SetPath {} + impl State for SetPath { + type Rkey = S::Rkey; + type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Path = Set; + type Uri = S::Uri; + type Cid = S::Cid; + type Title = S::Title; + type Did = S::Did; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Rkey = S::Rkey; + type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Path = S::Path; + type Uri = Set; + type Cid = S::Cid; + type Title = S::Title; + 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 Rkey = S::Rkey; + type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Path = S::Path; + type Uri = S::Uri; + type Cid = Set; + type Title = S::Title; + type Did = S::Did; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Rkey = S::Rkey; + type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Path = S::Path; + type Uri = S::Uri; + type Cid = S::Cid; + type Title = 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 Rkey = S::Rkey; + type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Path = S::Path; + type Uri = S::Uri; + type Cid = S::Cid; + type Title = S::Title; + type Did = 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 `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `record` field + pub struct record(()); + ///Marker type for the `path` field + pub struct path(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `title` field + pub struct title(()); + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DocumentViewBuilder<'a, S: document_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>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DocumentView<'a> { + /// Create a new builder for this type + pub fn new() -> DocumentViewBuilder<'a, document_view_state::Empty> { + DocumentViewBuilder::new() + } +} + +impl<'a> DocumentViewBuilder<'a, document_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DocumentViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DocumentViewBuilder<'a, S> +where + S: document_view_state::State, + S::Cid: document_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> DocumentViewBuilder<'a, document_view_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DocumentViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DocumentViewBuilder<'a, S> +where + S: document_view_state::State, + S::Did: document_view_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> DocumentViewBuilder<'a, document_view_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + DocumentViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: document_view_state::State> DocumentViewBuilder<'a, S> { + /// Set the `entryIndex` field (optional) + pub fn entry_index(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `entryIndex` field to an Option value (optional) + pub fn maybe_entry_index(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: document_view_state::State> DocumentViewBuilder<'a, S> { + /// Set the `entryUri` field (optional) + pub fn entry_uri( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `entryUri` field to an Option value (optional) + pub fn maybe_entry_uri( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> DocumentViewBuilder<'a, S> +where + S: document_view_state::State, + S::IndexedAt: document_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> DocumentViewBuilder<'a, document_view_state::SetIndexedAt> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + DocumentViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DocumentViewBuilder<'a, S> +where + S: document_view_state::State, + S::Path: document_view_state::IsUnset, +{ + /// Set the `path` field (required) + pub fn path( + mut self, + value: impl Into>, + ) -> DocumentViewBuilder<'a, document_view_state::SetPath> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + DocumentViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DocumentViewBuilder<'a, S> +where + S: document_view_state::State, + S::Record: document_view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> DocumentViewBuilder<'a, document_view_state::SetRecord> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + DocumentViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DocumentViewBuilder<'a, S> +where + S: document_view_state::State, + S::Rkey: document_view_state::IsUnset, +{ + /// Set the `rkey` field (required) + pub fn rkey( + mut self, + value: impl Into>, + ) -> DocumentViewBuilder<'a, document_view_state::SetRkey> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + DocumentViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DocumentViewBuilder<'a, S> +where + S: document_view_state::State, + S::Title: document_view_state::IsUnset, +{ + /// Set the `title` field (required) + pub fn title( + mut self, + value: impl Into>, + ) -> DocumentViewBuilder<'a, document_view_state::SetTitle> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + DocumentViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DocumentViewBuilder<'a, S> +where + S: document_view_state::State, + S::Uri: document_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> DocumentViewBuilder<'a, document_view_state::SetUri> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + DocumentViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DocumentViewBuilder<'a, S> +where + S: document_view_state::State, + S::Rkey: document_view_state::IsSet, + S::IndexedAt: document_view_state::IsSet, + S::Record: document_view_state::IsSet, + S::Path: document_view_state::IsSet, + S::Uri: document_view_state::IsSet, + S::Cid: document_view_state::IsSet, + S::Title: document_view_state::IsSet, + S::Did: document_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DocumentView<'a> { + DocumentView { + cid: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + entry_index: self.__unsafe_private_named.2, + entry_uri: self.__unsafe_private_named.3, + indexed_at: self.__unsafe_private_named.4.unwrap(), + path: self.__unsafe_private_named.5.unwrap(), + record: self.__unsafe_private_named.6.unwrap(), + rkey: self.__unsafe_private_named.7.unwrap(), + title: self.__unsafe_private_named.8.unwrap(), + uri: self.__unsafe_private_named.9.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>, + >, + ) -> DocumentView<'a> { + DocumentView { + cid: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + entry_index: self.__unsafe_private_named.2, + entry_uri: self.__unsafe_private_named.3, + indexed_at: self.__unsafe_private_named.4.unwrap(), + path: self.__unsafe_private_named.5.unwrap(), + record: self.__unsafe_private_named.6.unwrap(), + rkey: self.__unsafe_private_named.7.unwrap(), + title: self.__unsafe_private_named.8.unwrap(), + uri: self.__unsafe_private_named.9.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_sh_weaver_domain_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.domain.defs"), + revision: None, + description: None, + defs: { + let mut map = ::alloc::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("documentView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Hydrated view of a document with re-hydrated content.", + ), + ), + 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("did"), + ::jacquard_common::smol_str::SmolStr::new_static("rkey"), + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ::jacquard_common::smol_str::SmolStr::new_static("path"), + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::alloc::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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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( + "entryIndex", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("entryUri"), + ::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.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "indexedAt", + ), + ::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("path"), + ::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("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rkey"), + ::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("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.insert( + ::jacquard_common::smol_str::SmolStr::new_static("publicationView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Hydrated view of a publication with domain info.", + ), + ), + 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("did"), + ::jacquard_common::smol_str::SmolStr::new_static("rkey"), + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_common::smol_str::SmolStr::new_static("domain"), + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::alloc::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("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Did, + ), + 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("domain"), + ::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( + "indexedAt", + ), + ::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("name"), + ::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( + "notebookUri", + ), + ::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.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rkey"), + ::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 DocumentView<'a> { + fn nsid() -> &'static str { + "sh.weaver.domain.defs" + } + fn def_name() -> &'static str { + "documentView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_domain_defs() + } + fn validate( + &self, + ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Hydrated view of a publication with domain info. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct PublicationView<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + #[serde(borrow)] + pub domain: jacquard_common::CowStr<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub notebook_uri: std::option::Option>, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + #[serde(borrow)] + pub rkey: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod publication_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 Uri; + type Rkey; + type Did; + type Cid; + type Domain; + type Record; + type Name; + 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 Rkey = Unset; + type Did = Unset; + type Cid = Unset; + type Domain = Unset; + type Record = Unset; + type Name = 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; + type Rkey = S::Rkey; + type Did = S::Did; + type Cid = S::Cid; + type Domain = S::Domain; + type Record = S::Record; + type Name = S::Name; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `rkey` field to Set + pub struct SetRkey(PhantomData S>); + impl sealed::Sealed for SetRkey {} + impl State for SetRkey { + type Uri = S::Uri; + type Rkey = Set; + type Did = S::Did; + type Cid = S::Cid; + type Domain = S::Domain; + type Record = S::Record; + type Name = S::Name; + type IndexedAt = S::IndexedAt; + } + ///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 Rkey = S::Rkey; + type Did = Set; + type Cid = S::Cid; + type Domain = S::Domain; + type Record = S::Record; + type Name = S::Name; + 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; + type Rkey = S::Rkey; + type Did = S::Did; + type Cid = Set; + type Domain = S::Domain; + type Record = S::Record; + type Name = S::Name; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `domain` field to Set + pub struct SetDomain(PhantomData S>); + impl sealed::Sealed for SetDomain {} + impl State for SetDomain { + type Uri = S::Uri; + type Rkey = S::Rkey; + type Did = S::Did; + type Cid = S::Cid; + type Domain = Set; + type Record = S::Record; + type Name = S::Name; + 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 Rkey = S::Rkey; + type Did = S::Did; + type Cid = S::Cid; + type Domain = S::Domain; + type Record = Set; + type Name = S::Name; + type IndexedAt = S::IndexedAt; + } + ///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 Rkey = S::Rkey; + type Did = S::Did; + type Cid = S::Cid; + type Domain = S::Domain; + type Record = S::Record; + type Name = 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 Rkey = S::Rkey; + type Did = S::Did; + type Cid = S::Cid; + type Domain = S::Domain; + type Record = S::Record; + type Name = S::Name; + 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 `rkey` field + pub struct rkey(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `domain` field + pub struct domain(()); + ///Marker type for the `record` field + pub struct record(()); + ///Marker type for the `name` field + pub struct name(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PublicationViewBuilder<'a, S: publication_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>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PublicationView<'a> { + /// Create a new builder for this type + pub fn new() -> PublicationViewBuilder<'a, publication_view_state::Empty> { + PublicationViewBuilder::new() + } +} + +impl<'a> PublicationViewBuilder<'a, publication_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PublicationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PublicationViewBuilder<'a, S> +where + S: publication_view_state::State, + S::Cid: publication_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> PublicationViewBuilder<'a, publication_view_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PublicationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PublicationViewBuilder<'a, S> +where + S: publication_view_state::State, + S::Did: publication_view_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> PublicationViewBuilder<'a, publication_view_state::SetDid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + PublicationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PublicationViewBuilder<'a, S> +where + S: publication_view_state::State, + S::Domain: publication_view_state::IsUnset, +{ + /// Set the `domain` field (required) + pub fn domain( + mut self, + value: impl Into>, + ) -> PublicationViewBuilder<'a, publication_view_state::SetDomain> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + PublicationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PublicationViewBuilder<'a, S> +where + S: publication_view_state::State, + S::IndexedAt: publication_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> PublicationViewBuilder<'a, publication_view_state::SetIndexedAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + PublicationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PublicationViewBuilder<'a, S> +where + S: publication_view_state::State, + S::Name: publication_view_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> PublicationViewBuilder<'a, publication_view_state::SetName> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + PublicationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: publication_view_state::State> PublicationViewBuilder<'a, S> { + /// Set the `notebookUri` field (optional) + pub fn notebook_uri( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `notebookUri` field to an Option value (optional) + pub fn maybe_notebook_uri( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> PublicationViewBuilder<'a, S> +where + S: publication_view_state::State, + S::Record: publication_view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> PublicationViewBuilder<'a, publication_view_state::SetRecord> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + PublicationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PublicationViewBuilder<'a, S> +where + S: publication_view_state::State, + S::Rkey: publication_view_state::IsUnset, +{ + /// Set the `rkey` field (required) + pub fn rkey( + mut self, + value: impl Into>, + ) -> PublicationViewBuilder<'a, publication_view_state::SetRkey> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + PublicationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PublicationViewBuilder<'a, S> +where + S: publication_view_state::State, + S::Uri: publication_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> PublicationViewBuilder<'a, publication_view_state::SetUri> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + PublicationViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PublicationViewBuilder<'a, S> +where + S: publication_view_state::State, + S::Uri: publication_view_state::IsSet, + S::Rkey: publication_view_state::IsSet, + S::Did: publication_view_state::IsSet, + S::Cid: publication_view_state::IsSet, + S::Domain: publication_view_state::IsSet, + S::Record: publication_view_state::IsSet, + S::Name: publication_view_state::IsSet, + S::IndexedAt: publication_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PublicationView<'a> { + PublicationView { + cid: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + domain: self.__unsafe_private_named.2.unwrap(), + indexed_at: self.__unsafe_private_named.3.unwrap(), + name: self.__unsafe_private_named.4.unwrap(), + notebook_uri: self.__unsafe_private_named.5, + record: self.__unsafe_private_named.6.unwrap(), + rkey: self.__unsafe_private_named.7.unwrap(), + uri: self.__unsafe_private_named.8.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>, + >, + ) -> PublicationView<'a> { + PublicationView { + cid: self.__unsafe_private_named.0.unwrap(), + did: self.__unsafe_private_named.1.unwrap(), + domain: self.__unsafe_private_named.2.unwrap(), + indexed_at: self.__unsafe_private_named.3.unwrap(), + name: self.__unsafe_private_named.4.unwrap(), + notebook_uri: self.__unsafe_private_named.5, + record: self.__unsafe_private_named.6.unwrap(), + rkey: self.__unsafe_private_named.7.unwrap(), + uri: self.__unsafe_private_named.8.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PublicationView<'a> { + fn nsid() -> &'static str { + "sh.weaver.domain.defs" + } + fn def_name() -> &'static str { + "publicationView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_domain_defs() + } + fn validate( + &self, + ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/domain/generate_document.rs b/crates/weaver-api/src/sh_weaver/domain/generate_document.rs new file mode 100644 index 0000000..a96fd3c --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/domain/generate_document.rs @@ -0,0 +1,280 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.domain.generateDocument +// +// 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 GenerateDocument<'a> { + #[serde(borrow)] + pub entry: jacquard_common::types::string::AtUri<'a>, + #[serde(borrow)] + pub path: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub publication: jacquard_common::types::string::AtUri<'a>, +} + +pub mod generate_document_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 Publication; + type Entry; + type Path; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Publication = Unset; + type Entry = Unset; + type Path = Unset; + } + ///State transition - sets the `publication` field to Set + pub struct SetPublication(PhantomData S>); + impl sealed::Sealed for SetPublication {} + impl State for SetPublication { + type Publication = Set; + type Entry = S::Entry; + type Path = S::Path; + } + ///State transition - sets the `entry` field to Set + pub struct SetEntry(PhantomData S>); + impl sealed::Sealed for SetEntry {} + impl State for SetEntry { + type Publication = S::Publication; + type Entry = 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 Publication = S::Publication; + type Entry = S::Entry; + type Path = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `publication` field + pub struct publication(()); + ///Marker type for the `entry` field + pub struct entry(()); + ///Marker type for the `path` field + pub struct path(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GenerateDocumentBuilder<'a, S: generate_document_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> GenerateDocument<'a> { + /// Create a new builder for this type + pub fn new() -> GenerateDocumentBuilder<'a, generate_document_state::Empty> { + GenerateDocumentBuilder::new() + } +} + +impl<'a> GenerateDocumentBuilder<'a, generate_document_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GenerateDocumentBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GenerateDocumentBuilder<'a, S> +where + S: generate_document_state::State, + S::Entry: generate_document_state::IsUnset, +{ + /// Set the `entry` field (required) + pub fn entry( + mut self, + value: impl Into>, + ) -> GenerateDocumentBuilder<'a, generate_document_state::SetEntry> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GenerateDocumentBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GenerateDocumentBuilder<'a, S> +where + S: generate_document_state::State, + S::Path: generate_document_state::IsUnset, +{ + /// Set the `path` field (required) + pub fn path( + mut self, + value: impl Into>, + ) -> GenerateDocumentBuilder<'a, generate_document_state::SetPath> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GenerateDocumentBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GenerateDocumentBuilder<'a, S> +where + S: generate_document_state::State, + S::Publication: generate_document_state::IsUnset, +{ + /// Set the `publication` field (required) + pub fn publication( + mut self, + value: impl Into>, + ) -> GenerateDocumentBuilder<'a, generate_document_state::SetPublication> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GenerateDocumentBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GenerateDocumentBuilder<'a, S> +where + S: generate_document_state::State, + S::Publication: generate_document_state::IsSet, + S::Entry: generate_document_state::IsSet, + S::Path: generate_document_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GenerateDocument<'a> { + GenerateDocument { + entry: self.__unsafe_private_named.0.unwrap(), + path: self.__unsafe_private_named.1.unwrap(), + publication: self.__unsafe_private_named.2.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GenerateDocumentOutput<'a> { + #[serde(borrow)] + pub record: crate::site_standard::document::Document<'a>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic, + jacquard_derive::IntoStatic +)] +#[serde(tag = "error", content = "message")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum GenerateDocumentError<'a> { + #[serde(rename = "PublicationNotFound")] + PublicationNotFound(std::option::Option>), + #[serde(rename = "EntryNotFound")] + EntryNotFound(std::option::Option>), + #[serde(rename = "NotebookNotLinked")] + NotebookNotLinked(std::option::Option>), +} + +impl core::fmt::Display for GenerateDocumentError<'_> { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::PublicationNotFound(msg) => { + write!(f, "PublicationNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::EntryNotFound(msg) => { + write!(f, "EntryNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::NotebookNotLinked(msg) => { + write!(f, "NotebookNotLinked")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///sh.weaver.domain.generateDocument +pub struct GenerateDocumentResponse; +impl jacquard_common::xrpc::XrpcResp for GenerateDocumentResponse { + const NSID: &'static str = "sh.weaver.domain.generateDocument"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GenerateDocumentOutput<'de>; + type Err<'de> = GenerateDocumentError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GenerateDocument<'a> { + const NSID: &'static str = "sh.weaver.domain.generateDocument"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GenerateDocumentResponse; +} + +/// Endpoint type for +///sh.weaver.domain.generateDocument +pub struct GenerateDocumentRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GenerateDocumentRequest { + const PATH: &'static str = "/xrpc/sh.weaver.domain.generateDocument"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GenerateDocument<'de>; + type Response = GenerateDocumentResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/domain/resolve_by_domain.rs b/crates/weaver-api/src/sh_weaver/domain/resolve_by_domain.rs new file mode 100644 index 0000000..d290b13 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/domain/resolve_by_domain.rs @@ -0,0 +1,186 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.domain.resolveByDomain +// +// 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 ResolveByDomain<'a> { + #[serde(borrow)] + pub domain: jacquard_common::CowStr<'a>, +} + +pub mod resolve_by_domain_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 Domain; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Domain = Unset; + } + ///State transition - sets the `domain` field to Set + pub struct SetDomain(PhantomData S>); + impl sealed::Sealed for SetDomain {} + impl State for SetDomain { + type Domain = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `domain` field + pub struct domain(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ResolveByDomainBuilder<'a, S: resolve_by_domain_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ResolveByDomain<'a> { + /// Create a new builder for this type + pub fn new() -> ResolveByDomainBuilder<'a, resolve_by_domain_state::Empty> { + ResolveByDomainBuilder::new() + } +} + +impl<'a> ResolveByDomainBuilder<'a, resolve_by_domain_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ResolveByDomainBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveByDomainBuilder<'a, S> +where + S: resolve_by_domain_state::State, + S::Domain: resolve_by_domain_state::IsUnset, +{ + /// Set the `domain` field (required) + pub fn domain( + mut self, + value: impl Into>, + ) -> ResolveByDomainBuilder<'a, resolve_by_domain_state::SetDomain> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ResolveByDomainBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveByDomainBuilder<'a, S> +where + S: resolve_by_domain_state::State, + S::Domain: resolve_by_domain_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ResolveByDomain<'a> { + ResolveByDomain { + domain: 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 ResolveByDomainOutput<'a> { + #[serde(borrow)] + pub publication: crate::sh_weaver::domain::PublicationView<'a>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic, + jacquard_derive::IntoStatic +)] +#[serde(tag = "error", content = "message")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum ResolveByDomainError<'a> { + #[serde(rename = "DomainNotFound")] + DomainNotFound(std::option::Option>), +} + +impl core::fmt::Display for ResolveByDomainError<'_> { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::DomainNotFound(msg) => { + write!(f, "DomainNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///sh.weaver.domain.resolveByDomain +pub struct ResolveByDomainResponse; +impl jacquard_common::xrpc::XrpcResp for ResolveByDomainResponse { + const NSID: &'static str = "sh.weaver.domain.resolveByDomain"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ResolveByDomainOutput<'de>; + type Err<'de> = ResolveByDomainError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveByDomain<'a> { + const NSID: &'static str = "sh.weaver.domain.resolveByDomain"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ResolveByDomainResponse; +} + +/// Endpoint type for +///sh.weaver.domain.resolveByDomain +pub struct ResolveByDomainRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ResolveByDomainRequest { + const PATH: &'static str = "/xrpc/sh.weaver.domain.resolveByDomain"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ResolveByDomain<'de>; + type Response = ResolveByDomainResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/domain/resolve_document.rs b/crates/weaver-api/src/sh_weaver/domain/resolve_document.rs new file mode 100644 index 0000000..d251604 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/domain/resolve_document.rs @@ -0,0 +1,233 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.domain.resolveDocument +// +// 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 ResolveDocument<'a> { + #[serde(borrow)] + pub path: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub publication: jacquard_common::types::string::AtUri<'a>, +} + +pub mod resolve_document_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 Path; + type Publication; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Path = Unset; + type Publication = 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 Publication = S::Publication; + } + ///State transition - sets the `publication` field to Set + pub struct SetPublication(PhantomData S>); + impl sealed::Sealed for SetPublication {} + impl State for SetPublication { + type Path = S::Path; + type Publication = 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 `publication` field + pub struct publication(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ResolveDocumentBuilder<'a, S: resolve_document_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ResolveDocument<'a> { + /// Create a new builder for this type + pub fn new() -> ResolveDocumentBuilder<'a, resolve_document_state::Empty> { + ResolveDocumentBuilder::new() + } +} + +impl<'a> ResolveDocumentBuilder<'a, resolve_document_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ResolveDocumentBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveDocumentBuilder<'a, S> +where + S: resolve_document_state::State, + S::Path: resolve_document_state::IsUnset, +{ + /// Set the `path` field (required) + pub fn path( + mut self, + value: impl Into>, + ) -> ResolveDocumentBuilder<'a, resolve_document_state::SetPath> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ResolveDocumentBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveDocumentBuilder<'a, S> +where + S: resolve_document_state::State, + S::Publication: resolve_document_state::IsUnset, +{ + /// Set the `publication` field (required) + pub fn publication( + mut self, + value: impl Into>, + ) -> ResolveDocumentBuilder<'a, resolve_document_state::SetPublication> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ResolveDocumentBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveDocumentBuilder<'a, S> +where + S: resolve_document_state::State, + S::Path: resolve_document_state::IsSet, + S::Publication: resolve_document_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ResolveDocument<'a> { + ResolveDocument { + path: self.__unsafe_private_named.0.unwrap(), + publication: 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 ResolveDocumentOutput<'a> { + #[serde(borrow)] + pub document: crate::sh_weaver::domain::DocumentView<'a>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic, + jacquard_derive::IntoStatic +)] +#[serde(tag = "error", content = "message")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum ResolveDocumentError<'a> { + #[serde(rename = "PublicationNotFound")] + PublicationNotFound(std::option::Option>), + #[serde(rename = "DocumentNotFound")] + DocumentNotFound(std::option::Option>), +} + +impl core::fmt::Display for ResolveDocumentError<'_> { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::PublicationNotFound(msg) => { + write!(f, "PublicationNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::DocumentNotFound(msg) => { + write!(f, "DocumentNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///sh.weaver.domain.resolveDocument +pub struct ResolveDocumentResponse; +impl jacquard_common::xrpc::XrpcResp for ResolveDocumentResponse { + const NSID: &'static str = "sh.weaver.domain.resolveDocument"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ResolveDocumentOutput<'de>; + type Err<'de> = ResolveDocumentError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveDocument<'a> { + const NSID: &'static str = "sh.weaver.domain.resolveDocument"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ResolveDocumentResponse; +} + +/// Endpoint type for +///sh.weaver.domain.resolveDocument +pub struct ResolveDocumentRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ResolveDocumentRequest { + const PATH: &'static str = "/xrpc/sh.weaver.domain.resolveDocument"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ResolveDocument<'de>; + type Response = ResolveDocumentResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/edit.rs b/crates/weaver-api/src/sh_weaver/edit.rs index edef340..1695184 100644 --- a/crates/weaver-api/src/sh_weaver/edit.rs +++ b/crates/weaver-api/src/sh_weaver/edit.rs @@ -723,8 +723,8 @@ pub mod edit_branch_view_state { pub trait State: sealed::Sealed { type Length; type Author; - type Head; type LastUpdated; + type Head; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -732,8 +732,8 @@ pub mod edit_branch_view_state { impl State for Empty { type Length = Unset; type Author = Unset; - type Head = Unset; type LastUpdated = Unset; + type Head = Unset; } ///State transition - sets the `length` field to Set pub struct SetLength(PhantomData S>); @@ -741,8 +741,8 @@ pub mod edit_branch_view_state { impl State for SetLength { type Length = Set; type Author = S::Author; - type Head = S::Head; type LastUpdated = S::LastUpdated; + type Head = S::Head; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); @@ -750,17 +750,8 @@ pub mod edit_branch_view_state { impl State for SetAuthor { type Length = S::Length; type Author = Set; - type Head = S::Head; - type LastUpdated = S::LastUpdated; - } - ///State transition - sets the `head` field to Set - pub struct SetHead(PhantomData S>); - impl sealed::Sealed for SetHead {} - impl State for SetHead { - type Length = S::Length; - type Author = S::Author; - type Head = Set; type LastUpdated = S::LastUpdated; + type Head = S::Head; } ///State transition - sets the `last_updated` field to Set pub struct SetLastUpdated(PhantomData S>); @@ -768,8 +759,17 @@ pub mod edit_branch_view_state { impl State for SetLastUpdated { type Length = S::Length; type Author = S::Author; - type Head = S::Head; type LastUpdated = Set; + type Head = S::Head; + } + ///State transition - sets the `head` field to Set + pub struct SetHead(PhantomData S>); + impl sealed::Sealed for SetHead {} + impl State for SetHead { + type Length = S::Length; + type Author = S::Author; + type LastUpdated = S::LastUpdated; + type Head = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -778,10 +778,10 @@ pub mod edit_branch_view_state { pub struct length(()); ///Marker type for the `author` field pub struct author(()); - ///Marker type for the `head` field - pub struct head(()); ///Marker type for the `last_updated` field pub struct last_updated(()); + ///Marker type for the `head` field + pub struct head(()); } } @@ -950,8 +950,8 @@ where S: edit_branch_view_state::State, S::Length: edit_branch_view_state::IsSet, S::Author: edit_branch_view_state::IsSet, - S::Head: edit_branch_view_state::IsSet, S::LastUpdated: edit_branch_view_state::IsSet, + S::Head: edit_branch_view_state::IsSet, { /// Build the final struct pub fn build(self) -> EditBranchView<'a> { @@ -1053,85 +1053,85 @@ pub mod edit_history_entry_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; - type Uri; - type Author; type CreatedAt; + type Author; + type Cid; type Type; + 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 Uri = Unset; - type Author = Unset; type CreatedAt = Unset; + type Author = Unset; + type Cid = Unset; type Type = 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 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 CreatedAt = Set; type Author = S::Author; - 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 Uri = Set; - type Author = S::Author; - type CreatedAt = S::CreatedAt; type Type = S::Type; + 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 Uri = S::Uri; - type Author = Set; type CreatedAt = S::CreatedAt; - type Type = S::Type; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { + type Author = Set; type Cid = S::Cid; + type Type = S::Type; 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 CreatedAt = S::CreatedAt; type Author = S::Author; - type CreatedAt = Set; + type Cid = Set; type Type = S::Type; + 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 CreatedAt = S::CreatedAt; + type Author = S::Author; type Cid = S::Cid; + type Type = Set; type Uri = S::Uri; - 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 CreatedAt = S::CreatedAt; - type Type = Set; + type Author = S::Author; + type Cid = S::Cid; + type Type = S::Type; + 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 `uri` field - pub struct uri(()); - ///Marker type for the `author` field - pub struct author(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `type` field pub struct r#type(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1348,11 +1348,11 @@ where impl<'a, S> EditHistoryEntryBuilder<'a, S> where S: edit_history_entry_state::State, - S::Cid: edit_history_entry_state::IsSet, - S::Uri: edit_history_entry_state::IsSet, - S::Author: edit_history_entry_state::IsSet, S::CreatedAt: edit_history_entry_state::IsSet, + S::Author: edit_history_entry_state::IsSet, + S::Cid: edit_history_entry_state::IsSet, S::Type: edit_history_entry_state::IsSet, + S::Uri: edit_history_entry_state::IsSet, { /// Build the final struct pub fn build(self) -> EditHistoryEntry<'a> { diff --git a/crates/weaver-api/src/sh_weaver/edit/cursor.rs b/crates/weaver-api/src/sh_weaver/edit/cursor.rs index 9f8bf7d..e85cb91 100644 --- a/crates/weaver-api/src/sh_weaver/edit/cursor.rs +++ b/crates/weaver-api/src/sh_weaver/edit/cursor.rs @@ -586,37 +586,37 @@ pub mod id_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Counter; type Peer; + 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 Peer = 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; - type Peer = S::Peer; + type Counter = Unset; } ///State transition - sets the `peer` field to Set pub struct SetPeer(PhantomData S>); impl sealed::Sealed for SetPeer {} impl State for SetPeer { - type Counter = S::Counter; type Peer = 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 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 `peer` field pub struct peer(()); + ///Marker type for the `counter` field + pub struct counter(()); } } @@ -683,8 +683,8 @@ where impl<'a, S> IdBuilder<'a, S> where S: id_state::State, - S::Counter: id_state::IsSet, S::Peer: id_state::IsSet, + S::Counter: id_state::IsSet, { /// Build the final struct pub fn build(self) -> Id<'a> { @@ -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 Peer; type Counter; type ContainerType; - type Peer; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Peer = Unset; type Counter = Unset; type ContainerType = Unset; - type Peer = Unset; + } + ///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 Counter = S::Counter; + type ContainerType = S::ContainerType; } ///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 Counter = Set; type ContainerType = S::ContainerType; - type Peer = S::Peer; } ///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 Counter = S::Counter; - type ContainerType = S::ContainerType; - type Peer = Set; + type ContainerType = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `peer` field + pub struct peer(()); ///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(()); } } @@ -1154,9 +1154,9 @@ where impl<'a, S> NormalContainerIdBuilder<'a, S> where S: normal_container_id_state::State, + S::Peer: normal_container_id_state::IsSet, S::Counter: normal_container_id_state::IsSet, S::ContainerType: normal_container_id_state::IsSet, - S::Peer: 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/diff.rs b/crates/weaver-api/src/sh_weaver/edit/diff.rs index 149c305..062858f 100644 --- a/crates/weaver-api/src/sh_weaver/edit/diff.rs +++ b/crates/weaver-api/src/sh_weaver/edit/diff.rs @@ -47,37 +47,37 @@ pub mod diff_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Doc; type Root; + 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 Root = 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 Root = S::Root; + type Doc = Unset; } ///State transition - sets the `root` field to Set pub struct SetRoot(PhantomData S>); impl sealed::Sealed for SetRoot {} impl State for SetRoot { - type Doc = S::Doc; type Root = 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 Root = S::Root; + 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 `root` field pub struct root(()); + ///Marker type for the `doc` field + pub struct doc(()); } } @@ -224,8 +224,8 @@ impl<'a, S: diff_state::State> DiffBuilder<'a, S> { impl<'a, S> DiffBuilder<'a, S> where S: diff_state::State, - S::Doc: diff_state::IsSet, S::Root: diff_state::IsSet, + S::Doc: diff_state::IsSet, { /// Build the final struct pub fn build(self) -> Diff<'a> { diff --git a/crates/weaver-api/src/sh_weaver/edit/list_drafts.rs b/crates/weaver-api/src/sh_weaver/edit/list_drafts.rs index d679e1a..91f810e 100644 --- a/crates/weaver-api/src/sh_weaver/edit/list_drafts.rs +++ b/crates/weaver-api/src/sh_weaver/edit/list_drafts.rs @@ -47,51 +47,51 @@ pub mod draft_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Uri; type Cid; + 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 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; + type CreatedAt = Unset; } ///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; + 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 CreatedAt = S::CreatedAt; type Uri = S::Uri; type Cid = 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 Uri = S::Uri; + type Cid = S::Cid; + 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 `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -241,9 +241,9 @@ where 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, + S::CreatedAt: draft_view_state::IsSet, { /// Build the final struct pub fn build(self) -> DraftView<'a> { diff --git a/crates/weaver-api/src/sh_weaver/edit/root.rs b/crates/weaver-api/src/sh_weaver/edit/root.rs index 563af17..b764a51 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.rs b/crates/weaver-api/src/sh_weaver/embed.rs index 779675e..7c9dccc 100644 --- a/crates/weaver-api/src/sh_weaver/embed.rs +++ b/crates/weaver-api/src/sh_weaver/embed.rs @@ -312,37 +312,37 @@ pub mod pixel_size_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(()); } } @@ -412,8 +412,8 @@ where impl<'a, S> PixelSizeBuilder<'a, S> where S: pixel_size_state::State, - S::Height: pixel_size_state::IsSet, S::Width: pixel_size_state::IsSet, + S::Height: pixel_size_state::IsSet, { /// Build the final struct pub fn build(self) -> PixelSize<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/external.rs b/crates/weaver-api/src/sh_weaver/embed/external.rs index 6c4cbf2..57dbc73 100644 --- a/crates/weaver-api/src/sh_weaver/embed/external.rs +++ b/crates/weaver-api/src/sh_weaver/embed/external.rs @@ -38,49 +38,49 @@ pub mod external_embed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Description; type Title; + type Description; type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Description = Unset; type Title = Unset; + type Description = Unset; type Uri = 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 Title = S::Title; - type Uri = S::Uri; - } ///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 Title = Set; + type Description = S::Description; + type Uri = S::Uri; + } + ///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 = S::Description; type Title = S::Title; + type Description = S::Description; type Uri = 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 `title` field pub struct title(()); + ///Marker type for the `description` field + pub struct description(()); ///Marker type for the `uri` field pub struct uri(()); } @@ -195,8 +195,8 @@ where impl<'a, S> ExternalEmbedBuilder<'a, S> where S: external_embed_state::State, - S::Description: external_embed_state::IsSet, S::Title: external_embed_state::IsSet, + S::Description: external_embed_state::IsSet, S::Uri: external_embed_state::IsSet, { /// Build the final struct @@ -818,50 +818,50 @@ pub mod view_external_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Uri; - type Description; type Title; + type Description; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; - type Description = Unset; type Title = Unset; + type Description = 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 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; + 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 Description = S::Description; type Title = 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 = S::Uri; + type Title = S::Title; + type Description = 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 `description` field - pub struct description(()); ///Marker type for the `title` field pub struct title(()); + ///Marker type for the `description` field + pub struct description(()); } } @@ -975,8 +975,8 @@ impl<'a, S> ViewExternalBuilder<'a, S> where S: view_external_state::State, S::Uri: view_external_state::IsSet, - S::Description: view_external_state::IsSet, S::Title: view_external_state::IsSet, + S::Description: 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 61cd63a..5ef0d9a 100644 --- a/crates/weaver-api/src/sh_weaver/embed/images.rs +++ b/crates/weaver-api/src/sh_weaver/embed/images.rs @@ -902,51 +902,51 @@ pub mod view_image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Alt; type Thumb; type Fullsize; + 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 Thumb = Unset; type Fullsize = 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 Thumb = S::Thumb; - type Fullsize = S::Fullsize; + 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 Alt = S::Alt; 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 Alt = S::Alt; type Thumb = S::Thumb; type Fullsize = 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 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 `thumb` field pub struct thumb(()); ///Marker type for the `fullsize` field pub struct fullsize(()); + ///Marker type for the `alt` field + pub struct alt(()); } } @@ -1073,9 +1073,9 @@ where impl<'a, S> ViewImageBuilder<'a, S> where S: view_image_state::State, - S::Alt: view_image_state::IsSet, S::Thumb: view_image_state::IsSet, S::Fullsize: view_image_state::IsSet, + S::Alt: view_image_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewImage<'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 297864a..a622740 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 @@ -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 Records; type Media; + type Records; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Records = Unset; type Media = Unset; - } - ///State transition - sets the `records` field to Set - pub struct SetRecords(PhantomData S>); - impl sealed::Sealed for SetRecords {} - impl State for SetRecords { - type Records = Set; - type Media = S::Media; + type Records = Unset; } ///State transition - sets the `media` field to Set pub struct SetMedia(PhantomData S>); impl sealed::Sealed for SetMedia {} impl State for SetMedia { - type Records = S::Records; type Media = Set; + type Records = S::Records; + } + ///State transition - sets the `records` field to Set + pub struct SetRecords(PhantomData S>); + impl sealed::Sealed for SetRecords {} + impl State for SetRecords { + type Media = S::Media; + type Records = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `records` field - pub struct records(()); ///Marker type for the `media` field pub struct media(()); + ///Marker type for the `records` field + pub struct records(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> RecordWithMediaBuilder<'a, S> where S: record_with_media_state::State, - S::Records: record_with_media_state::IsSet, S::Media: record_with_media_state::IsSet, + S::Records: record_with_media_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordWithMedia<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/records.rs b/crates/weaver-api/src/sh_weaver/embed/records.rs index c1bea74..37b1a9e 100644 --- a/crates/weaver-api/src/sh_weaver/embed/records.rs +++ b/crates/weaver-api/src/sh_weaver/embed/records.rs @@ -1572,37 +1572,37 @@ pub mod view_not_found_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type NotFound; + 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 NotFound = 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 NotFound = S::NotFound; + type Uri = 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 Uri = S::Uri; type NotFound = 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 NotFound = S::NotFound; + 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 `not_found` field pub struct not_found(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1675,8 +1675,8 @@ where impl<'a, S> ViewNotFoundBuilder<'a, S> where S: view_not_found_state::State, - S::Uri: view_not_found_state::IsSet, S::NotFound: view_not_found_state::IsSet, + S::Uri: view_not_found_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewNotFound<'a> { @@ -1771,8 +1771,8 @@ pub mod view_record_state { pub trait State: sealed::Sealed { type Cid; type Uri; - type Value; type Author; + type Value; type IndexedAt; } /// Empty state - all required fields are unset @@ -1781,8 +1781,8 @@ pub mod view_record_state { impl State for Empty { type Cid = Unset; type Uri = Unset; - type Value = Unset; type Author = Unset; + type Value = Unset; type IndexedAt = Unset; } ///State transition - sets the `cid` field to Set @@ -1791,8 +1791,8 @@ pub mod view_record_state { impl State for SetCid { type Cid = Set; type Uri = S::Uri; - type Value = S::Value; type Author = S::Author; + type Value = S::Value; type IndexedAt = S::IndexedAt; } ///State transition - sets the `uri` field to Set @@ -1801,18 +1801,8 @@ pub mod view_record_state { impl State for SetUri { type Cid = S::Cid; type Uri = Set; - type Value = S::Value; - type Author = S::Author; - type IndexedAt = S::IndexedAt; - } - ///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; type Author = S::Author; + type Value = S::Value; type IndexedAt = S::IndexedAt; } ///State transition - sets the `author` field to Set @@ -1821,8 +1811,18 @@ pub mod view_record_state { impl State for SetAuthor { type Cid = S::Cid; type Uri = S::Uri; - type Value = S::Value; type Author = Set; + type Value = S::Value; + type IndexedAt = S::IndexedAt; + } + ///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 Author = S::Author; + type Value = Set; type IndexedAt = S::IndexedAt; } ///State transition - sets the `indexed_at` field to Set @@ -1831,8 +1831,8 @@ pub mod view_record_state { impl State for SetIndexedAt { type Cid = S::Cid; type Uri = S::Uri; - type Value = S::Value; type Author = S::Author; + type Value = S::Value; type IndexedAt = Set; } /// Marker types for field names @@ -1842,10 +1842,10 @@ pub mod view_record_state { pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `value` field - pub struct value(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } @@ -2094,8 +2094,8 @@ where S: view_record_state::State, S::Cid: view_record_state::IsSet, S::Uri: view_record_state::IsSet, - S::Value: view_record_state::IsSet, S::Author: view_record_state::IsSet, + S::Value: view_record_state::IsSet, S::IndexedAt: 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 99229fd..ca20c77 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 Cid; type Playlist; + 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 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 Cid = Set; - type Playlist = S::Playlist; + 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 Cid = S::Cid; type Playlist = 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 Playlist = S::Playlist; + 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 `playlist` field pub struct playlist(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -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::Cid: view_state::IsSet, S::Playlist: view_state::IsSet, + S::Cid: view_state::IsSet, { /// Build the final struct pub fn build(self) -> View<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph.rs b/crates/weaver-api/src/sh_weaver/graph.rs index e53ae93..5a4ea3d 100644 --- a/crates/weaver-api/src/sh_weaver/graph.rs +++ b/crates/weaver-api/src/sh_weaver/graph.rs @@ -883,37 +883,37 @@ pub mod list_item_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type Uri; + 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 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 Subject = Set; - type Uri = S::Uri; + 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 Subject = S::Subject; type Uri = 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 Uri = S::Uri; + 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 `uri` field pub struct uri(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -1006,8 +1006,8 @@ where impl<'a, S> ListItemViewBuilder<'a, S> where S: list_item_view_state::State, - S::Subject: list_item_view_state::IsSet, S::Uri: list_item_view_state::IsSet, + S::Subject: list_item_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListItemView<'a> { @@ -1212,125 +1212,125 @@ pub mod list_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type ItemCount; + type Creator; type Name; - type Purpose; type IndexedAt; - type Creator; type Uri; - type ItemCount; + type Purpose; type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type ItemCount = Unset; + type Creator = Unset; type Name = Unset; - type Purpose = Unset; type IndexedAt = Unset; - type Creator = Unset; type Uri = Unset; - type ItemCount = Unset; + type Purpose = Unset; type Cid = 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 Purpose = S::Purpose; - type IndexedAt = S::IndexedAt; + ///State transition - sets the `item_count` field to Set + pub struct SetItemCount(PhantomData S>); + impl sealed::Sealed for SetItemCount {} + impl State for SetItemCount { + type ItemCount = Set; type Creator = S::Creator; + type Name = S::Name; + type IndexedAt = S::IndexedAt; type Uri = S::Uri; - type ItemCount = S::ItemCount; + type Purpose = S::Purpose; type Cid = S::Cid; } - ///State transition - sets the `purpose` field to Set - pub struct SetPurpose(PhantomData S>); - impl sealed::Sealed for SetPurpose {} - impl State for SetPurpose { + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData S>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type ItemCount = S::ItemCount; + type Creator = Set; type Name = S::Name; - type Purpose = Set; type IndexedAt = S::IndexedAt; - type Creator = S::Creator; type Uri = S::Uri; + type Purpose = S::Purpose; + 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 ItemCount = S::ItemCount; + type Creator = S::Creator; + type Name = Set; + type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Purpose = S::Purpose; 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 ItemCount = S::ItemCount; + type Creator = S::Creator; type Name = S::Name; - type Purpose = S::Purpose; type IndexedAt = Set; - type Creator = S::Creator; type Uri = S::Uri; - type ItemCount = S::ItemCount; - 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 Name = S::Name; type Purpose = S::Purpose; - type IndexedAt = S::IndexedAt; - type Creator = Set; - type Uri = S::Uri; - type ItemCount = S::ItemCount; 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 ItemCount = S::ItemCount; + type Creator = S::Creator; type Name = S::Name; - type Purpose = S::Purpose; type IndexedAt = S::IndexedAt; - type Creator = S::Creator; type Uri = Set; - type ItemCount = S::ItemCount; + type Purpose = S::Purpose; type Cid = S::Cid; } - ///State transition - sets the `item_count` field to Set - pub struct SetItemCount(PhantomData S>); - impl sealed::Sealed for SetItemCount {} - impl State for SetItemCount { + ///State transition - sets the `purpose` field to Set + pub struct SetPurpose(PhantomData S>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type ItemCount = S::ItemCount; + type Creator = S::Creator; type Name = S::Name; - type Purpose = S::Purpose; type IndexedAt = S::IndexedAt; - type Creator = S::Creator; type Uri = S::Uri; - type ItemCount = Set; + type Purpose = 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 ItemCount = S::ItemCount; + type Creator = S::Creator; type Name = S::Name; - type Purpose = S::Purpose; type IndexedAt = S::IndexedAt; - type Creator = S::Creator; type Uri = S::Uri; - type ItemCount = S::ItemCount; + type Purpose = S::Purpose; type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `item_count` field + pub struct item_count(()); + ///Marker type for the `creator` field + pub struct creator(()); ///Marker type for the `name` field pub struct name(()); - ///Marker type for the `purpose` field - pub struct purpose(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `creator` field - pub struct creator(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `item_count` field - pub struct item_count(()); + ///Marker type for the `purpose` field + pub struct purpose(()); ///Marker type for the `cid` field pub struct cid(()); } @@ -1576,12 +1576,12 @@ impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> { impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, + S::ItemCount: list_view_state::IsSet, + S::Creator: list_view_state::IsSet, S::Name: list_view_state::IsSet, - S::Purpose: list_view_state::IsSet, S::IndexedAt: list_view_state::IsSet, - S::Creator: list_view_state::IsSet, S::Uri: list_view_state::IsSet, - S::ItemCount: list_view_state::IsSet, + S::Purpose: list_view_state::IsSet, S::Cid: list_view_state::IsSet, { /// Build the final struct @@ -1953,66 +1953,66 @@ pub mod tag_application_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Tag; - type Uri; type CreatedAt; type AppliedBy; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Tag = Unset; - type Uri = Unset; type CreatedAt = Unset; type AppliedBy = Unset; + type Uri = Unset; } ///State transition - sets the `tag` field to Set pub struct SetTag(PhantomData S>); impl sealed::Sealed for SetTag {} impl State for SetTag { type Tag = Set; - type Uri = S::Uri; - type CreatedAt = S::CreatedAt; - type AppliedBy = S::AppliedBy; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Tag = S::Tag; - type Uri = Set; type CreatedAt = S::CreatedAt; type AppliedBy = S::AppliedBy; + 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 Tag = S::Tag; - type Uri = S::Uri; type CreatedAt = Set; type AppliedBy = S::AppliedBy; + type Uri = S::Uri; } ///State transition - sets the `applied_by` field to Set pub struct SetAppliedBy(PhantomData S>); impl sealed::Sealed for SetAppliedBy {} impl State for SetAppliedBy { type Tag = S::Tag; - type Uri = S::Uri; type CreatedAt = S::CreatedAt; type AppliedBy = 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 Tag = S::Tag; + type CreatedAt = S::CreatedAt; + type AppliedBy = S::AppliedBy; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `tag` field pub struct tag(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `applied_by` field pub struct applied_by(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -2126,9 +2126,9 @@ impl<'a, S> TagApplicationViewBuilder<'a, S> where S: tag_application_view_state::State, S::Tag: tag_application_view_state::IsSet, - S::Uri: tag_application_view_state::IsSet, S::CreatedAt: tag_application_view_state::IsSet, S::AppliedBy: tag_application_view_state::IsSet, + S::Uri: tag_application_view_state::IsSet, { /// Build the final struct pub fn build(self) -> TagApplicationView<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/bookmark.rs b/crates/weaver-api/src/sh_weaver/graph/bookmark.rs index e4116a5..3df9e50 100644 --- a/crates/weaver-api/src/sh_weaver/graph/bookmark.rs +++ b/crates/weaver-api/src/sh_weaver/graph/bookmark.rs @@ -38,37 +38,37 @@ pub mod bookmark_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(()); } } @@ -158,8 +158,8 @@ where impl<'a, S> BookmarkBuilder<'a, S> where S: bookmark_state::State, - S::Subject: bookmark_state::IsSet, S::CreatedAt: bookmark_state::IsSet, + S::Subject: bookmark_state::IsSet, { /// Build the final struct pub fn build(self) -> Bookmark<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/list.rs b/crates/weaver-api/src/sh_weaver/graph/list.rs index 8ef67d5..63aa51d 100644 --- a/crates/weaver-api/src/sh_weaver/graph/list.rs +++ b/crates/weaver-api/src/sh_weaver/graph/list.rs @@ -129,51 +129,51 @@ pub mod list_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; - type Purpose; type CreatedAt; + type Purpose; + 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 Purpose = Unset; type CreatedAt = Unset; + type Purpose = 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 `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; type Purpose = S::Purpose; - type CreatedAt = S::CreatedAt; + type Name = S::Name; } ///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 = 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 CreatedAt = S::CreatedAt; type Purpose = S::Purpose; - type CreatedAt = 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 `purpose` field - pub struct purpose(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `purpose` field + pub struct purpose(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -306,9 +306,9 @@ where impl<'a, S> ListBuilder<'a, S> where S: list_state::State, - S::Name: list_state::IsSet, - S::Purpose: list_state::IsSet, S::CreatedAt: list_state::IsSet, + S::Purpose: list_state::IsSet, + S::Name: list_state::IsSet, { /// Build the final struct pub fn build(self) -> List<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/listitem.rs b/crates/weaver-api/src/sh_weaver/graph/listitem.rs index a04b57d..c3e1866 100644 --- a/crates/weaver-api/src/sh_weaver/graph/listitem.rs +++ b/crates/weaver-api/src/sh_weaver/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 Subject; type CreatedAt; type List; - 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; type List = 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; + type CreatedAt = S::CreatedAt; + type List = S::List; } ///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 List = S::List; - type Subject = S::Subject; } ///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 List = 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 List = S::List; - type Subject = Set; + type List = 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 `list` field pub struct list(()); - ///Marker type for the `subject` field - pub struct subject(()); } } @@ -174,9 +174,9 @@ where impl<'a, S> ListitemBuilder<'a, S> where S: listitem_state::State, + S::Subject: listitem_state::IsSet, S::CreatedAt: listitem_state::IsSet, S::List: listitem_state::IsSet, - S::Subject: listitem_state::IsSet, { /// Build the final struct pub fn build(self) -> Listitem<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/subscribe.rs b/crates/weaver-api/src/sh_weaver/graph/subscribe.rs index a57472a..457be89 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/tag.rs b/crates/weaver-api/src/sh_weaver/graph/tag.rs index 58c5ed7..8064b87 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 Tag; type Subject; type CreatedAt; + type Tag; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Tag = Unset; type Subject = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `tag` field to Set - pub struct SetTag(PhantomData S>); - impl sealed::Sealed for SetTag {} - impl State for SetTag { - type Tag = Set; - type Subject = S::Subject; - type CreatedAt = S::CreatedAt; + type Tag = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Tag = S::Tag; type Subject = Set; type CreatedAt = S::CreatedAt; + type Tag = S::Tag; } ///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 = S::Tag; type Subject = S::Subject; type CreatedAt = Set; + type Tag = S::Tag; + } + ///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 CreatedAt = S::CreatedAt; + type Tag = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `tag` field - pub struct tag(()); ///Marker type for the `subject` field pub struct subject(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `tag` field + pub struct tag(()); } } @@ -174,9 +174,9 @@ where impl<'a, S> TagBuilder<'a, S> where S: tag_state::State, - S::Tag: tag_state::IsSet, S::Subject: tag_state::IsSet, S::CreatedAt: tag_state::IsSet, + S::Tag: 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 24da6f5..55b3728 100644 --- a/crates/weaver-api/src/sh_weaver/notebook.rs +++ b/crates/weaver-api/src/sh_weaver/notebook.rs @@ -2174,37 +2174,37 @@ pub mod book_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(()); } } @@ -2317,8 +2317,8 @@ impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> { impl<'a, S> BookEntryViewBuilder<'a, S> where S: book_entry_view_state::State, - S::Index: book_entry_view_state::IsSet, S::Entry: book_entry_view_state::IsSet, + S::Index: book_entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> BookEntryView<'a> { @@ -2399,37 +2399,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(()); } } @@ -2542,8 +2542,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> { @@ -2634,105 +2634,105 @@ pub mod chapter_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; - type Authors; type Record; + type Notebook; + type Cid; type IndexedAt; + type Authors; type Uri; - type Notebook; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; - type Authors = Unset; type Record = Unset; + type Notebook = Unset; + type Cid = Unset; type IndexedAt = Unset; + type Authors = Unset; type Uri = Unset; - type Notebook = 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 Authors = S::Authors; - type Record = S::Record; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - 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 Cid = S::Cid; - type Authors = Set; - type Record = S::Record; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - 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 Record = Set; + type Notebook = S::Notebook; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; type Authors = S::Authors; - 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 Record = S::Record; + type Notebook = Set; + type Cid = S::Cid; type IndexedAt = S::IndexedAt; + 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 Record = S::Record; type Notebook = S::Notebook; + type Cid = Set; + type IndexedAt = S::IndexedAt; + type Authors = S::Authors; + 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 Authors = S::Authors; type Record = S::Record; + type Notebook = S::Notebook; + type Cid = S::Cid; type IndexedAt = 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 Record = S::Record; type Notebook = S::Notebook; + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + 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 Cid = S::Cid; - type Authors = S::Authors; type Record = S::Record; - type IndexedAt = S::IndexedAt; - type Uri = 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 Cid = S::Cid; - type Authors = S::Authors; - type Record = S::Record; type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - type Notebook = Set; + type Authors = S::Authors; + 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 `authors` field - pub struct authors(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `notebook` field + pub struct notebook(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///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(()); } } @@ -2949,12 +2949,12 @@ where impl<'a, S> ChapterViewBuilder<'a, S> where S: chapter_view_state::State, - S::Cid: chapter_view_state::IsSet, - S::Authors: chapter_view_state::IsSet, S::Record: chapter_view_state::IsSet, + S::Notebook: chapter_view_state::IsSet, + S::Cid: chapter_view_state::IsSet, S::IndexedAt: chapter_view_state::IsSet, + S::Authors: chapter_view_state::IsSet, S::Uri: chapter_view_state::IsSet, - S::Notebook: chapter_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ChapterView<'a> { @@ -3338,85 +3338,85 @@ pub mod entry_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type IndexedAt; - type Authors; - type Record; type Uri; type Cid; + type Record; + type IndexedAt; + type Authors; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type IndexedAt = Unset; - type Authors = Unset; - type Record = Unset; type Uri = Unset; type Cid = 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 Authors = S::Authors; - type Record = S::Record; - type Uri = S::Uri; - type Cid = S::Cid; - } - ///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 Authors = Set; - type Record = S::Record; - type Uri = S::Uri; - type Cid = S::Cid; - } - ///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 Authors = S::Authors; - type Record = Set; - type Uri = S::Uri; - type Cid = S::Cid; + type Record = Unset; + type IndexedAt = Unset; + type Authors = Unset; } ///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 Authors = S::Authors; - type Record = S::Record; type Uri = Set; type Cid = S::Cid; + type Record = S::Record; + type IndexedAt = S::IndexedAt; + type Authors = S::Authors; } ///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 Record = S::Record; type IndexedAt = S::IndexedAt; type Authors = S::Authors; + } + ///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 Authors = S::Authors; + } + ///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 Record = S::Record; + type IndexedAt = Set; + type Authors = S::Authors; + } + ///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 Cid = Set; + type Cid = S::Cid; + type Record = S::Record; + type IndexedAt = S::IndexedAt; + type Authors = 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 `authors` field - pub struct authors(()); - ///Marker type for the `record` field - pub struct record(()); ///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 `authors` field + pub struct authors(()); } } @@ -3753,11 +3753,11 @@ impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { impl<'a, S> EntryViewBuilder<'a, S> where S: entry_view_state::State, - S::IndexedAt: entry_view_state::IsSet, - S::Authors: entry_view_state::IsSet, - S::Record: entry_view_state::IsSet, S::Uri: entry_view_state::IsSet, S::Cid: entry_view_state::IsSet, + S::Record: entry_view_state::IsSet, + S::IndexedAt: entry_view_state::IsSet, + S::Authors: entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> EntryView<'a> { @@ -4049,37 +4049,37 @@ pub mod feed_notebook_context_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Title; + 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 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 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 Uri = S::Uri; type Title = 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 Title = S::Title; + 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 `title` field pub struct title(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -4169,8 +4169,8 @@ where impl<'a, S> FeedNotebookContextBuilder<'a, S> where S: feed_notebook_context_state::State, - S::Uri: feed_notebook_context_state::IsSet, S::Title: feed_notebook_context_state::IsSet, + S::Uri: feed_notebook_context_state::IsSet, { /// Build the final struct pub fn build(self) -> FeedNotebookContext<'a> { @@ -4309,84 +4309,84 @@ pub mod notebook_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Record; + type IndexedAt; type Cid; - type Uri; type Authors; - type IndexedAt; + 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 IndexedAt = Unset; type Cid = Unset; - type Uri = Unset; type Authors = Unset; - type IndexedAt = 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 IndexedAt = S::IndexedAt; type Cid = S::Cid; + type Authors = S::Authors; 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 IndexedAt = Set; + type Cid = S::Cid; type Authors = S::Authors; - type IndexedAt = S::IndexedAt; + 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 Cid = Set; - type Uri = S::Uri; - type Authors = S::Authors; 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 Cid = S::Cid; - type Uri = Set; + type Cid = Set; type Authors = S::Authors; - type IndexedAt = S::IndexedAt; + 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 Record = S::Record; + type IndexedAt = S::IndexedAt; type Cid = S::Cid; - type Uri = S::Uri; type Authors = Set; - type IndexedAt = S::IndexedAt; + 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 Record = S::Record; + type IndexedAt = S::IndexedAt; type Cid = S::Cid; - type Uri = S::Uri; type Authors = S::Authors; - type IndexedAt = 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 `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `authors` field pub struct authors(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -4754,10 +4754,10 @@ impl<'a, S> NotebookViewBuilder<'a, S> where S: notebook_view_state::State, S::Record: notebook_view_state::IsSet, + S::IndexedAt: notebook_view_state::IsSet, S::Cid: notebook_view_state::IsSet, - S::Uri: notebook_view_state::IsSet, S::Authors: notebook_view_state::IsSet, - S::IndexedAt: notebook_view_state::IsSet, + S::Uri: notebook_view_state::IsSet, { /// Build the final struct pub fn build(self) -> NotebookView<'a> { @@ -4872,85 +4872,85 @@ pub mod page_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type IndexedAt; type Notebook; type Uri; - type Record; 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 IndexedAt = Unset; type Notebook = Unset; type Uri = Unset; - type Record = Unset; type Cid = Unset; - type IndexedAt = Unset; + type Record = 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 Notebook = S::Notebook; + type Uri = S::Uri; + type Cid = S::Cid; + type Record = S::Record; } ///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 Notebook = Set; type Uri = S::Uri; - type Record = S::Record; 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 Notebook = S::Notebook; - type Uri = Set; - type Record = S::Record; - 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 Notebook = S::Notebook; - type Uri = S::Uri; - type Record = Set; + type Uri = Set; type Cid = S::Cid; - 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 IndexedAt = S::IndexedAt; type Notebook = S::Notebook; type Uri = S::Uri; - type Record = S::Record; type Cid = 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 { + ///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 Notebook = S::Notebook; type Uri = S::Uri; - type Record = S::Record; 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 `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `notebook` field pub struct notebook(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `record` field - pub struct record(()); ///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(()); } } @@ -5137,11 +5137,11 @@ where impl<'a, S> PageViewBuilder<'a, S> where S: page_view_state::State, + S::IndexedAt: page_view_state::IsSet, S::Notebook: page_view_state::IsSet, S::Uri: page_view_state::IsSet, - S::Record: page_view_state::IsSet, S::Cid: page_view_state::IsSet, - S::IndexedAt: page_view_state::IsSet, + S::Record: page_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PageView<'a> { @@ -5233,65 +5233,65 @@ pub mod permission_grant_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type GrantedAt; - type Scope; type Did; + type Scope; + type GrantedAt; type Source; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type GrantedAt = Unset; - type Scope = Unset; type Did = Unset; + type Scope = Unset; + type GrantedAt = Unset; type Source = Unset; } - ///State transition - sets the `granted_at` field to Set - pub struct SetGrantedAt(PhantomData S>); - impl sealed::Sealed for SetGrantedAt {} - impl State for SetGrantedAt { - type GrantedAt = 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 Scope = S::Scope; - type Did = S::Did; + type GrantedAt = S::GrantedAt; 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 Scope = Set; type Did = S::Did; + type Scope = Set; + type GrantedAt = S::GrantedAt; 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 GrantedAt = S::GrantedAt; + ///State transition - sets the `granted_at` field to Set + pub struct SetGrantedAt(PhantomData S>); + impl sealed::Sealed for SetGrantedAt {} + impl State for SetGrantedAt { + type Did = S::Did; type Scope = S::Scope; - type Did = Set; + type GrantedAt = 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 Scope = S::Scope; type Did = S::Did; + type Scope = S::Scope; + type GrantedAt = S::GrantedAt; type Source = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `granted_at` field - pub struct granted_at(()); - ///Marker type for the `scope` field - pub struct scope(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `scope` field + pub struct scope(()); + ///Marker type for the `granted_at` field + pub struct granted_at(()); ///Marker type for the `source` field pub struct source(()); } @@ -5406,9 +5406,9 @@ where impl<'a, S> PermissionGrantBuilder<'a, S> where S: permission_grant_state::State, - S::GrantedAt: permission_grant_state::IsSet, - S::Scope: permission_grant_state::IsSet, S::Did: permission_grant_state::IsSet, + S::Scope: permission_grant_state::IsSet, + S::GrantedAt: permission_grant_state::IsSet, S::Source: permission_grant_state::IsSet, { /// Build the final struct @@ -5758,67 +5758,67 @@ pub mod published_version_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Publisher; type PublishedAt; - type Cid; + type Publisher; type Uri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Publisher = Unset; type PublishedAt = Unset; - type Cid = Unset; + type Publisher = Unset; type Uri = Unset; - } - ///State transition - sets the `publisher` field to Set - pub struct SetPublisher(PhantomData S>); - impl sealed::Sealed for SetPublisher {} - impl State for SetPublisher { - type Publisher = Set; - type PublishedAt = S::PublishedAt; - type Cid = S::Cid; - type Uri = S::Uri; + type Cid = Unset; } ///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 = S::Publisher; type PublishedAt = Set; - type Cid = S::Cid; + type Publisher = S::Publisher; type Uri = S::Uri; + 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 Publisher = S::Publisher; + ///State transition - sets the `publisher` field to Set + pub struct SetPublisher(PhantomData S>); + impl sealed::Sealed for SetPublisher {} + impl State for SetPublisher { type PublishedAt = S::PublishedAt; - type Cid = Set; + type Publisher = 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 Publisher = S::Publisher; type PublishedAt = S::PublishedAt; - type Cid = S::Cid; + type Publisher = S::Publisher; 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 PublishedAt = S::PublishedAt; + type Publisher = S::Publisher; + type Uri = S::Uri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `publisher` field - pub struct publisher(()); ///Marker type for the `published_at` field pub struct published_at(()); - ///Marker type for the `cid` field - pub struct cid(()); + ///Marker type for the `publisher` field + pub struct publisher(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -5991,10 +5991,10 @@ where impl<'a, S> PublishedVersionViewBuilder<'a, S> where S: published_version_view_state::State, - S::Publisher: published_version_view_state::IsSet, S::PublishedAt: published_version_view_state::IsSet, - S::Cid: published_version_view_state::IsSet, + S::Publisher: published_version_view_state::IsSet, S::Uri: published_version_view_state::IsSet, + S::Cid: published_version_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PublishedVersionView<'a> { @@ -6418,37 +6418,37 @@ pub mod reason_like_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(()); } } @@ -6521,8 +6521,8 @@ where impl<'a, S> ReasonLikeBuilder<'a, S> where S: reason_like_state::State, - S::By: reason_like_state::IsSet, S::IndexedAt: reason_like_state::IsSet, + S::By: reason_like_state::IsSet, { /// Build the final struct pub fn build(self) -> ReasonLike<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/book.rs b/crates/weaver-api/src/sh_weaver/notebook/book.rs index d6b0415..cf523b5 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/book.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/book.rs @@ -63,37 +63,37 @@ pub mod book_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Authors; type EntryList; + type Authors; } /// 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; - } - ///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 Authors = Unset; } ///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; + } + ///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; } /// 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(()); } } @@ -352,8 +352,8 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { impl<'a, S> BookBuilder<'a, S> where S: book_state::State, - S::Authors: book_state::IsSet, S::EntryList: book_state::IsSet, + S::Authors: book_state::IsSet, { /// Build the final struct pub fn build(self) -> Book<'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 4483a55..c7a8e91 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 Colours; type Name; type Variant; - type Colours; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Colours = Unset; type Name = Unset; type Variant = Unset; - type Colours = Unset; + } + ///State transition - sets the `colours` field to Set + pub struct SetColours(PhantomData S>); + impl sealed::Sealed for SetColours {} + impl State for SetColours { + 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 Colours = S::Colours; type Name = Set; type Variant = S::Variant; - type Colours = S::Colours; } ///State transition - sets the `variant` field to Set pub struct SetVariant(PhantomData S>); impl sealed::Sealed for SetVariant {} impl State for SetVariant { - type Name = S::Name; - type Variant = Set; type Colours = S::Colours; - } - ///State transition - sets the `colours` field to Set - pub struct SetColours(PhantomData S>); - impl sealed::Sealed for SetColours {} - impl State for SetColours { type Name = S::Name; - type Variant = S::Variant; - type Colours = Set; + type Variant = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///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(()); - ///Marker type for the `colours` field - pub struct colours(()); } } @@ -175,9 +175,9 @@ where impl<'a, S> ColourSchemeBuilder<'a, S> where S: colour_scheme_state::State, + S::Colours: colour_scheme_state::IsSet, S::Name: colour_scheme_state::IsSet, S::Variant: colour_scheme_state::IsSet, - S::Colours: 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 3edc016..f288cf0 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/entry.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/entry.rs @@ -60,67 +60,67 @@ 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 Content; - type CreatedAt; + 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 CreatedAt = Unset; type Title = Unset; type Content = Unset; - type CreatedAt = Unset; + type Path = 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; + ///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 Title = S::Title; type Content = S::Content; - type CreatedAt = S::CreatedAt; + type Path = S::Path; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData S>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { - type Path = S::Path; + type CreatedAt = S::CreatedAt; type Title = Set; type Content = S::Content; - type CreatedAt = S::CreatedAt; + type Path = S::Path; } ///State transition - sets the `content` field to Set pub struct SetContent(PhantomData S>); impl sealed::Sealed for SetContent {} impl State for SetContent { - type Path = S::Path; + type CreatedAt = S::CreatedAt; type Title = S::Title; type Content = 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 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 CreatedAt = S::CreatedAt; type Title = S::Title; type Content = S::Content; - type CreatedAt = Set; + 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 `created_at` field + pub struct created_at(()); ///Marker type for the `title` field pub struct title(()); ///Marker type for the `content` field pub struct content(()); - ///Marker type for the `created_at` field - pub struct created_at(()); + ///Marker type for the `path` field + pub struct path(()); } } @@ -358,10 +358,10 @@ impl<'a, S: entry_state::State> EntryBuilder<'a, S> { 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::Content: entry_state::IsSet, - S::CreatedAt: entry_state::IsSet, + S::Path: entry_state::IsSet, { /// Build the final struct pub fn build(self) -> Entry<'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 index 10e5538..c44c50b 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/get_entry_notebooks.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/get_entry_notebooks.rs @@ -188,37 +188,37 @@ pub mod notebook_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(()); } } @@ -328,8 +328,8 @@ where impl<'a, S> NotebookRefBuilder<'a, S> where S: notebook_ref_state::State, - S::Uri: notebook_ref_state::IsSet, S::Cid: notebook_ref_state::IsSet, + S::Uri: notebook_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> NotebookRef<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_reading_history.rs b/crates/weaver-api/src/sh_weaver/notebook/get_reading_history.rs index ff8988d..0b24542 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/get_reading_history.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/get_reading_history.rs @@ -214,37 +214,37 @@ pub mod reading_history_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Progress; type Notebook; + type Progress; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Progress = Unset; type Notebook = Unset; - } - ///State transition - sets the `progress` field to Set - pub struct SetProgress(PhantomData S>); - impl sealed::Sealed for SetProgress {} - impl State for SetProgress { - type Progress = Set; - type Notebook = S::Notebook; + type Progress = Unset; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { - type Progress = S::Progress; type Notebook = Set; + type Progress = S::Progress; + } + ///State transition - sets the `progress` field to Set + pub struct SetProgress(PhantomData S>); + impl sealed::Sealed for SetProgress {} + impl State for SetProgress { + type Notebook = S::Notebook; + type Progress = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `progress` field - pub struct progress(()); ///Marker type for the `notebook` field pub struct notebook(()); + ///Marker type for the `progress` field + pub struct progress(()); } } @@ -337,8 +337,8 @@ where impl<'a, S> ReadingHistoryItemBuilder<'a, S> where S: reading_history_item_state::State, - S::Progress: reading_history_item_state::IsSet, S::Notebook: reading_history_item_state::IsSet, + S::Progress: reading_history_item_state::IsSet, { /// Build the final struct pub fn build(self) -> ReadingHistoryItem<'a> { 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 c3a33bf..9275137 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 Actor; type Notebook; type Entry; - 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 Notebook = Unset; type Entry = Unset; - 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; + type Notebook = S::Notebook; + 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 Actor = S::Actor; type Notebook = Set; type Entry = S::Entry; - type Actor = S::Actor; } ///State transition - sets the `entry` field to Set pub struct SetEntry(PhantomData S>); impl sealed::Sealed for SetEntry {} impl State for SetEntry { - type Notebook = S::Notebook; - type Entry = 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 = S::Notebook; - type Entry = S::Entry; - type Actor = Set; + type Entry = 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 `notebook` field pub struct notebook(()); ///Marker type for the `entry` field pub struct entry(()); - ///Marker type for the `actor` field - pub struct actor(()); } } @@ -171,9 +171,9 @@ where impl<'a, S> ResolveEntryBuilder<'a, S> where S: resolve_entry_state::State, + S::Actor: resolve_entry_state::IsSet, S::Notebook: resolve_entry_state::IsSet, S::Entry: resolve_entry_state::IsSet, - S::Actor: resolve_entry_state::IsSet, { /// Build the final struct pub fn build(self) -> ResolveEntry<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs b/crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs index d0d9b2f..baed045 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs @@ -38,37 +38,37 @@ pub mod resolve_notebook_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Actor; type Name; + 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 Name = 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 Name = S::Name; + type Actor = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Actor = S::Actor; type Name = 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 Name = S::Name; + 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 `name` field pub struct name(()); + ///Marker type for the `actor` field + pub struct actor(()); } } @@ -175,8 +175,8 @@ where impl<'a, S> ResolveNotebookBuilder<'a, S> where S: resolve_notebook_state::State, - S::Actor: resolve_notebook_state::IsSet, S::Name: resolve_notebook_state::IsSet, + S::Actor: resolve_notebook_state::IsSet, { /// Build the final struct pub fn build(self) -> ResolveNotebook<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/theme.rs b/crates/weaver-api/src/sh_weaver/notebook/theme.rs index 059a5ab..944c171 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 Content; type Name; type Did; - type Content; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Content = Unset; type Name = Unset; type Did = Unset; - type Content = Unset; + } + ///State transition - sets the `content` field to Set + pub struct SetContent(PhantomData S>); + impl sealed::Sealed for SetContent {} + impl State for SetContent { + 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; - 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; - } - ///State transition - sets the `content` field to Set - pub struct SetContent(PhantomData S>); - impl sealed::Sealed for SetContent {} - impl State for SetContent { type Name = S::Name; - type Did = S::Did; - type Content = Set; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///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(()); - ///Marker type for the `content` field - pub struct content(()); } } @@ -173,9 +173,9 @@ where impl<'a, S> CodeThemeFileBuilder<'a, S> where S: code_theme_file_state::State, + S::Content: code_theme_file_state::IsSet, S::Name: code_theme_file_state::IsSet, S::Did: code_theme_file_state::IsSet, - S::Content: 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 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(()); } } @@ -974,9 +974,9 @@ where impl<'a, S> FontFileBuilder<'a, S> where S: font_file_state::State, + S::Did: font_file_state::IsSet, S::Content: font_file_state::IsSet, S::Name: font_file_state::IsSet, - S::Did: font_file_state::IsSet, { /// Build the final struct pub fn build(self) -> FontFile<'a> { @@ -1068,104 +1068,104 @@ pub mod theme_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type DarkScheme; - type DarkCodeTheme; - type Spacing; type LightScheme; - type Fonts; + type Spacing; + type DarkCodeTheme; type LightCodeTheme; + type Fonts; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type DarkScheme = Unset; - type DarkCodeTheme = Unset; - type Spacing = Unset; type LightScheme = Unset; - type Fonts = Unset; + type Spacing = Unset; + type DarkCodeTheme = Unset; type LightCodeTheme = Unset; + type Fonts = Unset; } ///State transition - sets the `dark_scheme` field to Set pub struct SetDarkScheme(PhantomData S>); impl sealed::Sealed for SetDarkScheme {} impl State for SetDarkScheme { type DarkScheme = Set; - type DarkCodeTheme = S::DarkCodeTheme; - type Spacing = S::Spacing; type LightScheme = S::LightScheme; - type Fonts = S::Fonts; + type Spacing = S::Spacing; + type DarkCodeTheme = S::DarkCodeTheme; type LightCodeTheme = S::LightCodeTheme; + type Fonts = S::Fonts; } - ///State transition - sets the `dark_code_theme` field to Set - pub struct SetDarkCodeTheme(PhantomData S>); - impl sealed::Sealed for SetDarkCodeTheme {} - impl State for SetDarkCodeTheme { + ///State transition - sets the `light_scheme` field to Set + pub struct SetLightScheme(PhantomData S>); + impl sealed::Sealed for SetLightScheme {} + impl State for SetLightScheme { type DarkScheme = S::DarkScheme; - type DarkCodeTheme = Set; + type LightScheme = Set; type Spacing = S::Spacing; - type LightScheme = S::LightScheme; - type Fonts = S::Fonts; + type DarkCodeTheme = S::DarkCodeTheme; type LightCodeTheme = S::LightCodeTheme; + type Fonts = S::Fonts; } ///State transition - sets the `spacing` field to Set pub struct SetSpacing(PhantomData S>); impl sealed::Sealed for SetSpacing {} impl State for SetSpacing { type DarkScheme = S::DarkScheme; - type DarkCodeTheme = S::DarkCodeTheme; - type Spacing = Set; type LightScheme = S::LightScheme; - type Fonts = S::Fonts; - type LightCodeTheme = S::LightCodeTheme; - } - ///State transition - sets the `light_scheme` field to Set - pub struct SetLightScheme(PhantomData S>); - impl sealed::Sealed for SetLightScheme {} - impl State for SetLightScheme { - type DarkScheme = S::DarkScheme; + type Spacing = Set; type DarkCodeTheme = S::DarkCodeTheme; - type Spacing = S::Spacing; - type LightScheme = Set; - type Fonts = S::Fonts; type LightCodeTheme = S::LightCodeTheme; + type Fonts = S::Fonts; } - ///State transition - sets the `fonts` field to Set - pub struct SetFonts(PhantomData S>); - impl sealed::Sealed for SetFonts {} - impl State for SetFonts { + ///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 DarkScheme = S::DarkScheme; - type DarkCodeTheme = S::DarkCodeTheme; - type Spacing = S::Spacing; type LightScheme = S::LightScheme; - type Fonts = Set; + type Spacing = S::Spacing; + type DarkCodeTheme = Set; type LightCodeTheme = S::LightCodeTheme; + type Fonts = S::Fonts; } ///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 DarkScheme = S::DarkScheme; - type DarkCodeTheme = S::DarkCodeTheme; - type Spacing = S::Spacing; type LightScheme = S::LightScheme; - type Fonts = S::Fonts; + type Spacing = S::Spacing; + type DarkCodeTheme = S::DarkCodeTheme; type LightCodeTheme = Set; + type Fonts = S::Fonts; + } + ///State transition - sets the `fonts` field to Set + pub struct SetFonts(PhantomData S>); + impl sealed::Sealed for SetFonts {} + impl State for SetFonts { + type DarkScheme = S::DarkScheme; + type LightScheme = S::LightScheme; + type Spacing = S::Spacing; + type DarkCodeTheme = S::DarkCodeTheme; + type LightCodeTheme = S::LightCodeTheme; + type Fonts = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///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 `spacing` field - pub struct spacing(()); ///Marker type for the `light_scheme` field pub struct light_scheme(()); - ///Marker type for the `fonts` field - pub struct fonts(()); + ///Marker type for the `spacing` field + pub struct spacing(()); + ///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(()); } } @@ -1339,11 +1339,11 @@ impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, S::DarkScheme: theme_state::IsSet, - S::DarkCodeTheme: theme_state::IsSet, - S::Spacing: theme_state::IsSet, S::LightScheme: theme_state::IsSet, - S::Fonts: theme_state::IsSet, + S::Spacing: theme_state::IsSet, + S::DarkCodeTheme: theme_state::IsSet, S::LightCodeTheme: theme_state::IsSet, + S::Fonts: theme_state::IsSet, { /// Build the final struct pub fn build(self) -> Theme<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notification.rs b/crates/weaver-api/src/sh_weaver/notification.rs index db9b656..96f1b0e 100644 --- a/crates/weaver-api/src/sh_weaver/notification.rs +++ b/crates/weaver-api/src/sh_weaver/notification.rs @@ -52,103 +52,103 @@ pub mod notification_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reason; type Uri; - type Cid; - type Author; type IndexedAt; + type Author; + type Cid; + type Reason; type IsRead; } /// 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 Cid = Unset; - type Author = Unset; type IndexedAt = Unset; + type Author = Unset; + type Cid = Unset; + type Reason = Unset; type IsRead = 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 Cid = S::Cid; - type Author = S::Author; - type IndexedAt = S::IndexedAt; - 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 Reason = S::Reason; type Uri = Set; - type Cid = S::Cid; - type Author = S::Author; type IndexedAt = S::IndexedAt; + type Author = S::Author; + type Cid = S::Cid; + type Reason = S::Reason; 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 Reason = S::Reason; + ///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 = Set; + type IndexedAt = Set; type Author = S::Author; - type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type Reason = S::Reason; type IsRead = S::IsRead; } ///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 Cid = S::Cid; - type Author = Set; type IndexedAt = S::IndexedAt; + type Author = Set; + type Cid = S::Cid; + type Reason = S::Reason; type IsRead = S::IsRead; } - ///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 Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Author = S::Author; + type Cid = Set; type Reason = S::Reason; + type IsRead = S::IsRead; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { type Uri = S::Uri; - type Cid = S::Cid; + type IndexedAt = S::IndexedAt; type Author = S::Author; - type IndexedAt = Set; + type Cid = S::Cid; + type Reason = Set; type IsRead = S::IsRead; } ///State transition - sets the `is_read` field to Set pub struct SetIsRead(PhantomData S>); impl sealed::Sealed for SetIsRead {} impl State for SetIsRead { - type Reason = S::Reason; type Uri = S::Uri; - type Cid = S::Cid; - type Author = S::Author; type IndexedAt = S::IndexedAt; + type Author = S::Author; + type Cid = S::Cid; + type Reason = S::Reason; type IsRead = 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 `cid` field - pub struct cid(()); - ///Marker type for the `author` field - pub struct author(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `reason` field + pub struct reason(()); ///Marker type for the `is_read` field pub struct is_read(()); } @@ -343,11 +343,11 @@ where impl<'a, S> NotificationBuilder<'a, S> where S: notification_state::State, - S::Reason: notification_state::IsSet, S::Uri: notification_state::IsSet, - S::Cid: notification_state::IsSet, - S::Author: notification_state::IsSet, S::IndexedAt: notification_state::IsSet, + S::Author: notification_state::IsSet, + S::Cid: notification_state::IsSet, + S::Reason: notification_state::IsSet, S::IsRead: notification_state::IsSet, { /// Build the final struct @@ -801,85 +801,85 @@ pub mod notification_group_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; - type Actors; type MostRecentAt; - type Reason; type Count; + type Subject; + type Reason; + type Actors; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; - type Actors = Unset; type MostRecentAt = Unset; - type Reason = Unset; type Count = 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 Actors = S::Actors; - type MostRecentAt = S::MostRecentAt; - type Reason = S::Reason; - type Count = S::Count; - } - ///State transition - sets the `actors` field to Set - pub struct SetActors(PhantomData S>); - impl sealed::Sealed for SetActors {} - impl State for SetActors { - type Subject = S::Subject; - type Actors = Set; - type MostRecentAt = S::MostRecentAt; - type Reason = S::Reason; - type Count = S::Count; + type Subject = Unset; + type Reason = Unset; + type Actors = Unset; } ///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 MostRecentAt = Set; + type Count = S::Count; type Subject = S::Subject; + type Reason = S::Reason; type Actors = S::Actors; - type MostRecentAt = Set; + } + ///State transition - sets the `count` field to Set + pub struct SetCount(PhantomData S>); + impl sealed::Sealed for SetCount {} + impl State for SetCount { + type MostRecentAt = S::MostRecentAt; + type Count = Set; + type Subject = S::Subject; type Reason = S::Reason; + type Actors = S::Actors; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type MostRecentAt = S::MostRecentAt; type Count = S::Count; + type Subject = Set; + type Reason = S::Reason; + type Actors = S::Actors; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); impl sealed::Sealed for SetReason {} impl State for SetReason { - type Subject = S::Subject; - type Actors = S::Actors; type MostRecentAt = S::MostRecentAt; - type Reason = 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 Subject = S::Subject; + type Reason = 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 MostRecentAt = S::MostRecentAt; + type Count = S::Count; + type Subject = S::Subject; type Reason = S::Reason; - type Count = Set; + type Actors = 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 `actors` field - pub struct actors(()); ///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 `subject` field + pub struct subject(()); + ///Marker type for the `reason` field + pub struct reason(()); + ///Marker type for the `actors` field + pub struct actors(()); } } @@ -1026,11 +1026,11 @@ where impl<'a, S> NotificationGroupBuilder<'a, S> where S: notification_group_state::State, - S::Subject: notification_group_state::IsSet, - S::Actors: notification_group_state::IsSet, S::MostRecentAt: notification_group_state::IsSet, - S::Reason: notification_group_state::IsSet, S::Count: notification_group_state::IsSet, + S::Subject: notification_group_state::IsSet, + S::Reason: notification_group_state::IsSet, + S::Actors: notification_group_state::IsSet, { /// Build the final struct pub fn build(self) -> NotificationGroup<'a> { @@ -1292,49 +1292,49 @@ 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 NewEntries; type Notebook; } /// 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 NewEntries = Unset; type Notebook = 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 NewEntries = S::NewEntries; + type Notebook = S::Notebook; + } + ///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 NewEntries = 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 NewEntries = S::NewEntries; type UpdatedAt = S::UpdatedAt; + type NewEntries = S::NewEntries; 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 `new_entries` field + pub struct new_entries(()); ///Marker type for the `notebook` field pub struct notebook(()); } @@ -1461,8 +1461,8 @@ 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::NewEntries: subscription_update_view_state::IsSet, S::Notebook: subscription_update_view_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/site_standard.rs b/crates/weaver-api/src/site_standard.rs index 1228878..8b95214 100644 --- a/crates/weaver-api/src/site_standard.rs +++ b/crates/weaver-api/src/site_standard.rs @@ -4,5 +4,6 @@ // Any manual changes will be overwritten on the next regeneration. pub mod document; +pub mod graph; pub mod publication; pub mod theme; \ No newline at end of file diff --git a/crates/weaver-api/src/site_standard/document.rs b/crates/weaver-api/src/site_standard/document.rs index f440d2f..ff9cb19 100644 --- a/crates/weaver-api/src/site_standard/document.rs +++ b/crates/weaver-api/src/site_standard/document.rs @@ -5,6 +5,7 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. +/// A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently. #[jacquard_derive::lexicon] #[derive( serde::Serialize, @@ -17,35 +18,45 @@ )] #[serde(rename_all = "camelCase")] pub struct Document<'a> { + /// Strong reference to a Bluesky post. Useful to keep track of comments off-platform. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub bsky_post_ref: std::option::Option< crate::com_atproto::repo::strong_ref::StrongRef<'a>, >, + /// Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] - pub content: std::option::Option>>, + pub content: std::option::Option>, + /// Image to used for thumbnail or cover image. Less than 1MB is size. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub cover_image: std::option::Option>, + /// A brief description or excerpt from the document. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub description: std::option::Option>, - /// combined with the publications url to construct a full url to the document + /// Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub path: std::option::Option>, - #[serde(borrow)] - pub publication: jacquard_common::types::string::AtUri<'a>, + /// Timestamp of the documents publish time. pub published_at: jacquard_common::types::string::Datetime, + /// Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes. + #[serde(borrow)] + pub site: jacquard_common::types::string::Uri<'a>, + /// Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub tags: std::option::Option>>, + /// Plaintext representation of the documents contents. Should not contain markdown or other formatting. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub text_content: std::option::Option>, + /// Title of the document. #[serde(borrow)] pub title: jacquard_common::CowStr<'a>, + /// Timestamp of the documents last edit. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub updated_at: std::option::Option, } @@ -61,7 +72,7 @@ pub mod document_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type PublishedAt; - type Publication; + type Site; type Title; } /// Empty state - all required fields are unset @@ -69,7 +80,7 @@ pub mod document_state { impl sealed::Sealed for Empty {} impl State for Empty { type PublishedAt = Unset; - type Publication = Unset; + type Site = Unset; type Title = Unset; } ///State transition - sets the `published_at` field to Set @@ -77,15 +88,15 @@ pub mod document_state { impl sealed::Sealed for SetPublishedAt {} impl State for SetPublishedAt { type PublishedAt = Set; - type Publication = S::Publication; + type Site = S::Site; type Title = S::Title; } - ///State transition - sets the `publication` field to Set - pub struct SetPublication(PhantomData S>); - impl sealed::Sealed for SetPublication {} - impl State for SetPublication { + ///State transition - sets the `site` field to Set + pub struct SetSite(PhantomData S>); + impl sealed::Sealed for SetSite {} + impl State for SetSite { type PublishedAt = S::PublishedAt; - type Publication = Set; + type Site = Set; type Title = S::Title; } ///State transition - sets the `title` field to Set @@ -93,7 +104,7 @@ pub mod document_state { impl sealed::Sealed for SetTitle {} impl State for SetTitle { type PublishedAt = S::PublishedAt; - type Publication = S::Publication; + type Site = S::Site; type Title = Set; } /// Marker types for field names @@ -101,8 +112,8 @@ pub mod document_state { pub mod members { ///Marker type for the `published_at` field pub struct published_at(()); - ///Marker type for the `publication` field - pub struct publication(()); + ///Marker type for the `site` field + pub struct site(()); ///Marker type for the `title` field pub struct title(()); } @@ -113,12 +124,12 @@ pub struct DocumentBuilder<'a, S: document_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>, - ::core::option::Option>, ::core::option::Option, + ::core::option::Option>, ::core::option::Option>>, ::core::option::Option>, ::core::option::Option>, @@ -180,7 +191,7 @@ impl<'a, S: document_state::State> DocumentBuilder<'a, S> { /// Set the `content` field (optional) pub fn content( mut self, - value: impl Into>>>, + value: impl Into>>, ) -> Self { self.__unsafe_private_named.1 = value.into(); self @@ -188,7 +199,7 @@ impl<'a, S: document_state::State> DocumentBuilder<'a, S> { /// Set the `content` field to an Option value (optional) pub fn maybe_content( mut self, - value: Option>>, + value: Option>, ) -> Self { self.__unsafe_private_named.1 = value; self @@ -252,13 +263,13 @@ impl<'a, S: document_state::State> DocumentBuilder<'a, S> { impl<'a, S> DocumentBuilder<'a, S> where S: document_state::State, - S::Publication: document_state::IsUnset, + S::PublishedAt: document_state::IsUnset, { - /// Set the `publication` field (required) - pub fn publication( + /// Set the `publishedAt` field (required) + pub fn published_at( mut self, - value: impl Into>, - ) -> DocumentBuilder<'a, document_state::SetPublication> { + value: impl Into, + ) -> DocumentBuilder<'a, document_state::SetPublishedAt> { self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); DocumentBuilder { _phantom_state: ::core::marker::PhantomData, @@ -271,13 +282,13 @@ where impl<'a, S> DocumentBuilder<'a, S> where S: document_state::State, - S::PublishedAt: document_state::IsUnset, + S::Site: document_state::IsUnset, { - /// Set the `publishedAt` field (required) - pub fn published_at( + /// Set the `site` field (required) + pub fn site( mut self, - value: impl Into, - ) -> DocumentBuilder<'a, document_state::SetPublishedAt> { + value: impl Into>, + ) -> DocumentBuilder<'a, document_state::SetSite> { self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); DocumentBuilder { _phantom_state: ::core::marker::PhantomData, @@ -367,7 +378,7 @@ impl<'a, S> DocumentBuilder<'a, S> where S: document_state::State, S::PublishedAt: document_state::IsSet, - S::Publication: document_state::IsSet, + S::Site: document_state::IsSet, S::Title: document_state::IsSet, { /// Build the final struct @@ -378,8 +389,8 @@ where cover_image: self.__unsafe_private_named.2, description: self.__unsafe_private_named.3, path: self.__unsafe_private_named.4, - publication: self.__unsafe_private_named.5.unwrap(), - published_at: self.__unsafe_private_named.6.unwrap(), + published_at: self.__unsafe_private_named.5.unwrap(), + site: self.__unsafe_private_named.6.unwrap(), tags: self.__unsafe_private_named.7, text_content: self.__unsafe_private_named.8, title: self.__unsafe_private_named.9.unwrap(), @@ -401,8 +412,8 @@ where cover_image: self.__unsafe_private_named.2, description: self.__unsafe_private_named.3, path: self.__unsafe_private_named.4, - publication: self.__unsafe_private_named.5.unwrap(), - published_at: self.__unsafe_private_named.6.unwrap(), + published_at: self.__unsafe_private_named.5.unwrap(), + site: self.__unsafe_private_named.6.unwrap(), tags: self.__unsafe_private_named.7, text_content: self.__unsafe_private_named.8, title: self.__unsafe_private_named.9.unwrap(), @@ -412,219 +423,67 @@ where } } -fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconDoc< - 'static, -> { - ::jacquard_lexicon::lexicon::LexiconDoc { - lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, - id: ::jacquard_common::CowStr::new_static("site.standard.document"), - revision: None, - description: None, - defs: { - let mut map = ::alloc::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("main"), - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { - description: None, - required: Some( - vec![ - ::jacquard_common::smol_str::SmolStr::new_static("publication"), - ::jacquard_common::smol_str::SmolStr::new_static("title"), - ::jacquard_common::smol_str::SmolStr::new_static("publishedAt") - ], - ), - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::alloc::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "bskyPostRef", - ), - ::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("content"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { - description: None, - items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { - description: None, - refs: vec![], - closed: Some(false), - }), - min_length: None, - max_length: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "coverImage", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { - description: None, - accept: None, - max_size: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "description", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: None, - default: None, - min_length: None, - max_length: Some(3000usize), - min_graphemes: None, - max_graphemes: Some(300usize), - r#enum: None, - r#const: None, - known_values: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("path"), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: Some( - ::jacquard_common::CowStr::new_static( - "combined with the publications url to construct a full url to the document", - ), - ), - 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( - "publication", - ), - ::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.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "publishedAt", - ), - ::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("tags"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { - description: None, - items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: None, - default: None, - min_length: None, - max_length: Some(100usize), - min_graphemes: None, - max_graphemes: Some(50usize), - r#enum: None, - r#const: None, - known_values: None, - }), - min_length: None, - max_length: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "textContent", - ), - ::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("title"), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: None, - default: None, - min_length: None, - max_length: Some(1280usize), - min_graphemes: None, - max_graphemes: Some(128usize), - r#enum: None, - r#const: None, - known_values: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "updatedAt", - ), - ::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 - }, - }), - ); - map - }, +impl<'a> Document<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, DocumentRecord>, + jacquard_common::types::uri::UriError, + > { + jacquard_common::types::uri::RecordUri::try_from_uri( + jacquard_common::types::string::AtUri::new_cow(uri.into())?, + ) + } +} + +/// Typed wrapper for GetRecord response with this collection's record type. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct DocumentGetRecordOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cid: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(borrow)] + pub value: Document<'a>, +} + +impl From> for Document<'_> { + fn from(output: DocumentGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() } } +impl jacquard_common::types::collection::Collection for Document<'_> { + const NSID: &'static str = "site.standard.document"; + type Record = DocumentRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct DocumentRecord; +impl jacquard_common::xrpc::XrpcResp for DocumentRecord { + const NSID: &'static str = "site.standard.document"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = DocumentGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for DocumentRecord { + const NSID: &'static str = "site.standard.document"; + type Record = DocumentRecord; +} + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Document<'a> { fn nsid() -> &'static str { "site.standard.document" @@ -702,4 +561,250 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Document<'a> { } Ok(()) } +} + +fn lexicon_doc_site_standard_document() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("site.standard.document"), + revision: None, + description: None, + defs: { + let mut map = ::alloc::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("tid")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("site"), + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ::jacquard_common::smol_str::SmolStr::new_static("publishedAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::alloc::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "bskyPostRef", + ), + ::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("content"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: Some( + ::jacquard_common::CowStr::new_static( + "Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats.", + ), + ), + refs: vec![], + closed: Some(false), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "coverImage", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { + description: None, + accept: None, + max_size: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "A brief description or excerpt from the document.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(3000usize), + min_graphemes: None, + max_graphemes: Some(300usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("path"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash.", + ), + ), + 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( + "publishedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp of the documents publish time.", + ), + ), + 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("site"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, + ), + 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("tags"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(100usize), + min_graphemes: None, + max_graphemes: Some(50usize), + r#enum: None, + r#const: None, + known_values: None, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "textContent", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Plaintext representation of the documents contents. Should not contain markdown or other formatting.", + ), + ), + 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("title"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Title of the document.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(1280usize), + min_graphemes: None, + max_graphemes: Some(128usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "updatedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Timestamp of the documents last edit.", + ), + ), + 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 + }, + }), + }), + ); + map + }, + } } \ No newline at end of file diff --git a/crates/weaver-api/src/site_standard/graph.rs b/crates/weaver-api/src/site_standard/graph.rs new file mode 100644 index 0000000..061b7c3 --- /dev/null +++ b/crates/weaver-api/src/site_standard/graph.rs @@ -0,0 +1,6 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod subscription; \ No newline at end of file diff --git a/crates/weaver-api/src/site_standard/graph/subscription.rs b/crates/weaver-api/src/site_standard/graph/subscription.rs new file mode 100644 index 0000000..df0bdbf --- /dev/null +++ b/crates/weaver-api/src/site_standard/graph/subscription.rs @@ -0,0 +1,270 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: site.standard.graph.subscription +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Record declaring a subscription to a publication +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Subscription<'a> { + /// AT-URI reference to the publication record being subscribed to (ex: at://did:plc:abc123/site.standard.publication/xyz789). + #[serde(borrow)] + pub publication: jacquard_common::types::string::AtUri<'a>, +} + +pub mod subscription_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 Publication; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Publication = Unset; + } + ///State transition - sets the `publication` field to Set + pub struct SetPublication(PhantomData S>); + impl sealed::Sealed for SetPublication {} + impl State for SetPublication { + type Publication = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `publication` field + pub struct publication(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SubscriptionBuilder<'a, S: subscription_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Subscription<'a> { + /// Create a new builder for this type + pub fn new() -> SubscriptionBuilder<'a, subscription_state::Empty> { + SubscriptionBuilder::new() + } +} + +impl<'a> SubscriptionBuilder<'a, subscription_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SubscriptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubscriptionBuilder<'a, S> +where + S: subscription_state::State, + S::Publication: subscription_state::IsUnset, +{ + /// Set the `publication` field (required) + pub fn publication( + mut self, + value: impl Into>, + ) -> SubscriptionBuilder<'a, subscription_state::SetPublication> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SubscriptionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubscriptionBuilder<'a, S> +where + S: subscription_state::State, + S::Publication: subscription_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Subscription<'a> { + Subscription { + publication: self.__unsafe_private_named.0.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>, + >, + ) -> Subscription<'a> { + Subscription { + publication: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Subscription<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, SubscriptionRecord>, + jacquard_common::types::uri::UriError, + > { + jacquard_common::types::uri::RecordUri::try_from_uri( + jacquard_common::types::string::AtUri::new_cow(uri.into())?, + ) + } +} + +/// Typed wrapper for GetRecord response with this collection's record type. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SubscriptionGetRecordOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cid: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(borrow)] + pub value: Subscription<'a>, +} + +impl From> for Subscription<'_> { + fn from(output: SubscriptionGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Subscription<'_> { + const NSID: &'static str = "site.standard.graph.subscription"; + type Record = SubscriptionRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionRecord; +impl jacquard_common::xrpc::XrpcResp for SubscriptionRecord { + const NSID: &'static str = "site.standard.graph.subscription"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SubscriptionGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for SubscriptionRecord { + const NSID: &'static str = "site.standard.graph.subscription"; + type Record = SubscriptionRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Subscription<'a> { + fn nsid() -> &'static str { + "site.standard.graph.subscription" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_site_standard_graph_subscription() + } + fn validate( + &self, + ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_site_standard_graph_subscription() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("site.standard.graph.subscription"), + revision: None, + description: None, + defs: { + let mut map = ::alloc::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "Record declaring a subscription to a publication", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("tid")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("publication") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::alloc::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "publication", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "AT-URI reference to the publication record being subscribed to (ex: at://did:plc:abc123/site.standard.publication/xyz789).", + ), + ), + 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 + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/site_standard/publication.rs b/crates/weaver-api/src/site_standard/publication.rs index 9d58918..d2c3407 100644 --- a/crates/weaver-api/src/site_standard/publication.rs +++ b/crates/weaver-api/src/site_standard/publication.rs @@ -5,6 +5,7 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. +/// A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings. #[jacquard_derive::lexicon] #[derive( serde::Serialize, @@ -17,22 +18,28 @@ )] #[serde(rename_all = "camelCase")] pub struct Publication<'a> { + /// Simplified publication theme for tools and apps to utilize when displaying content. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub basic_theme: std::option::Option>, + /// Brief description of the publication. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub description: std::option::Option>, + /// Square image to identify the publication. Should be at least 256x256. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub icon: std::option::Option>, + /// Name of the publication. #[serde(borrow)] pub name: jacquard_common::CowStr<'a>, + /// Object containing platform specific preferences (with a few shared properties). #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub preferences: std::option::Option< crate::site_standard::publication::Preferences<'a>, >, + /// Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path. #[serde(borrow)] pub url: jacquard_common::types::string::Uri<'a>, } @@ -265,139 +272,67 @@ where } } -fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::LexiconDoc< - 'static, -> { - ::jacquard_lexicon::lexicon::LexiconDoc { - lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, - id: ::jacquard_common::CowStr::new_static("site.standard.publication"), - revision: None, - description: None, - defs: { - let mut map = ::alloc::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("main"), - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { - description: None, - required: Some( - vec![ - ::jacquard_common::smol_str::SmolStr::new_static("url"), - ::jacquard_common::smol_str::SmolStr::new_static("name") - ], - ), - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::alloc::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "basicTheme", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static( - "site.standard.theme.basic", - ), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "description", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: None, - default: None, - min_length: None, - max_length: Some(3000usize), - min_graphemes: None, - max_graphemes: Some(300usize), - r#enum: None, - r#const: None, - known_values: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("icon"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { - description: None, - accept: None, - max_size: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("name"), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: None, - default: None, - min_length: None, - max_length: Some(1280usize), - min_graphemes: None, - max_graphemes: Some(128usize), - r#enum: None, - r#const: None, - known_values: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "preferences", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static("#preferences"), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("url"), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: Some( - ::jacquard_lexicon::lexicon::LexStringFormat::Uri, - ), - 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("preferences"), - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { - description: None, - required: None, - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::alloc::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "showInDiscover", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { - description: None, - default: None, - r#const: None, - }), - ); - map - }, - }), - ); - map - }, +impl<'a> Publication<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, PublicationRecord>, + jacquard_common::types::uri::UriError, + > { + jacquard_common::types::uri::RecordUri::try_from_uri( + jacquard_common::types::string::AtUri::new_cow(uri.into())?, + ) + } +} + +/// Typed wrapper for GetRecord response with this collection's record type. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct PublicationGetRecordOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cid: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(borrow)] + pub value: Publication<'a>, +} + +impl From> for Publication<'_> { + fn from(output: PublicationGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() } } +impl jacquard_common::types::collection::Collection for Publication<'_> { + const NSID: &'static str = "site.standard.publication"; + type Record = PublicationRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct PublicationRecord; +impl jacquard_common::xrpc::XrpcResp for PublicationRecord { + const NSID: &'static str = "site.standard.publication"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = PublicationGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for PublicationRecord { + const NSID: &'static str = "site.standard.publication"; + type Record = PublicationRecord; +} + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Publication<'a> { fn nsid() -> &'static str { "site.standard.publication" @@ -477,6 +412,164 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Publication<'a> { } } +fn lexicon_doc_site_standard_publication() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("site.standard.publication"), + revision: None, + description: None, + defs: { + let mut map = ::alloc::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "A publication record representing a blog, website, or content platform. Publications serve as containers for documents and define the overall branding and settings.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("tid")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("url"), + ::jacquard_common::smol_str::SmolStr::new_static("name") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::alloc::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "basicTheme", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "site.standard.theme.basic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "description", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Brief description of the publication.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(3000usize), + min_graphemes: None, + max_graphemes: Some(300usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("icon"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { + description: None, + accept: None, + max_size: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Name of the publication.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(1280usize), + min_graphemes: None, + max_graphemes: Some(128usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "preferences", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#preferences"), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("url"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Base publication url (ex: https://standard.site). The canonical document URL is formed by combining this value with the document path.", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, + ), + 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("preferences"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Platform-specific preferences for the publication, including discovery and visibility settings.", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::alloc::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "showInDiscover", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +/// Platform-specific preferences for the publication, including discovery and visibility settings. #[jacquard_derive::lexicon] #[derive( serde::Serialize, @@ -490,6 +583,7 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Publication<'a> { )] #[serde(rename_all = "camelCase")] pub struct Preferences<'a> { + /// Boolean which decides whether the publication should appear in discovery feeds. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub show_in_discover: std::option::Option, } diff --git a/crates/weaver-api/src/site_standard/theme/basic.rs b/crates/weaver-api/src/site_standard/theme/basic.rs index 8bee0cb..3a74bf3 100644 --- a/crates/weaver-api/src/site_standard/theme/basic.rs +++ b/crates/weaver-api/src/site_standard/theme/basic.rs @@ -5,6 +5,7 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. +/// A simplified theme definition for publications, providing basic color customization for content display across different platforms and applications. #[jacquard_derive::lexicon] #[derive( serde::Serialize, @@ -17,12 +18,16 @@ )] #[serde(rename_all = "camelCase")] pub struct Basic<'a> { + /// Color used for links and button backgrounds. #[serde(borrow)] pub accent: crate::site_standard::theme::color::Rgb<'a>, + /// Color used for button text. #[serde(borrow)] pub accent_foreground: crate::site_standard::theme::color::Rgb<'a>, + /// Color used for content background. #[serde(borrow)] pub background: crate::site_standard::theme::color::Rgb<'a>, + /// Color used for content text. #[serde(borrow)] pub foreground: crate::site_standard::theme::color::Rgb<'a>, } @@ -37,65 +42,65 @@ pub mod basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type AccentForeground; type Accent; type Background; + type AccentForeground; type Foreground; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type AccentForeground = Unset; type Accent = Unset; type Background = Unset; + type AccentForeground = Unset; type Foreground = Unset; } - ///State transition - sets the `accent_foreground` field to Set - pub struct SetAccentForeground(PhantomData S>); - impl sealed::Sealed for SetAccentForeground {} - impl State for SetAccentForeground { - type AccentForeground = Set; - type Accent = S::Accent; - type Background = S::Background; - type Foreground = S::Foreground; - } ///State transition - sets the `accent` field to Set pub struct SetAccent(PhantomData S>); impl sealed::Sealed for SetAccent {} impl State for SetAccent { - type AccentForeground = S::AccentForeground; type Accent = Set; type Background = S::Background; + type AccentForeground = S::AccentForeground; type Foreground = S::Foreground; } ///State transition - sets the `background` field to Set pub struct SetBackground(PhantomData S>); impl sealed::Sealed for SetBackground {} impl State for SetBackground { - type AccentForeground = S::AccentForeground; type Accent = S::Accent; type Background = Set; + type AccentForeground = S::AccentForeground; + type Foreground = S::Foreground; + } + ///State transition - sets the `accent_foreground` field to Set + pub struct SetAccentForeground(PhantomData S>); + impl sealed::Sealed for SetAccentForeground {} + impl State for SetAccentForeground { + type Accent = S::Accent; + type Background = S::Background; + type AccentForeground = Set; type Foreground = S::Foreground; } ///State transition - sets the `foreground` field to Set pub struct SetForeground(PhantomData S>); impl sealed::Sealed for SetForeground {} impl State for SetForeground { - type AccentForeground = S::AccentForeground; type Accent = S::Accent; type Background = S::Background; + type AccentForeground = S::AccentForeground; type Foreground = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `accent_foreground` field - pub struct accent_foreground(()); ///Marker type for the `accent` field pub struct accent(()); ///Marker type for the `background` field pub struct background(()); + ///Marker type for the `accent_foreground` field + pub struct accent_foreground(()); ///Marker type for the `foreground` field pub struct foreground(()); } @@ -210,9 +215,9 @@ where impl<'a, S> BasicBuilder<'a, S> where S: basic_state::State, - S::AccentForeground: basic_state::IsSet, S::Accent: basic_state::IsSet, S::Background: basic_state::IsSet, + S::AccentForeground: basic_state::IsSet, S::Foreground: basic_state::IsSet, { /// Build the final struct @@ -256,7 +261,11 @@ fn lexicon_doc_site_standard_theme_basic() -> ::jacquard_lexicon::lexicon::Lexic map.insert( ::jacquard_common::smol_str::SmolStr::new_static("main"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "A simplified theme definition for publications, providing basic color customization for content display across different platforms and applications.", + ), + ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("background"), @@ -272,7 +281,11 @@ fn lexicon_doc_site_standard_theme_basic() -> ::jacquard_lexicon::lexicon::Lexic map.insert( ::jacquard_common::smol_str::SmolStr::new_static("accent"), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Color used for links and button backgrounds.", + ), + ), refs: vec![ ::jacquard_common::CowStr::new_static("site.standard.theme.color#rgb") ], @@ -284,7 +297,11 @@ fn lexicon_doc_site_standard_theme_basic() -> ::jacquard_lexicon::lexicon::Lexic "accentForeground", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Color used for button text.", + ), + ), refs: vec![ ::jacquard_common::CowStr::new_static("site.standard.theme.color#rgb") ], @@ -296,7 +313,11 @@ fn lexicon_doc_site_standard_theme_basic() -> ::jacquard_lexicon::lexicon::Lexic "background", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Color used for content background.", + ), + ), refs: vec![ ::jacquard_common::CowStr::new_static("site.standard.theme.color#rgb") ], @@ -308,7 +329,11 @@ fn lexicon_doc_site_standard_theme_basic() -> ::jacquard_lexicon::lexicon::Lexic "foreground", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { - description: None, + description: Some( + ::jacquard_common::CowStr::new_static( + "Color used for content text.", + ), + ), refs: vec![ ::jacquard_common::CowStr::new_static("site.standard.theme.color#rgb") ], diff --git a/crates/weaver-api/src/site_standard/theme/color.rs b/crates/weaver-api/src/site_standard/theme/color.rs index 0810645..f4d8f8a 100644 --- a/crates/weaver-api/src/site_standard/theme/color.rs +++ b/crates/weaver-api/src/site_standard/theme/color.rs @@ -33,50 +33,50 @@ pub mod rgb_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type G; - type B; type R; + type B; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type G = Unset; - type B = Unset; type R = Unset; + type B = Unset; } ///State transition - sets the `g` field to Set pub struct SetG(PhantomData S>); impl sealed::Sealed for SetG {} impl State for SetG { type G = Set; - type B = S::B; - type R = S::R; - } - ///State transition - sets the `b` field to Set - pub struct SetB(PhantomData S>); - impl sealed::Sealed for SetB {} - impl State for SetB { - type G = S::G; - type B = Set; type R = S::R; + type B = S::B; } ///State transition - sets the `r` field to Set pub struct SetR(PhantomData S>); impl sealed::Sealed for SetR {} impl State for SetR { type G = S::G; - type B = S::B; type R = Set; + type B = S::B; + } + ///State transition - sets the `b` field to Set + pub struct SetB(PhantomData S>); + impl sealed::Sealed for SetB {} + impl State for SetB { + type G = S::G; + type R = S::R; + type B = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `g` field pub struct g(()); - ///Marker type for the `b` field - pub struct b(()); ///Marker type for the `r` field pub struct r(()); + ///Marker type for the `b` field + pub struct b(()); } } @@ -161,8 +161,8 @@ impl<'a, S> RgbBuilder<'a, S> where S: rgb_state::State, S::G: rgb_state::IsSet, - S::B: rgb_state::IsSet, S::R: rgb_state::IsSet, + S::B: rgb_state::IsSet, { /// Build the final struct pub fn build(self) -> Rgb<'a> { @@ -439,66 +439,66 @@ pub mod rgba_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type G; - type R; type A; type B; + type R; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type G = Unset; - type R = Unset; type A = Unset; type B = Unset; + type R = Unset; } ///State transition - sets the `g` field to Set pub struct SetG(PhantomData S>); impl sealed::Sealed for SetG {} impl State for SetG { type G = Set; - type R = S::R; - type A = S::A; - type B = S::B; - } - ///State transition - sets the `r` field to Set - pub struct SetR(PhantomData S>); - impl sealed::Sealed for SetR {} - impl State for SetR { - type G = S::G; - type R = Set; type A = S::A; type B = S::B; + type R = S::R; } ///State transition - sets the `a` field to Set pub struct SetA(PhantomData S>); impl sealed::Sealed for SetA {} impl State for SetA { type G = S::G; - type R = S::R; type A = Set; type B = S::B; + type R = S::R; } ///State transition - sets the `b` field to Set pub struct SetB(PhantomData S>); impl sealed::Sealed for SetB {} impl State for SetB { type G = S::G; - type R = S::R; type A = S::A; type B = Set; + type R = S::R; + } + ///State transition - sets the `r` field to Set + pub struct SetR(PhantomData S>); + impl sealed::Sealed for SetR {} + impl State for SetR { + type G = S::G; + type A = S::A; + type B = S::B; + type R = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `g` field pub struct g(()); - ///Marker type for the `r` field - pub struct r(()); ///Marker type for the `a` field pub struct a(()); ///Marker type for the `b` field pub struct b(()); + ///Marker type for the `r` field + pub struct r(()); } } @@ -600,9 +600,9 @@ impl<'a, S> RgbaBuilder<'a, S> where S: rgba_state::State, S::G: rgba_state::IsSet, - S::R: rgba_state::IsSet, S::A: rgba_state::IsSet, S::B: rgba_state::IsSet, + S::R: rgba_state::IsSet, { /// Build the final struct pub fn build(self) -> Rgba<'a> { diff --git a/crates/weaver-api/src/tools_ozone/communication.rs b/crates/weaver-api/src/tools_ozone/communication.rs index 1fde3b9..e97fa8d 100644 --- a/crates/weaver-api/src/tools_ozone/communication.rs +++ b/crates/weaver-api/src/tools_ozone/communication.rs @@ -55,127 +55,127 @@ pub mod template_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ContentMarkdown; type Disabled; type LastUpdatedBy; - type CreatedAt; type Name; + type CreatedAt; type UpdatedAt; type Id; + type ContentMarkdown; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ContentMarkdown = Unset; type Disabled = Unset; type LastUpdatedBy = Unset; - type CreatedAt = Unset; type Name = Unset; + type CreatedAt = Unset; type UpdatedAt = Unset; type Id = Unset; - } - ///State transition - sets the `content_markdown` field to Set - pub struct SetContentMarkdown(PhantomData S>); - impl sealed::Sealed for SetContentMarkdown {} - impl State for SetContentMarkdown { - type ContentMarkdown = Set; - type Disabled = S::Disabled; - type LastUpdatedBy = S::LastUpdatedBy; - type CreatedAt = S::CreatedAt; - type Name = S::Name; - type UpdatedAt = S::UpdatedAt; - type Id = S::Id; + type ContentMarkdown = Unset; } ///State transition - sets the `disabled` field to Set pub struct SetDisabled(PhantomData S>); impl sealed::Sealed for SetDisabled {} impl State for SetDisabled { - type ContentMarkdown = S::ContentMarkdown; type Disabled = Set; type LastUpdatedBy = S::LastUpdatedBy; - type CreatedAt = S::CreatedAt; type Name = S::Name; + type CreatedAt = S::CreatedAt; type UpdatedAt = S::UpdatedAt; type Id = S::Id; + 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 ContentMarkdown = S::ContentMarkdown; type Disabled = S::Disabled; type LastUpdatedBy = Set; - type CreatedAt = S::CreatedAt; type Name = S::Name; + type CreatedAt = S::CreatedAt; type UpdatedAt = S::UpdatedAt; type Id = S::Id; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { type ContentMarkdown = S::ContentMarkdown; - type Disabled = S::Disabled; - type LastUpdatedBy = S::LastUpdatedBy; - type CreatedAt = Set; - type Name = S::Name; - type UpdatedAt = S::UpdatedAt; - type Id = S::Id; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type ContentMarkdown = S::ContentMarkdown; type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; - type CreatedAt = S::CreatedAt; type Name = Set; + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + type Id = S::Id; + 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 Disabled = S::Disabled; + type LastUpdatedBy = S::LastUpdatedBy; + type Name = S::Name; + type CreatedAt = Set; type UpdatedAt = S::UpdatedAt; type Id = S::Id; + 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 ContentMarkdown = S::ContentMarkdown; type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; - type CreatedAt = S::CreatedAt; type Name = S::Name; + type CreatedAt = S::CreatedAt; type UpdatedAt = Set; type Id = S::Id; + type ContentMarkdown = S::ContentMarkdown; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type ContentMarkdown = S::ContentMarkdown; type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; - type CreatedAt = S::CreatedAt; type Name = S::Name; + type CreatedAt = S::CreatedAt; type UpdatedAt = S::UpdatedAt; type Id = 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 Disabled = S::Disabled; + type LastUpdatedBy = S::LastUpdatedBy; + type Name = S::Name; + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + type Id = S::Id; + type ContentMarkdown = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `content_markdown` field - pub struct content_markdown(()); ///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 `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(()); ///Marker type for the `updated_at` field pub struct updated_at(()); ///Marker type for the `id` field pub struct id(()); + ///Marker type for the `content_markdown` field + pub struct content_markdown(()); } } @@ -395,13 +395,13 @@ where impl<'a, S> TemplateViewBuilder<'a, S> where S: template_view_state::State, - S::ContentMarkdown: template_view_state::IsSet, S::Disabled: template_view_state::IsSet, S::LastUpdatedBy: template_view_state::IsSet, - S::CreatedAt: template_view_state::IsSet, S::Name: template_view_state::IsSet, + S::CreatedAt: template_view_state::IsSet, S::UpdatedAt: template_view_state::IsSet, S::Id: 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 e38bf42..295f334 100644 --- a/crates/weaver-api/src/tools_ozone/moderation.rs +++ b/crates/weaver-api/src/tools_ozone/moderation.rs @@ -5307,49 +5307,49 @@ pub mod age_assurance_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Status; + type CreatedAt; type AttemptId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Status = Unset; + type CreatedAt = Unset; type AttemptId = 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 Status = S::Status; - 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 CreatedAt = S::CreatedAt; type Status = Set; + type CreatedAt = S::CreatedAt; + type AttemptId = S::AttemptId; + } + ///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 CreatedAt = 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 = S::CreatedAt; type AttemptId = 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 `status` field pub struct status(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `attempt_id` field pub struct attempt_id(()); } @@ -5589,8 +5589,8 @@ where impl<'a, S> AgeAssuranceEventBuilder<'a, S> where S: age_assurance_event_state::State, - S::CreatedAt: age_assurance_event_state::IsSet, S::Status: age_assurance_event_state::IsSet, + S::CreatedAt: age_assurance_event_state::IsSet, S::AttemptId: age_assurance_event_state::IsSet, { /// Build the final struct @@ -5927,8 +5927,8 @@ pub mod blob_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Size; - type MimeType; type Cid; + type MimeType; type CreatedAt; } /// Empty state - all required fields are unset @@ -5936,8 +5936,8 @@ pub mod blob_view_state { impl sealed::Sealed for Empty {} impl State for Empty { type Size = Unset; - type MimeType = Unset; type Cid = Unset; + type MimeType = Unset; type CreatedAt = Unset; } ///State transition - sets the `size` field to Set @@ -5945,17 +5945,8 @@ pub mod blob_view_state { impl sealed::Sealed for SetSize {} impl State for SetSize { type Size = Set; - type MimeType = S::MimeType; - type Cid = S::Cid; - type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `mime_type` field to Set - pub struct SetMimeType(PhantomData S>); - impl sealed::Sealed for SetMimeType {} - impl State for SetMimeType { - type Size = S::Size; - type MimeType = Set; type Cid = S::Cid; + type MimeType = S::MimeType; type CreatedAt = S::CreatedAt; } ///State transition - sets the `cid` field to Set @@ -5963,8 +5954,17 @@ pub mod blob_view_state { impl sealed::Sealed for SetCid {} impl State for SetCid { type Size = S::Size; - type MimeType = S::MimeType; type Cid = Set; + type MimeType = S::MimeType; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `mime_type` field to Set + pub struct SetMimeType(PhantomData S>); + impl sealed::Sealed for SetMimeType {} + impl State for SetMimeType { + type Size = S::Size; + type Cid = S::Cid; + type MimeType = Set; type CreatedAt = S::CreatedAt; } ///State transition - sets the `created_at` field to Set @@ -5972,8 +5972,8 @@ pub mod blob_view_state { impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type Size = S::Size; - type MimeType = S::MimeType; type Cid = S::Cid; + type MimeType = S::MimeType; type CreatedAt = Set; } /// Marker types for field names @@ -5981,10 +5981,10 @@ pub mod blob_view_state { pub mod members { ///Marker type for the `size` field pub struct size(()); - ///Marker type for the `mime_type` field - pub struct mime_type(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `mime_type` field + pub struct mime_type(()); ///Marker type for the `created_at` field pub struct created_at(()); } @@ -6134,8 +6134,8 @@ impl<'a, S> BlobViewBuilder<'a, S> where S: blob_view_state::State, S::Size: blob_view_state::IsSet, - S::MimeType: blob_view_state::IsSet, S::Cid: blob_view_state::IsSet, + S::MimeType: blob_view_state::IsSet, S::CreatedAt: blob_view_state::IsSet, { /// Build the final struct @@ -8132,105 +8132,105 @@ pub mod mod_event_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type SubjectBlobCids; + type Subject; + type Event; type CreatedBy; type CreatedAt; type Id; - type Event; - type Subject; + type SubjectBlobCids; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type SubjectBlobCids = Unset; + type Subject = Unset; + type Event = Unset; type CreatedBy = Unset; type CreatedAt = Unset; type Id = Unset; - type Event = Unset; - type Subject = Unset; + type SubjectBlobCids = Unset; } - ///State transition - sets the `subject_blob_cids` field to Set - pub struct SetSubjectBlobCids(PhantomData S>); - impl sealed::Sealed for SetSubjectBlobCids {} - impl State for SetSubjectBlobCids { - type SubjectBlobCids = Set; + ///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 Event = S::Event; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Id = S::Id; - type Event = S::Event; + type SubjectBlobCids = S::SubjectBlobCids; + } + ///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; + type CreatedAt = S::CreatedAt; + type Id = S::Id; + type SubjectBlobCids = S::SubjectBlobCids; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type SubjectBlobCids = S::SubjectBlobCids; + type Subject = S::Subject; + type Event = S::Event; type CreatedBy = Set; type CreatedAt = S::CreatedAt; type Id = S::Id; - type Event = S::Event; - type Subject = S::Subject; + type SubjectBlobCids = S::SubjectBlobCids; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type SubjectBlobCids = S::SubjectBlobCids; + type Subject = S::Subject; + type Event = S::Event; type CreatedBy = S::CreatedBy; type CreatedAt = Set; type Id = S::Id; - type Event = S::Event; - type Subject = S::Subject; + type SubjectBlobCids = S::SubjectBlobCids; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type SubjectBlobCids = S::SubjectBlobCids; + type Subject = S::Subject; + type Event = S::Event; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Id = 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 SubjectBlobCids = S::SubjectBlobCids; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Id = S::Id; - 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 SubjectBlobCids = S::SubjectBlobCids; + ///State transition - sets the `subject_blob_cids` field to Set + pub struct SetSubjectBlobCids(PhantomData S>); + impl sealed::Sealed for SetSubjectBlobCids {} + impl State for SetSubjectBlobCids { + type Subject = S::Subject; + type Event = S::Event; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Id = S::Id; - type Event = S::Event; - type Subject = Set; + type SubjectBlobCids = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject_blob_cids` field - pub struct subject_blob_cids(()); + ///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(()); ///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` field - pub struct event(()); - ///Marker type for the `subject` field - pub struct subject(()); + ///Marker type for the `subject_blob_cids` field + pub struct subject_blob_cids(()); } } @@ -8453,12 +8453,12 @@ impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> { impl<'a, S> ModEventViewBuilder<'a, S> where S: mod_event_view_state::State, - S::SubjectBlobCids: mod_event_view_state::IsSet, + S::Subject: mod_event_view_state::IsSet, + S::Event: mod_event_view_state::IsSet, S::CreatedBy: mod_event_view_state::IsSet, S::CreatedAt: mod_event_view_state::IsSet, S::Id: mod_event_view_state::IsSet, - S::Event: mod_event_view_state::IsSet, - S::Subject: mod_event_view_state::IsSet, + S::SubjectBlobCids: mod_event_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventView<'a> { @@ -8652,105 +8652,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 SubjectBlobs; type CreatedBy; type CreatedAt; - type Id; - type Subject; type Event; - type SubjectBlobs; + 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 SubjectBlobs = Unset; type CreatedBy = Unset; type CreatedAt = Unset; - type Id = Unset; - type Subject = Unset; type Event = Unset; - type SubjectBlobs = 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 SubjectBlobs = S::SubjectBlobs; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type Event = S::Event; + type Subject = S::Subject; + } + ///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 SubjectBlobs = Set; + type CreatedBy = S::CreatedBy; + 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 SubjectBlobs = S::SubjectBlobs; type CreatedBy = Set; type CreatedAt = S::CreatedAt; - type Id = S::Id; - type Subject = S::Subject; type Event = S::Event; - type SubjectBlobs = S::SubjectBlobs; + 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 SubjectBlobs = S::SubjectBlobs; type CreatedBy = S::CreatedBy; type CreatedAt = Set; - type Id = S::Id; - type Subject = S::Subject; type Event = S::Event; - type SubjectBlobs = S::SubjectBlobs; + 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 { + ///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 SubjectBlobs = S::SubjectBlobs; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; - type Id = Set; + type Event = Set; type Subject = S::Subject; - type Event = S::Event; - type SubjectBlobs = S::SubjectBlobs; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Id = S::Id; - type Subject = Set; - type Event = S::Event; - type SubjectBlobs = S::SubjectBlobs; - } - ///State transition - sets the `event` field to Set - pub struct SetEvent(PhantomData S>); - impl sealed::Sealed for SetEvent {} - impl State for SetEvent { - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; type Id = S::Id; - type Subject = S::Subject; - type Event = Set; 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 CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; - type Id = S::Id; - type Subject = S::Subject; type Event = S::Event; - type SubjectBlobs = 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_blobs` field + pub struct subject_blobs(()); ///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 `id` field - pub struct id(()); - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `event` field pub struct event(()); - ///Marker type for the `subject_blobs` field - pub struct subject_blobs(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -8923,12 +8923,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::SubjectBlobs: mod_event_view_detail_state::IsSet, S::CreatedBy: mod_event_view_detail_state::IsSet, S::CreatedAt: mod_event_view_detail_state::IsSet, - S::Id: mod_event_view_detail_state::IsSet, - S::Subject: mod_event_view_detail_state::IsSet, S::Event: mod_event_view_detail_state::IsSet, - S::SubjectBlobs: mod_event_view_detail_state::IsSet, + S::Subject: mod_event_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventViewDetail<'a> { @@ -9231,37 +9231,37 @@ pub mod record_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Op; type Timestamp; + type Op; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Op = Unset; type Timestamp = Unset; - } - ///State transition - sets the `op` field to Set - pub struct SetOp(PhantomData S>); - impl sealed::Sealed for SetOp {} - impl State for SetOp { - type Op = Set; - type Timestamp = S::Timestamp; + type Op = Unset; } ///State transition - sets the `timestamp` field to Set pub struct SetTimestamp(PhantomData S>); impl sealed::Sealed for SetTimestamp {} impl State for SetTimestamp { - type Op = S::Op; type Timestamp = Set; + type Op = S::Op; + } + ///State transition - sets the `op` field to Set + pub struct SetOp(PhantomData S>); + impl sealed::Sealed for SetOp {} + impl State for SetOp { + type Timestamp = S::Timestamp; + type Op = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `op` field - pub struct op(()); ///Marker type for the `timestamp` field pub struct timestamp(()); + ///Marker type for the `op` field + pub struct op(()); } } @@ -9371,8 +9371,8 @@ where impl<'a, S> RecordEventBuilder<'a, S> where S: record_event_state::State, - S::Op: record_event_state::IsSet, S::Timestamp: record_event_state::IsSet, + S::Op: record_event_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordEvent<'a> { @@ -9677,127 +9677,127 @@ pub mod record_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Repo; - type Uri; type Moderation; + type Repo; type IndexedAt; - type Cid; type BlobCids; + type Cid; type Value; + 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 Uri = Unset; type Moderation = Unset; + type Repo = Unset; type IndexedAt = Unset; - type Cid = Unset; type BlobCids = Unset; + type Cid = Unset; type Value = Unset; + type Uri = Unset; + } + ///State transition - sets the `moderation` field to Set + pub struct SetModeration(PhantomData S>); + impl sealed::Sealed for SetModeration {} + impl State for SetModeration { + type Moderation = Set; + type Repo = S::Repo; + type IndexedAt = S::IndexedAt; + type BlobCids = S::BlobCids; + type Cid = S::Cid; + type Value = S::Value; + type Uri = S::Uri; } ///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 Uri = S::Uri; type Moderation = S::Moderation; + type Repo = Set; type IndexedAt = S::IndexedAt; - type Cid = S::Cid; type BlobCids = S::BlobCids; - 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 Repo = S::Repo; - type Uri = Set; - type Moderation = S::Moderation; - type IndexedAt = S::IndexedAt; type Cid = S::Cid; - type BlobCids = S::BlobCids; type Value = S::Value; - } - ///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 Uri = S::Uri; - type Moderation = Set; - type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - type BlobCids = S::BlobCids; - type Value = S::Value; } ///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 Uri = S::Uri; type Moderation = S::Moderation; + type Repo = S::Repo; type IndexedAt = Set; - type Cid = S::Cid; type BlobCids = S::BlobCids; + type Cid = S::Cid; type Value = S::Value; - } - ///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 Uri = S::Uri; - type Moderation = S::Moderation; - type IndexedAt = S::IndexedAt; - type Cid = Set; - type BlobCids = S::BlobCids; - type Value = S::Value; } ///State transition - sets the `blob_cids` field to Set pub struct SetBlobCids(PhantomData S>); impl sealed::Sealed for SetBlobCids {} impl State for SetBlobCids { + type Moderation = S::Moderation; type Repo = S::Repo; + type IndexedAt = S::IndexedAt; + type BlobCids = Set; + type Cid = S::Cid; + type Value = S::Value; 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 Moderation = S::Moderation; + type Repo = S::Repo; type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - type BlobCids = Set; + type BlobCids = S::BlobCids; + type Cid = Set; type Value = S::Value; + 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 Moderation = S::Moderation; type Repo = S::Repo; + type IndexedAt = S::IndexedAt; + type BlobCids = S::BlobCids; + type Cid = S::Cid; + type Value = 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 Moderation = S::Moderation; + type Repo = S::Repo; type IndexedAt = S::IndexedAt; - type Cid = S::Cid; type BlobCids = S::BlobCids; - type Value = Set; + type Cid = S::Cid; + type Value = S::Value; + type Uri = 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 `uri` field - pub struct uri(()); ///Marker type for the `moderation` field pub struct moderation(()); + ///Marker type for the `repo` field + pub struct repo(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `blob_cids` field pub struct blob_cids(()); + ///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(()); } } @@ -9970,13 +9970,13 @@ where impl<'a, S> RecordViewBuilder<'a, S> where S: record_view_state::State, - S::Repo: record_view_state::IsSet, - S::Uri: record_view_state::IsSet, S::Moderation: record_view_state::IsSet, + S::Repo: record_view_state::IsSet, S::IndexedAt: record_view_state::IsSet, - S::Cid: record_view_state::IsSet, S::BlobCids: record_view_state::IsSet, + S::Cid: record_view_state::IsSet, S::Value: record_view_state::IsSet, + S::Uri: record_view_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordView<'a> { @@ -10070,126 +10070,126 @@ pub mod record_view_detail_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Blobs; + type Value; type IndexedAt; type Repo; - type Value; + type Cid; type Moderation; type Uri; - type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Blobs = Unset; + type Value = Unset; type IndexedAt = Unset; type Repo = Unset; - type Value = Unset; + type Cid = Unset; type Moderation = Unset; type Uri = Unset; - type Cid = Unset; } ///State transition - sets the `blobs` field to Set pub struct SetBlobs(PhantomData S>); impl sealed::Sealed for SetBlobs {} impl State for SetBlobs { type Blobs = Set; + type Value = S::Value; type IndexedAt = S::IndexedAt; type Repo = S::Repo; - type Value = S::Value; + type Cid = S::Cid; 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 Blobs = S::Blobs; + type Value = Set; + type IndexedAt = S::IndexedAt; + type Repo = S::Repo; type Cid = S::Cid; + 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 { type Blobs = S::Blobs; + type Value = S::Value; type IndexedAt = Set; type Repo = S::Repo; - type Value = S::Value; + type Cid = S::Cid; type Moderation = S::Moderation; type Uri = S::Uri; - type Cid = S::Cid; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { type Blobs = S::Blobs; + type Value = S::Value; type IndexedAt = S::IndexedAt; type Repo = Set; - type Value = S::Value; + type Cid = S::Cid; type Moderation = S::Moderation; type Uri = S::Uri; - type Cid = S::Cid; } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type Blobs = S::Blobs; + type Value = S::Value; type IndexedAt = S::IndexedAt; type Repo = S::Repo; - type Value = Set; + type Cid = Set; type Moderation = S::Moderation; type Uri = S::Uri; - type Cid = S::Cid; } ///State transition - sets the `moderation` field to Set pub struct SetModeration(PhantomData S>); impl sealed::Sealed for SetModeration {} impl State for SetModeration { type Blobs = S::Blobs; + type Value = S::Value; type IndexedAt = S::IndexedAt; type Repo = S::Repo; - type Value = S::Value; + type Cid = S::Cid; type Moderation = 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 Blobs = S::Blobs; - type IndexedAt = S::IndexedAt; - type Repo = S::Repo; type Value = S::Value; - type Moderation = S::Moderation; - 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 Blobs = S::Blobs; type IndexedAt = S::IndexedAt; type Repo = S::Repo; - type Value = S::Value; + type Cid = S::Cid; type Moderation = S::Moderation; - type Uri = S::Uri; - type Cid = Set; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `blobs` field pub struct blobs(()); + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `repo` field pub struct repo(()); - ///Marker type for the `value` field - pub struct value(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `moderation` field pub struct moderation(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `cid` field - pub struct cid(()); } } @@ -10383,12 +10383,12 @@ impl<'a, S> RecordViewDetailBuilder<'a, S> where S: record_view_detail_state::State, S::Blobs: record_view_detail_state::IsSet, + S::Value: record_view_detail_state::IsSet, S::IndexedAt: record_view_detail_state::IsSet, S::Repo: record_view_detail_state::IsSet, - S::Value: record_view_detail_state::IsSet, + S::Cid: record_view_detail_state::IsSet, S::Moderation: record_view_detail_state::IsSet, S::Uri: record_view_detail_state::IsSet, - S::Cid: record_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordViewDetail<'a> { @@ -10689,85 +10689,85 @@ pub mod repo_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type RelatedRecords; - type Handle; type IndexedAt; + type RelatedRecords; type Moderation; type Did; + 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 Handle = Unset; type IndexedAt = Unset; + type RelatedRecords = Unset; type Moderation = Unset; type Did = 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 Handle = S::Handle; - type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; - type Did = S::Did; - } - ///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 Handle = Set; - type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; - type Did = S::Did; + type Handle = 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 RelatedRecords = S::RelatedRecords; + type Moderation = S::Moderation; + type Did = S::Did; type Handle = S::Handle; - type IndexedAt = Set; + } + ///State transition - sets the `related_records` field to Set + pub struct SetRelatedRecords(PhantomData S>); + impl sealed::Sealed for SetRelatedRecords {} + impl State for SetRelatedRecords { + type IndexedAt = S::IndexedAt; + type RelatedRecords = 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 Handle = S::Handle; type IndexedAt = S::IndexedAt; + type RelatedRecords = S::RelatedRecords; type Moderation = 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 IndexedAt = S::IndexedAt; type RelatedRecords = S::RelatedRecords; + type Moderation = S::Moderation; + 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 IndexedAt = S::IndexedAt; + type RelatedRecords = S::RelatedRecords; type Moderation = S::Moderation; - type Did = Set; + type Did = S::Did; + 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 `handle` field - pub struct handle(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `related_records` field + pub struct related_records(()); ///Marker type for the `moderation` field pub struct moderation(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -11023,11 +11023,11 @@ 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::Handle: repo_view_state::IsSet, S::IndexedAt: repo_view_state::IsSet, + S::RelatedRecords: repo_view_state::IsSet, S::Moderation: repo_view_state::IsSet, S::Did: repo_view_state::IsSet, + S::Handle: repo_view_state::IsSet, { /// Build the final struct pub fn build(self) -> RepoView<'a> { @@ -11149,85 +11149,85 @@ pub mod repo_view_detail_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Handle; type IndexedAt; - type RelatedRecords; type Moderation; type Did; - type Handle; + type RelatedRecords; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Handle = Unset; type IndexedAt = Unset; - type RelatedRecords = Unset; type Moderation = Unset; type Did = Unset; - type Handle = Unset; + 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 Handle = Set; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Did = S::Did; + 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 IndexedAt = Set; - type RelatedRecords = S::RelatedRecords; - type Moderation = S::Moderation; - type Did = S::Did; 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 IndexedAt = S::IndexedAt; - type RelatedRecords = Set; + type IndexedAt = Set; type Moderation = S::Moderation; type Did = S::Did; - type Handle = S::Handle; + 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 Handle = S::Handle; type IndexedAt = S::IndexedAt; - type RelatedRecords = S::RelatedRecords; type Moderation = Set; type Did = S::Did; - type Handle = S::Handle; + 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 RelatedRecords = S::RelatedRecords; type Moderation = S::Moderation; type Did = Set; - type Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { + ///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 RelatedRecords = S::RelatedRecords; type Moderation = S::Moderation; type Did = S::Did; - type Handle = Set; + type RelatedRecords = 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 `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `related_records` field - pub struct related_records(()); ///Marker type for the `moderation` field pub struct moderation(()); ///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(()); } } @@ -11546,11 +11546,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::Handle: repo_view_detail_state::IsSet, S::IndexedAt: repo_view_detail_state::IsSet, - S::RelatedRecords: repo_view_detail_state::IsSet, S::Moderation: repo_view_detail_state::IsSet, S::Did: repo_view_detail_state::IsSet, - S::Handle: repo_view_detail_state::IsSet, + S::RelatedRecords: repo_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> RepoViewDetail<'a> { @@ -11797,177 +11797,177 @@ pub mod reporter_stats_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; - type LabeledRecordCount; type ReportedAccountCount; + type LabeledRecordCount; + type TakendownRecordCount; type RecordReportCount; - type ReportedRecordCount; - type LabeledAccountCount; type AccountReportCount; - type TakendownRecordCount; type TakendownAccountCount; + type ReportedRecordCount; + type LabeledAccountCount; + 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 LabeledRecordCount = Unset; type ReportedAccountCount = Unset; + type LabeledRecordCount = Unset; + type TakendownRecordCount = Unset; type RecordReportCount = Unset; - type ReportedRecordCount = Unset; - type LabeledAccountCount = Unset; type AccountReportCount = Unset; - type TakendownRecordCount = Unset; type TakendownAccountCount = Unset; + type ReportedRecordCount = Unset; + type LabeledAccountCount = 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 `reported_account_count` field to Set + pub struct SetReportedAccountCount(PhantomData S>); + impl sealed::Sealed for SetReportedAccountCount {} + impl State for SetReportedAccountCount { + type ReportedAccountCount = Set; type LabeledRecordCount = S::LabeledRecordCount; - type ReportedAccountCount = S::ReportedAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; type RecordReportCount = S::RecordReportCount; - type ReportedRecordCount = S::ReportedRecordCount; - type LabeledAccountCount = S::LabeledAccountCount; type AccountReportCount = S::AccountReportCount; - type TakendownRecordCount = S::TakendownRecordCount; type TakendownAccountCount = S::TakendownAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + type Did = S::Did; } ///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 Did = S::Did; - type LabeledRecordCount = Set; type ReportedAccountCount = S::ReportedAccountCount; + type LabeledRecordCount = Set; + type TakendownRecordCount = S::TakendownRecordCount; type RecordReportCount = S::RecordReportCount; - type ReportedRecordCount = S::ReportedRecordCount; - type LabeledAccountCount = S::LabeledAccountCount; type AccountReportCount = S::AccountReportCount; - type TakendownRecordCount = S::TakendownRecordCount; type TakendownAccountCount = S::TakendownAccountCount; - } - ///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 LabeledAccountCount = S::LabeledAccountCount; 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 ReportedAccountCount = S::ReportedAccountCount; type LabeledRecordCount = S::LabeledRecordCount; - type ReportedAccountCount = Set; + type TakendownRecordCount = Set; type RecordReportCount = S::RecordReportCount; - type ReportedRecordCount = S::ReportedRecordCount; - type LabeledAccountCount = S::LabeledAccountCount; type AccountReportCount = S::AccountReportCount; - type TakendownRecordCount = S::TakendownRecordCount; type TakendownAccountCount = S::TakendownAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + 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 Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; type ReportedAccountCount = S::ReportedAccountCount; + type LabeledRecordCount = S::LabeledRecordCount; + type TakendownRecordCount = S::TakendownRecordCount; type RecordReportCount = Set; + type AccountReportCount = S::AccountReportCount; + type TakendownAccountCount = S::TakendownAccountCount; type ReportedRecordCount = S::ReportedRecordCount; type LabeledAccountCount = S::LabeledAccountCount; - type AccountReportCount = S::AccountReportCount; + 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 ReportedAccountCount = S::ReportedAccountCount; + type LabeledRecordCount = S::LabeledRecordCount; type TakendownRecordCount = S::TakendownRecordCount; + type RecordReportCount = S::RecordReportCount; + type AccountReportCount = Set; type TakendownAccountCount = S::TakendownAccountCount; + type ReportedRecordCount = S::ReportedRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + 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 ReportedAccountCount = S::ReportedAccountCount; + type LabeledRecordCount = S::LabeledRecordCount; + type TakendownRecordCount = S::TakendownRecordCount; + type RecordReportCount = S::RecordReportCount; + type AccountReportCount = S::AccountReportCount; + type TakendownAccountCount = Set; + type ReportedRecordCount = S::ReportedRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + 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 Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; type ReportedAccountCount = S::ReportedAccountCount; + type LabeledRecordCount = S::LabeledRecordCount; + type TakendownRecordCount = S::TakendownRecordCount; type RecordReportCount = S::RecordReportCount; - type ReportedRecordCount = Set; - type LabeledAccountCount = S::LabeledAccountCount; type AccountReportCount = S::AccountReportCount; - type TakendownRecordCount = S::TakendownRecordCount; type TakendownAccountCount = S::TakendownAccountCount; + type ReportedRecordCount = Set; + type LabeledAccountCount = S::LabeledAccountCount; + 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 Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; type ReportedAccountCount = S::ReportedAccountCount; + type LabeledRecordCount = S::LabeledRecordCount; + type TakendownRecordCount = S::TakendownRecordCount; type RecordReportCount = S::RecordReportCount; - type ReportedRecordCount = S::ReportedRecordCount; - type LabeledAccountCount = Set; type AccountReportCount = S::AccountReportCount; - type TakendownRecordCount = S::TakendownRecordCount; type TakendownAccountCount = S::TakendownAccountCount; - } - ///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 Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; - type ReportedAccountCount = S::ReportedAccountCount; - type RecordReportCount = S::RecordReportCount; type ReportedRecordCount = S::ReportedRecordCount; - type LabeledAccountCount = S::LabeledAccountCount; - type AccountReportCount = Set; - type TakendownRecordCount = S::TakendownRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; - } - ///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 LabeledAccountCount = Set; type Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { type ReportedAccountCount = S::ReportedAccountCount; + type LabeledRecordCount = S::LabeledRecordCount; + type TakendownRecordCount = S::TakendownRecordCount; type RecordReportCount = S::RecordReportCount; - type ReportedRecordCount = S::ReportedRecordCount; - type LabeledAccountCount = S::LabeledAccountCount; type AccountReportCount = S::AccountReportCount; - type TakendownRecordCount = Set; type TakendownAccountCount = S::TakendownAccountCount; - } - ///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 Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; - type ReportedAccountCount = S::ReportedAccountCount; - type RecordReportCount = S::RecordReportCount; type ReportedRecordCount = S::ReportedRecordCount; type LabeledAccountCount = S::LabeledAccountCount; - type AccountReportCount = S::AccountReportCount; - type TakendownRecordCount = S::TakendownRecordCount; - type TakendownAccountCount = 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 `labeled_record_count` field - pub struct labeled_record_count(()); ///Marker type for the `reported_account_count` field pub struct reported_account_count(()); + ///Marker type for the `labeled_record_count` field + pub struct labeled_record_count(()); + ///Marker type for the `takendown_record_count` field + pub struct takendown_record_count(()); ///Marker type for the `record_report_count` field pub struct record_report_count(()); - ///Marker type for the `reported_record_count` field - pub struct reported_record_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_record_count` field - pub struct takendown_record_count(()); ///Marker type for the `takendown_account_count` field pub struct takendown_account_count(()); + ///Marker type for the `reported_record_count` field + pub struct reported_record_count(()); + ///Marker type for the `labeled_account_count` field + pub struct labeled_account_count(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -12190,15 +12190,15 @@ where impl<'a, S> ReporterStatsBuilder<'a, S> where S: reporter_stats_state::State, - S::Did: reporter_stats_state::IsSet, - S::LabeledRecordCount: reporter_stats_state::IsSet, S::ReportedAccountCount: reporter_stats_state::IsSet, + S::LabeledRecordCount: reporter_stats_state::IsSet, + S::TakendownRecordCount: reporter_stats_state::IsSet, S::RecordReportCount: reporter_stats_state::IsSet, - S::ReportedRecordCount: reporter_stats_state::IsSet, - S::LabeledAccountCount: reporter_stats_state::IsSet, S::AccountReportCount: reporter_stats_state::IsSet, - S::TakendownRecordCount: reporter_stats_state::IsSet, S::TakendownAccountCount: reporter_stats_state::IsSet, + S::ReportedRecordCount: reporter_stats_state::IsSet, + S::LabeledAccountCount: reporter_stats_state::IsSet, + S::Did: reporter_stats_state::IsSet, { /// Build the final struct pub fn build(self) -> ReporterStats<'a> { @@ -12476,95 +12476,93 @@ pub mod scheduled_action_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedBy; type CreatedAt; type Status; type Id; type Did; type Action; + type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedBy = Unset; type CreatedAt = Unset; type Status = Unset; type Id = Unset; type Did = Unset; type Action = 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 CreatedAt = S::CreatedAt; - type Status = S::Status; - type Id = S::Id; - type Did = S::Did; - type Action = S::Action; + type CreatedBy = 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 CreatedBy = S::CreatedBy; type CreatedAt = Set; type Status = S::Status; type Id = S::Id; type Did = S::Did; type Action = S::Action; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Status = Set; type Id = S::Id; type Did = S::Did; type Action = S::Action; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Status = S::Status; type Id = Set; type Did = S::Did; type Action = S::Action; + 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 CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; type Status = S::Status; type Id = S::Id; type Did = Set; type Action = S::Action; + type CreatedBy = S::CreatedBy; } ///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 CreatedAt = S::CreatedAt; type Status = S::Status; type Id = S::Id; type Did = S::Did; type Action = 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 CreatedAt = S::CreatedAt; + type Status = S::Status; + type Id = S::Id; + type Did = S::Did; + type Action = S::Action; + type CreatedBy = 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 `created_at` field pub struct created_at(()); ///Marker type for the `status` field @@ -12575,6 +12573,8 @@ pub mod scheduled_action_view_state { pub struct did(()); ///Marker type for the `action` field pub struct action(()); + ///Marker type for the `created_by` field + pub struct created_by(()); } } @@ -12911,12 +12911,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::CreatedBy: scheduled_action_view_state::IsSet, S::CreatedAt: scheduled_action_view_state::IsSet, S::Status: scheduled_action_view_state::IsSet, S::Id: scheduled_action_view_state::IsSet, S::Did: scheduled_action_view_state::IsSet, S::Action: scheduled_action_view_state::IsSet, + S::CreatedBy: scheduled_action_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ScheduledActionView<'a> { @@ -13402,84 +13402,84 @@ pub mod subject_status_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Id; - type Subject; - type UpdatedAt; - type ReviewState; type CreatedAt; + type ReviewState; + type UpdatedAt; + 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 UpdatedAt = Unset; - type ReviewState = Unset; type CreatedAt = Unset; + type ReviewState = Unset; + type UpdatedAt = 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 UpdatedAt = S::UpdatedAt; - type ReviewState = S::ReviewState; 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 UpdatedAt = S::UpdatedAt; type ReviewState = S::ReviewState; - type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + 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 { + ///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 Subject = S::Subject; - type UpdatedAt = Set; + type CreatedAt = 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 Subject = S::Subject; - type UpdatedAt = S::UpdatedAt; - type ReviewState = Set; type CreatedAt = S::CreatedAt; + type ReviewState = Set; + 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 { + ///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 CreatedAt = S::CreatedAt; + type ReviewState = S::ReviewState; + type UpdatedAt = Set; type Subject = S::Subject; - type UpdatedAt = S::UpdatedAt; + } + ///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 CreatedAt = S::CreatedAt; type ReviewState = S::ReviewState; - type CreatedAt = Set; + type UpdatedAt = S::UpdatedAt; + 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 `updated_at` field - pub struct updated_at(()); - ///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 `review_state` field + pub struct review_state(()); + ///Marker type for the `updated_at` field + pub struct updated_at(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -14015,10 +14015,10 @@ impl<'a, S> SubjectStatusViewBuilder<'a, S> where S: subject_status_view_state::State, S::Id: subject_status_view_state::IsSet, - S::Subject: subject_status_view_state::IsSet, - S::UpdatedAt: subject_status_view_state::IsSet, - S::ReviewState: subject_status_view_state::IsSet, S::CreatedAt: subject_status_view_state::IsSet, + S::ReviewState: subject_status_view_state::IsSet, + S::UpdatedAt: subject_status_view_state::IsSet, + S::Subject: subject_status_view_state::IsSet, { /// Build the final struct pub fn build(self) -> SubjectStatusView<'a> { @@ -14741,51 +14741,51 @@ pub mod video_details_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Length; - type Width; type Height; + type Width; + type Length; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Length = Unset; - type Width = Unset; type Height = Unset; + type Width = Unset; + type Length = Unset; } - ///State transition - sets the `length` field to Set - pub struct SetLength(PhantomData S>); - impl sealed::Sealed for SetLength {} - impl State for SetLength { - type Length = Set; + ///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 = S::Height; + type Length = S::Length; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData S>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { - type Length = S::Length; - 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 = 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 Height = S::Height; type Width = S::Width; - type Height = Set; + type Length = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `length` field - pub struct length(()); - ///Marker type for the `width` field - pub struct width(()); ///Marker type for the `height` field pub struct height(()); + ///Marker type for the `width` field + pub struct width(()); + ///Marker type for the `length` field + pub struct length(()); } } @@ -14878,9 +14878,9 @@ where impl<'a, S> VideoDetailsBuilder<'a, S> where S: video_details_state::State, - S::Length: video_details_state::IsSet, - S::Width: video_details_state::IsSet, S::Height: video_details_state::IsSet, + S::Width: 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 fc589c0..88bc151 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> { 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 fac0362..6c7c037 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs @@ -47,51 +47,51 @@ pub mod emit_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Event; - type Subject; type CreatedBy; + type Subject; + type Event; } /// 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 CreatedBy = Unset; + type Subject = Unset; + type Event = 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; + ///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 Subject = S::Subject; - type CreatedBy = S::CreatedBy; + type Event = S::Event; } ///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 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 Subject = Set; type Event = S::Event; + } + ///State transition - sets the `event` field to Set + pub struct SetEvent(PhantomData S>); + impl sealed::Sealed for SetEvent {} + impl State for SetEvent { + type CreatedBy = S::CreatedBy; type Subject = S::Subject; - type CreatedBy = Set; + type Event = 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 `created_by` field pub struct created_by(()); + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `event` field + pub struct event(()); } } @@ -244,9 +244,9 @@ 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::CreatedBy: emit_event_state::IsSet, + S::Subject: emit_event_state::IsSet, + S::Event: emit_event_state::IsSet, { /// Build the final struct pub fn build(self) -> EmitEvent<'a> { 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 09f354b..58cf9d4 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 @@ -219,37 +219,37 @@ pub mod timeline_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Day; type Summary; + type Day; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Day = Unset; type Summary = Unset; - } - ///State transition - sets the `day` field to Set - pub struct SetDay(PhantomData S>); - impl sealed::Sealed for SetDay {} - impl State for SetDay { - type Day = Set; - type Summary = S::Summary; + type Day = Unset; } ///State transition - sets the `summary` field to Set pub struct SetSummary(PhantomData S>); impl sealed::Sealed for SetSummary {} impl State for SetSummary { - type Day = S::Day; type Summary = Set; + type Day = S::Day; + } + ///State transition - sets the `day` field to Set + pub struct SetDay(PhantomData S>); + impl sealed::Sealed for SetDay {} + impl State for SetDay { + type Summary = S::Summary; + type Day = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `day` field - pub struct day(()); ///Marker type for the `summary` field pub struct summary(()); + ///Marker type for the `day` field + pub struct day(()); } } @@ -334,8 +334,8 @@ where impl<'a, S> TimelineItemBuilder<'a, S> where S: timeline_item_state::State, - S::Day: timeline_item_state::IsSet, S::Summary: timeline_item_state::IsSet, + S::Day: timeline_item_state::IsSet, { /// Build the final struct pub fn build(self) -> TimelineItem<'a> { @@ -576,50 +576,50 @@ pub mod timeline_item_summary_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type EventSubjectType; - type EventType; type Count; + type EventType; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type EventSubjectType = Unset; - type EventType = Unset; type Count = Unset; + type EventType = Unset; } ///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 EventSubjectType = Set; - type EventType = S::EventType; - type Count = S::Count; - } - ///State transition - sets the `event_type` field to Set - pub struct SetEventType(PhantomData S>); - impl sealed::Sealed for SetEventType {} - impl State for SetEventType { - type EventSubjectType = S::EventSubjectType; - type EventType = Set; type Count = S::Count; + type EventType = S::EventType; } ///State transition - sets the `count` field to Set pub struct SetCount(PhantomData S>); impl sealed::Sealed for SetCount {} impl State for SetCount { type EventSubjectType = S::EventSubjectType; - type EventType = S::EventType; type Count = 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 EventSubjectType = S::EventSubjectType; + type Count = S::Count; + type EventType = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `event_subject_type` field pub struct event_subject_type(()); - ///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(()); } } @@ -716,8 +716,8 @@ impl<'a, S> TimelineItemSummaryBuilder<'a, S> where S: timeline_item_summary_state::State, S::EventSubjectType: timeline_item_summary_state::IsSet, - S::EventType: timeline_item_summary_state::IsSet, S::Count: timeline_item_summary_state::IsSet, + S::EventType: timeline_item_summary_state::IsSet, { /// Build the final struct pub fn build(self) -> TimelineItemSummary<'a> { 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 334fff3..4d279ea 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs @@ -761,65 +761,65 @@ pub mod schedule_action_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Subjects; type Action; type Scheduling; - type Subjects; type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Subjects = Unset; type Action = Unset; type Scheduling = Unset; - type Subjects = Unset; type CreatedBy = Unset; } + ///State transition - sets the `subjects` field to Set + pub struct SetSubjects(PhantomData S>); + impl sealed::Sealed for SetSubjects {} + impl State for SetSubjects { + type Subjects = Set; + type Action = S::Action; + type Scheduling = S::Scheduling; + type CreatedBy = S::CreatedBy; + } ///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 Action = Set; type Scheduling = S::Scheduling; - type Subjects = S::Subjects; type CreatedBy = S::CreatedBy; } ///State transition - sets the `scheduling` field to Set pub struct SetScheduling(PhantomData S>); impl sealed::Sealed for SetScheduling {} impl State for SetScheduling { - type Action = S::Action; - type Scheduling = Set; type Subjects = S::Subjects; - type CreatedBy = S::CreatedBy; - } - ///State transition - sets the `subjects` field to Set - pub struct SetSubjects(PhantomData S>); - impl sealed::Sealed for SetSubjects {} - impl State for SetSubjects { type Action = S::Action; - type Scheduling = S::Scheduling; - type Subjects = Set; + type Scheduling = 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 Subjects = S::Subjects; type Action = S::Action; type Scheduling = S::Scheduling; - type Subjects = S::Subjects; type CreatedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `subjects` field + pub struct subjects(()); ///Marker type for the `action` field pub struct action(()); ///Marker type for the `scheduling` field pub struct scheduling(()); - ///Marker type for the `subjects` field - pub struct subjects(()); ///Marker type for the `created_by` field pub struct created_by(()); } @@ -960,9 +960,9 @@ where impl<'a, S> ScheduleActionBuilder<'a, S> where S: schedule_action_state::State, + S::Subjects: schedule_action_state::IsSet, S::Action: schedule_action_state::IsSet, S::Scheduling: schedule_action_state::IsSet, - S::Subjects: schedule_action_state::IsSet, S::CreatedBy: schedule_action_state::IsSet, { /// Build the final struct @@ -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 Failed; type Succeeded; + type Failed; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Failed = Unset; 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 Failed = Set; - type Succeeded = S::Succeeded; + 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 Failed = S::Failed; type Succeeded = Set; + type Failed = S::Failed; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `failed` field - pub struct failed(()); ///Marker type for the `succeeded` field pub struct succeeded(()); + ///Marker type for the `failed` field + pub struct failed(()); } } @@ -1188,8 +1188,8 @@ where impl<'a, S> ScheduledActionResultsBuilder<'a, S> where S: scheduled_action_results_state::State, - S::Failed: scheduled_action_results_state::IsSet, S::Succeeded: scheduled_action_results_state::IsSet, + S::Failed: 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 cd97179..0b26e38 100644 --- a/crates/weaver-api/src/tools_ozone/safelink.rs +++ b/crates/weaver-api/src/tools_ozone/safelink.rs @@ -144,151 +144,151 @@ pub mod event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedBy; + type Pattern; + type Url; type Action; - type Id; type CreatedAt; + type Id; type EventType; - type Url; + type CreatedBy; type Reason; - type Pattern; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedBy = Unset; + type Pattern = Unset; + type Url = Unset; type Action = Unset; - type Id = Unset; type CreatedAt = Unset; + type Id = Unset; type EventType = Unset; - type Url = Unset; + type CreatedBy = Unset; type Reason = Unset; - type Pattern = 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; + ///State transition - sets the `pattern` field to Set + pub struct SetPattern(PhantomData S>); + impl sealed::Sealed for SetPattern {} + impl State for SetPattern { + type Pattern = Set; + type Url = S::Url; type Action = S::Action; - type Id = S::Id; type CreatedAt = S::CreatedAt; + type Id = S::Id; type EventType = S::EventType; - type Url = S::Url; + type CreatedBy = S::CreatedBy; type Reason = S::Reason; + } + ///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 Url = Set; + type Action = S::Action; + type CreatedAt = S::CreatedAt; + type Id = S::Id; + type EventType = S::EventType; + type CreatedBy = S::CreatedBy; + type Reason = S::Reason; } ///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 Pattern = S::Pattern; + type Url = S::Url; type Action = Set; - type Id = S::Id; type CreatedAt = S::CreatedAt; + type Id = S::Id; type EventType = S::EventType; - type Url = S::Url; - type Reason = S::Reason; - type Pattern = S::Pattern; - } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { type CreatedBy = S::CreatedBy; - type Action = S::Action; - type Id = Set; - type CreatedAt = S::CreatedAt; - type EventType = S::EventType; - type Url = S::Url; type Reason = S::Reason; - type Pattern = S::Pattern; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type CreatedBy = S::CreatedBy; + type Pattern = S::Pattern; + type Url = S::Url; type Action = S::Action; - type Id = S::Id; type CreatedAt = Set; + type Id = S::Id; type EventType = S::EventType; - type Url = S::Url; + type CreatedBy = S::CreatedBy; type Reason = S::Reason; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { type Pattern = S::Pattern; + type Url = S::Url; + type Action = S::Action; + type CreatedAt = S::CreatedAt; + type Id = Set; + type EventType = S::EventType; + type CreatedBy = S::CreatedBy; + type Reason = S::Reason; } ///State transition - sets the `event_type` field to Set pub struct SetEventType(PhantomData S>); impl sealed::Sealed for SetEventType {} impl State for SetEventType { - type CreatedBy = S::CreatedBy; + type Pattern = S::Pattern; + type Url = S::Url; type Action = S::Action; - type Id = S::Id; type CreatedAt = S::CreatedAt; + type Id = S::Id; type EventType = Set; - type Url = S::Url; + type CreatedBy = S::CreatedBy; type Reason = S::Reason; - 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 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 Pattern = S::Pattern; + type Url = S::Url; type Action = S::Action; - type Id = S::Id; type CreatedAt = S::CreatedAt; + type Id = S::Id; type EventType = S::EventType; - type Url = Set; + type CreatedBy = Set; type Reason = S::Reason; - type Pattern = S::Pattern; } ///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 Action = S::Action; - type Id = S::Id; - type CreatedAt = S::CreatedAt; - type EventType = S::EventType; - type Url = S::Url; - type Reason = Set; type Pattern = S::Pattern; - } - ///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 Url = S::Url; type Action = S::Action; - type Id = S::Id; type CreatedAt = S::CreatedAt; + type Id = S::Id; type EventType = S::EventType; - type Url = S::Url; - type Reason = S::Reason; - type Pattern = Set; + type CreatedBy = S::CreatedBy; + type Reason = 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 `pattern` field + pub struct pattern(()); + ///Marker type for the `url` field + pub struct url(()); ///Marker type for the `action` field pub struct action(()); - ///Marker type for the `id` field - pub struct id(()); ///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(()); - ///Marker type for the `url` field - pub struct url(()); + ///Marker type for the `created_by` field + pub struct created_by(()); ///Marker type for the `reason` field pub struct reason(()); - ///Marker type for the `pattern` field - pub struct pattern(()); } } @@ -508,14 +508,14 @@ where impl<'a, S> EventBuilder<'a, S> where S: event_state::State, - S::CreatedBy: event_state::IsSet, + S::Pattern: event_state::IsSet, + S::Url: event_state::IsSet, S::Action: event_state::IsSet, - S::Id: event_state::IsSet, S::CreatedAt: event_state::IsSet, + S::Id: event_state::IsSet, S::EventType: event_state::IsSet, - S::Url: event_state::IsSet, + S::CreatedBy: event_state::IsSet, S::Reason: event_state::IsSet, - S::Pattern: event_state::IsSet, { /// Build the final struct pub fn build(self) -> Event<'a> { @@ -1257,127 +1257,127 @@ pub mod url_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reason; - type CreatedBy; - type UpdatedAt; type CreatedAt; + type UpdatedAt; type Url; - type Action; type Pattern; + type Reason; + type Action; + type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Reason = Unset; - type CreatedBy = Unset; - type UpdatedAt = Unset; type CreatedAt = Unset; + type UpdatedAt = Unset; type Url = Unset; - type Action = Unset; type Pattern = Unset; + type Reason = Unset; + type Action = Unset; + type CreatedBy = 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 CreatedBy = S::CreatedBy; + ///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 UpdatedAt = S::UpdatedAt; - type CreatedAt = S::CreatedAt; type Url = S::Url; - type Action = S::Action; type Pattern = S::Pattern; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { type Reason = S::Reason; - type CreatedBy = Set; - type UpdatedAt = S::UpdatedAt; - type CreatedAt = S::CreatedAt; - type Url = S::Url; type Action = S::Action; - type Pattern = S::Pattern; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { - type Reason = S::Reason; - type CreatedBy = S::CreatedBy; - type UpdatedAt = Set; type CreatedAt = S::CreatedAt; + type UpdatedAt = Set; type Url = S::Url; - type Action = S::Action; type Pattern = S::Pattern; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { type Reason = S::Reason; - type CreatedBy = S::CreatedBy; - type UpdatedAt = S::UpdatedAt; - type CreatedAt = Set; - type Url = S::Url; type Action = S::Action; - type Pattern = S::Pattern; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); impl sealed::Sealed for SetUrl {} impl State for SetUrl { + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + type Url = Set; + type Pattern = S::Pattern; type Reason = S::Reason; + type Action = S::Action; type CreatedBy = S::CreatedBy; - type UpdatedAt = S::UpdatedAt; + } + ///State transition - sets the `pattern` field to Set + pub struct SetPattern(PhantomData S>); + impl sealed::Sealed for SetPattern {} + impl State for SetPattern { type CreatedAt = S::CreatedAt; - type Url = Set; + type UpdatedAt = S::UpdatedAt; + type Url = S::Url; + type Pattern = Set; + type Reason = S::Reason; type Action = S::Action; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; + type Url = S::Url; type Pattern = S::Pattern; + type Reason = Set; + type Action = S::Action; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { - type Reason = S::Reason; - type CreatedBy = S::CreatedBy; - type UpdatedAt = S::UpdatedAt; type CreatedAt = S::CreatedAt; + type UpdatedAt = S::UpdatedAt; type Url = S::Url; - type Action = Set; type Pattern = S::Pattern; - } - ///State transition - sets the `pattern` field to Set - pub struct SetPattern(PhantomData S>); - impl sealed::Sealed for SetPattern {} - impl State for SetPattern { type Reason = S::Reason; + type Action = Set; type CreatedBy = S::CreatedBy; - type UpdatedAt = S::UpdatedAt; + } + ///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 UpdatedAt = S::UpdatedAt; type Url = S::Url; + type Pattern = S::Pattern; + type Reason = S::Reason; type Action = S::Action; - type Pattern = Set; + type CreatedBy = 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 `created_by` field - pub struct created_by(()); - ///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 `updated_at` field + pub struct updated_at(()); ///Marker type for the `url` field pub struct url(()); - ///Marker type for the `action` field - pub struct action(()); ///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 `created_by` field + pub struct created_by(()); } } @@ -1567,13 +1567,13 @@ where impl<'a, S> UrlRuleBuilder<'a, S> where S: url_rule_state::State, - S::Reason: url_rule_state::IsSet, - S::CreatedBy: url_rule_state::IsSet, - S::UpdatedAt: url_rule_state::IsSet, S::CreatedAt: url_rule_state::IsSet, + S::UpdatedAt: url_rule_state::IsSet, S::Url: url_rule_state::IsSet, - S::Action: url_rule_state::IsSet, S::Pattern: url_rule_state::IsSet, + S::Reason: url_rule_state::IsSet, + S::Action: url_rule_state::IsSet, + S::CreatedBy: 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 62a26d6..c49f347 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs @@ -46,65 +46,65 @@ pub mod add_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reason; type Url; type Action; + type Reason; type Pattern; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Reason = Unset; type Url = Unset; type Action = Unset; + type Reason = Unset; type Pattern = 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 Url = S::Url; - type Action = S::Action; - 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 Url = Set; type Action = S::Action; + type Reason = S::Reason; type Pattern = S::Pattern; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { - type Reason = S::Reason; type Url = S::Url; type Action = Set; + type Reason = S::Reason; + type Pattern = S::Pattern; + } + ///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 Pattern = S::Pattern; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { - type Reason = S::Reason; type Url = S::Url; type Action = S::Action; + type Reason = S::Reason; type Pattern = 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 `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 `pattern` field pub struct pattern(()); } @@ -256,9 +256,9 @@ where impl<'a, S> AddRuleBuilder<'a, S> where S: add_rule_state::State, - S::Reason: add_rule_state::IsSet, S::Url: add_rule_state::IsSet, S::Action: add_rule_state::IsSet, + S::Reason: add_rule_state::IsSet, S::Pattern: add_rule_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs index 45dfdab..dd96902 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs @@ -42,37 +42,37 @@ pub mod remove_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Pattern; type Url; + type Pattern; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Pattern = Unset; type Url = Unset; - } - ///State transition - sets the `pattern` field to Set - pub struct SetPattern(PhantomData S>); - impl sealed::Sealed for SetPattern {} - impl State for SetPattern { - type Pattern = Set; - type Url = S::Url; + type Pattern = Unset; } ///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 Url = Set; + type Pattern = S::Pattern; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `pattern` field - pub struct pattern(()); ///Marker type for the `url` field pub struct url(()); + ///Marker type for the `pattern` field + pub struct pattern(()); } } @@ -182,8 +182,8 @@ where impl<'a, S> RemoveRuleBuilder<'a, S> where S: remove_rule_state::State, - S::Pattern: remove_rule_state::IsSet, S::Url: remove_rule_state::IsSet, + S::Pattern: remove_rule_state::IsSet, { /// Build the final struct pub fn build(self) -> RemoveRule<'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 53e8f53..e7947e6 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs @@ -47,66 +47,66 @@ pub mod update_rule_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Action; - type Pattern; - type Url; type Reason; + type Url; + type Pattern; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Action = Unset; - type Pattern = Unset; - type Url = Unset; type Reason = Unset; + type Url = Unset; + type Pattern = Unset; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { type Action = Set; - type Pattern = S::Pattern; - type Url = S::Url; type Reason = S::Reason; + type Url = S::Url; + type Pattern = S::Pattern; } - ///State transition - sets the `pattern` field to Set - pub struct SetPattern(PhantomData S>); - impl sealed::Sealed for SetPattern {} - impl State for SetPattern { + ///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 = Set; + type Reason = Set; type Url = S::Url; - type Reason = S::Reason; + 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 Action = S::Action; - type Pattern = S::Pattern; - type Url = Set; type Reason = S::Reason; + type Url = Set; + type Pattern = S::Pattern; } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { + ///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 Pattern = S::Pattern; + type Reason = S::Reason; type Url = S::Url; - type Reason = Set; + type Pattern = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `action` field pub struct action(()); - ///Marker type for the `pattern` field - pub struct pattern(()); - ///Marker type for the `url` field - pub struct url(()); ///Marker type for the `reason` field pub struct reason(()); + ///Marker type for the `url` field + pub struct url(()); + ///Marker type for the `pattern` field + pub struct pattern(()); } } @@ -257,9 +257,9 @@ impl<'a, S> UpdateRuleBuilder<'a, S> where S: update_rule_state::State, S::Action: update_rule_state::IsSet, - S::Pattern: update_rule_state::IsSet, - S::Url: update_rule_state::IsSet, S::Reason: update_rule_state::IsSet, + S::Url: update_rule_state::IsSet, + S::Pattern: 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 a1c7cef..d162a69 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 CreatedAt; 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 CreatedAt = 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 CreatedAt = S::CreatedAt; type UpdatedAt = S::UpdatedAt; + type CreatedAt = S::CreatedAt; + 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 { + ///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 = Set; + type UpdatedAt = Set; type CreatedAt = S::CreatedAt; - type UpdatedAt = S::UpdatedAt; + 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 CreatedAt = Set; type UpdatedAt = S::UpdatedAt; + type CreatedAt = Set; + 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 { + ///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 = S::SetSize; + type UpdatedAt = S::UpdatedAt; type CreatedAt = S::CreatedAt; - type UpdatedAt = Set; + 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 `created_at` field - pub struct created_at(()); ///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::CreatedAt: 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 b8a9c48..fedac14 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 cedfa40..231c0c1 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 LastUpdatedBy; - type Key; + type Scope; type Value; type Did; - type Scope; + type Key; type CreatedBy; + type LastUpdatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type LastUpdatedBy = Unset; - type Key = Unset; + type Scope = Unset; type Value = Unset; type Did = Unset; - type Scope = Unset; + type Key = Unset; type CreatedBy = Unset; + type LastUpdatedBy = Unset; } - ///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 LastUpdatedBy = Set; - type Key = S::Key; + ///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 Value = S::Value; type Did = S::Did; - type Scope = S::Scope; + type Key = S::Key; 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 Key = Set; - type Value = S::Value; - type Did = S::Did; - 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 LastUpdatedBy = S::LastUpdatedBy; - type Key = S::Key; + type Scope = S::Scope; type Value = Set; type Did = S::Did; - type Scope = S::Scope; + type Key = S::Key; type CreatedBy = S::CreatedBy; + type LastUpdatedBy = S::LastUpdatedBy; } ///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 Key = S::Key; + type Scope = S::Scope; type Value = S::Value; type Did = Set; - type Scope = S::Scope; + type Key = S::Key; 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 Key = S::Key; + } + ///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 Value = S::Value; type Did = S::Did; - type Scope = Set; + type Key = Set; type CreatedBy = S::CreatedBy; + type LastUpdatedBy = S::LastUpdatedBy; } ///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 Key = S::Key; + type Scope = S::Scope; type Value = S::Value; type Did = S::Did; - type Scope = S::Scope; + type Key = S::Key; type CreatedBy = Set; + type LastUpdatedBy = S::LastUpdatedBy; + } + ///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 Scope = S::Scope; + type Value = S::Value; + type Did = S::Did; + type Key = S::Key; + type CreatedBy = S::CreatedBy; + type LastUpdatedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `last_updated_by` field - pub struct last_updated_by(()); - ///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(()); ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `scope` field - pub struct scope(()); + ///Marker type for the `key` field + pub struct key(()); ///Marker type for the `created_by` field pub struct created_by(()); + ///Marker type for the `last_updated_by` field + pub struct last_updated_by(()); } } @@ -397,12 +397,12 @@ where impl<'a, S> DefsOptionBuilder<'a, S> where S: defs_option_state::State, - S::LastUpdatedBy: defs_option_state::IsSet, - S::Key: defs_option_state::IsSet, + S::Scope: defs_option_state::IsSet, S::Value: defs_option_state::IsSet, S::Did: defs_option_state::IsSet, - S::Scope: defs_option_state::IsSet, + S::Key: defs_option_state::IsSet, S::CreatedBy: defs_option_state::IsSet, + S::LastUpdatedBy: defs_option_state::IsSet, { /// Build the final struct pub fn build(self) -> DefsOption<'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 ac50570..3b6e480 100644 --- a/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs +++ b/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs @@ -41,51 +41,51 @@ pub mod upsert_option_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Scope; type Value; type Key; - 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 Value = Unset; type Key = Unset; - type Scope = 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 Value = S::Value; + type Key = S::Key; } ///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 Value = Set; type Key = S::Key; - type Scope = S::Scope; } ///State transition - sets the `key` field to Set pub struct SetKey(PhantomData S>); impl sealed::Sealed for SetKey {} impl State for SetKey { - type Value = S::Value; - type Key = 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 Value = S::Value; - type Key = S::Key; - type Scope = Set; + type Key = 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 `value` field pub struct value(()); ///Marker type for the `key` field pub struct key(()); - ///Marker type for the `scope` field - pub struct scope(()); } } @@ -218,9 +218,9 @@ where impl<'a, S> UpsertOptionBuilder<'a, S> where S: upsert_option_state::State, + S::Scope: upsert_option_state::IsSet, S::Value: upsert_option_state::IsSet, S::Key: upsert_option_state::IsSet, - S::Scope: upsert_option_state::IsSet, { /// Build the final struct pub fn build(self) -> UpsertOption<'a> { 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 94b3e75..e2de037 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 Role; type Did; + type Role; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Role = Unset; 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 Role = Set; - type Did = S::Did; + 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 Role = S::Role; type Did = Set; + type Role = S::Role; + } + ///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; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `role` field - pub struct role(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `role` field + pub struct role(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> AddMemberBuilder<'a, S> where S: add_member_state::State, - S::Role: add_member_state::IsSet, S::Did: add_member_state::IsSet, + S::Role: 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 1b70bd8..0c4fe34 100644 --- a/crates/weaver-api/src/tools_ozone/verification.rs +++ b/crates/weaver-api/src/tools_ozone/verification.rs @@ -75,10 +75,10 @@ pub mod verification_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Issuer; - type Subject; - type DisplayName; type Uri; type Handle; + type Subject; + type DisplayName; type CreatedAt; } /// Empty state - all required fields are unset @@ -86,10 +86,10 @@ pub mod verification_view_state { impl sealed::Sealed for Empty {} impl State for Empty { type Issuer = Unset; - type Subject = Unset; - type DisplayName = Unset; type Uri = Unset; type Handle = Unset; + type Subject = Unset; + type DisplayName = Unset; type CreatedAt = Unset; } ///State transition - sets the `issuer` field to Set @@ -97,32 +97,10 @@ pub mod verification_view_state { impl sealed::Sealed for SetIssuer {} impl State for SetIssuer { type Issuer = Set; - type Subject = S::Subject; - type DisplayName = S::DisplayName; - type Uri = S::Uri; - 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 Issuer = S::Issuer; - type Subject = Set; - type DisplayName = S::DisplayName; type Uri = S::Uri; 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 Issuer = S::Issuer; type Subject = S::Subject; - type DisplayName = Set; - type Uri = S::Uri; - type Handle = S::Handle; + type DisplayName = S::DisplayName; type CreatedAt = S::CreatedAt; } ///State transition - sets the `uri` field to Set @@ -130,10 +108,10 @@ pub mod verification_view_state { impl sealed::Sealed for SetUri {} impl State for SetUri { type Issuer = S::Issuer; - type Subject = S::Subject; - type DisplayName = S::DisplayName; type Uri = Set; type Handle = S::Handle; + type Subject = S::Subject; + type DisplayName = S::DisplayName; type CreatedAt = S::CreatedAt; } ///State transition - sets the `handle` field to Set @@ -141,10 +119,32 @@ pub mod verification_view_state { impl sealed::Sealed for SetHandle {} impl State for SetHandle { type Issuer = S::Issuer; + type Uri = S::Uri; + type Handle = Set; type Subject = S::Subject; type DisplayName = S::DisplayName; + 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 Issuer = S::Issuer; type Uri = S::Uri; - type Handle = Set; + type Handle = S::Handle; + type Subject = Set; + 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; + type Uri = S::Uri; + type Handle = S::Handle; + type Subject = S::Subject; + type DisplayName = Set; type CreatedAt = S::CreatedAt; } ///State transition - sets the `created_at` field to Set @@ -152,10 +152,10 @@ pub mod verification_view_state { impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type Issuer = S::Issuer; - type Subject = S::Subject; - type DisplayName = S::DisplayName; type Uri = S::Uri; type Handle = S::Handle; + type Subject = S::Subject; + type DisplayName = S::DisplayName; type CreatedAt = Set; } /// Marker types for field names @@ -163,14 +163,14 @@ pub mod verification_view_state { pub mod members { ///Marker type for the `issuer` field pub struct issuer(()); - ///Marker type for the `subject` field - pub struct subject(()); - ///Marker type for the `display_name` field - pub struct display_name(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `handle` field pub struct handle(()); + ///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(()); } @@ -480,10 +480,10 @@ impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, S::Issuer: verification_view_state::IsSet, - S::Subject: verification_view_state::IsSet, - S::DisplayName: verification_view_state::IsSet, S::Uri: verification_view_state::IsSet, S::Handle: verification_view_state::IsSet, + S::Subject: verification_view_state::IsSet, + S::DisplayName: verification_view_state::IsSet, S::CreatedAt: verification_view_state::IsSet, { /// Build the final struct 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 104d617..e4159ca 100644 --- a/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs +++ b/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs @@ -36,37 +36,37 @@ pub mod grant_error_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type Error; + 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 Error = 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 Error = S::Error; + type Subject = Unset; } ///State transition - sets the `error` field to Set pub struct SetError(PhantomData S>); impl sealed::Sealed for SetError {} impl State for SetError { - type Subject = S::Subject; type Error = 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 Error = S::Error; + 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 `error` field pub struct error(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -139,8 +139,8 @@ where impl<'a, S> GrantErrorBuilder<'a, S> where S: grant_error_state::State, - S::Subject: grant_error_state::IsSet, S::Error: grant_error_state::IsSet, + S::Subject: grant_error_state::IsSet, { /// Build the final struct pub fn build(self) -> GrantError<'a> { @@ -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 DisplayName; + 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; + type DisplayName = Unset; + type Handle = 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; + ///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 DisplayName = S::DisplayName; - type Subject = S::Subject; + type Handle = S::Handle; } ///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; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { + type DisplayName = 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 Subject = S::Subject; type DisplayName = S::DisplayName; - type Subject = Set; + 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 `display_name` field + pub struct display_name(()); + ///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::DisplayName: 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-api/src/tools_ozone/verification/revoke_verifications.rs b/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs index 5ccad00..4df939a 100644 --- a/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs +++ b/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs @@ -236,37 +236,37 @@ pub mod revoke_error_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Error; + 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 Error = 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 Error = S::Error; + type Uri = Unset; } ///State transition - sets the `error` field to Set pub struct SetError(PhantomData S>); impl sealed::Sealed for SetError {} impl State for SetError { - type Uri = S::Uri; type Error = 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 Error = S::Error; + 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 `error` field pub struct error(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -339,8 +339,8 @@ where impl<'a, S> RevokeErrorBuilder<'a, S> where S: revoke_error_state::State, - S::Uri: revoke_error_state::IsSet, S::Error: revoke_error_state::IsSet, + S::Uri: revoke_error_state::IsSet, { /// Build the final struct pub fn build(self) -> RevokeError<'a> { diff --git a/crates/weaver-app/Cargo.toml b/crates/weaver-app/Cargo.toml index 9cffc00..c119446 100644 --- a/crates/weaver-app/Cargo.toml +++ b/crates/weaver-app/Cargo.toml @@ -23,7 +23,7 @@ path = "src/bin/embed_worker.rs" required-features = ["web"] [features] -default = ["web", "fullstack-server", "use-index"] +default = ["web", "fullstack-server", "use-index", "pckt"] # Fullstack mode with SSR and server functions fullstack-server = ["dioxus/fullstack"] # Enable pckt/site.standard document rendering diff --git a/crates/weaver-app/src/components/app_link.rs b/crates/weaver-app/src/components/app_link.rs index 52240f4..c6228d0 100644 --- a/crates/weaver-app/src/components/app_link.rs +++ b/crates/weaver-app/src/components/app_link.rs @@ -7,7 +7,7 @@ use crate::env::WEAVER_APP_HOST; use crate::host_mode::LinkMode; -use crate::{Route, SubdomainRoute}; +use crate::{CustomDomainRoute, Route, SubdomainRoute}; use dioxus::prelude::*; use jacquard::smol_str::SmolStr; use jacquard::types::string::AtIdentifier; @@ -195,6 +195,78 @@ pub fn AppLink(props: AppLinkProps) -> Element { } } } + LinkMode::CustomDomain => { + // Custom domain mode - uses CustomDomainRoute for path-based routing + match props.to.clone() { + AppLinkTarget::Entry { entry_path, .. } => { + // Entry by title maps to path page + let route = CustomDomainRoute::PathPage { + segments: vec![entry_path.to_string()], + }; + rsx! { + Link { to: route, class: "{class}", {props.children} } + } + } + AppLinkTarget::EntryByRkey { rkey, .. } => { + let route = CustomDomainRoute::EntryByRkey { rkey }; + rsx! { + Link { to: route, class: "{class}", {props.children} } + } + } + AppLinkTarget::EntryEdit { rkey, .. } => { + let route = CustomDomainRoute::EntryEdit { rkey }; + rsx! { + Link { to: route, class: "{class}", {props.children} } + } + } + AppLinkTarget::Notebook { .. } => { + let route = CustomDomainRoute::Root {}; + rsx! { + Link { to: route, class: "{class}", {props.children} } + } + } + AppLinkTarget::Profile { ident } => { + let route = CustomDomainRoute::Profile { ident }; + rsx! { + Link { to: route, class: "{class}", {props.children} } + } + } + // These go to main domain in custom domain mode + AppLinkTarget::StandaloneEntry { ident, rkey } => { + let href = format!("{}/{}/e/{}", WEAVER_APP_HOST, ident, rkey); + rsx! { + a { href: "{href}", class: "{class}", {props.children} } + } + } + AppLinkTarget::StandaloneEntryEdit { ident, rkey } => { + let href = format!("{}/{}/e/{}/edit", WEAVER_APP_HOST, ident, rkey); + rsx! { + a { href: "{href}", class: "{class}", {props.children} } + } + } + AppLinkTarget::NewDraft { ident, notebook } => { + let href = match notebook { + Some(nb) => format!("{}/{}/new?notebook={}", WEAVER_APP_HOST, ident, nb), + None => format!("{}/{}/new", WEAVER_APP_HOST, ident), + }; + rsx! { + a { href: "{href}", class: "{class}", {props.children} } + } + } + AppLinkTarget::Drafts { ident } => { + let href = format!("{}/{}/drafts", WEAVER_APP_HOST, ident); + rsx! { + a { href: "{href}", class: "{class}", {props.children} } + } + } + AppLinkTarget::Invites { ident } => { + let href = format!("{}/{}/invites", WEAVER_APP_HOST, ident); + rsx! { + a { href: "{href}", class: "{class}", {props.children} } + } + } + } + } } } diff --git a/crates/weaver-app/src/custom_domain_app.rs b/crates/weaver-app/src/custom_domain_app.rs new file mode 100644 index 0000000..e8fea3a --- /dev/null +++ b/crates/weaver-app/src/custom_domain_app.rs @@ -0,0 +1,150 @@ +//! Custom domain Dioxus application. +//! +//! Separate router for custom domain hosting (e.g., myblog.com). +//! Uses site.standard.publication documents with path-based routing. + +use dioxus::prelude::*; +use jacquard::smol_str::SmolStr; +use jacquard::types::string::AtIdentifier; + +use crate::components::identity::RepositoryIndex; +use crate::host_mode::CustomDomainContext; + +/// Custom domain route enum - path-based routing for publications. +#[derive(Debug, Clone, Routable, PartialEq)] +#[rustfmt::skip] +pub enum CustomDomainRoute { + #[layout(CustomDomainLayout)] + /// Root/landing page. + #[route("/")] + Root {}, + /// Explicit index page. + #[route("/index")] + Index {}, + /// Entry by rkey (direct lookup). + #[route("/e/:rkey")] + EntryByRkey { rkey: SmolStr }, + /// Entry edit by rkey. + #[route("/e/:rkey/edit")] + EntryEdit { rkey: SmolStr }, + /// Profile/repository view. + #[route("/u/:ident")] + Profile { ident: AtIdentifier<'static> }, + /// Path-based document (catch-all, must be last). + #[route("/*segments")] + PathPage { segments: Vec }, +} + +/// Root component for custom domain app. +#[component] +pub fn CustomDomainApp() -> Element { + rsx! { + document::Link { rel: "icon", href: crate::FAVICON } + document::Link { rel: "preconnect", href: "https://fonts.googleapis.com" } + document::Link { rel: "preconnect", href: "https://fonts.gstatic.com" } + document::Link { rel: "stylesheet", href: crate::THEME_DEFAULTS_CSS } + document::Link { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600;1,700&family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&family=IBM+Plex+Serif:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;1,200;1,300;1,400;1,500;1,600;1,700&display=swap" } + document::Link { rel: "stylesheet", href: crate::MAIN_CSS } + crate::components::toast::ToastProvider { + Router:: {} + } + } +} + +#[component] +fn CustomDomainLayout() -> Element { + let ctx = use_context::(); + rsx! { + nav { class: "custom-domain-nav", + a { href: "/", "{ctx.publication_name}" } + } + main { Outlet:: {} } + } +} + +#[component] +fn Root() -> Element { + rsx! { Index {} } +} + +#[component] +fn Index() -> Element { + let ctx = use_context::(); + + rsx! { + crate::views::NotebookIndex { + ident: ctx.owner.clone(), + book_title: ctx.publication_name.clone(), + } + } +} + +#[component] +fn EntryByRkey(rkey: ReadOnlySignal) -> Element { + let ctx = use_context::(); + + rsx! { + crate::views::NotebookEntryByRkey { + ident: ctx.owner.clone(), + book_title: ctx.publication_name.clone(), + rkey: rkey, + } + } +} + +#[component] +fn EntryEdit(rkey: ReadOnlySignal) -> Element { + let ctx = use_context::(); + + rsx! { + crate::views::NotebookEntryEdit { + ident: ctx.owner.clone(), + book_title: ctx.publication_name.clone(), + rkey: rkey, + } + } +} + +#[component] +fn Profile(ident: AtIdentifier<'static>) -> Element { + rsx! { + RepositoryIndex { ident } + } +} + +#[component] +fn PathPage(segments: ReadOnlySignal>) -> Element { + let ctx = use_context::(); + + let ident = use_memo(move || ctx.owner.clone()); + let rkey = use_memo(move || ctx.publication_rkey.clone()); + let path = use_memo(move || format!("/{}", segments().join("/"))); + + let (doc_res, doc_data) = + crate::data::use_custom_domain_document_data(ident.into(), rkey.into(), path.into()); + + #[cfg(feature = "fullstack-server")] + let _doc_res = doc_res?; + + #[cfg(not(feature = "fullstack-server"))] + let _ = doc_res; + + match &*doc_data.read() { + Some(data) => { + let title = data.document.title.as_ref(); + + rsx! { + article { class: "document-content", + h1 { "{title}" } + div { + class: "rendered-content", + dangerous_inner_html: "{data.rendered_html}" + } + } + } + } + None => rsx! { + div { class: "loading", "Loading..." } + }, + } +} diff --git a/crates/weaver-app/src/data.rs b/crates/weaver-app/src/data.rs index 5e2b1db..4eb3b01 100644 --- a/crates/weaver-app/src/data.rs +++ b/crates/weaver-app/src/data.rs @@ -1851,7 +1851,7 @@ pub fn use_pckt_document_data( use jacquard::prelude::IdentityResolver; use weaver_api::site_standard::document::Document as SiteStandardDocument; use weaver_api::site_standard::publication::Publication; - use weaver_renderer::pckt::{PcktRenderContext, render_content_blocks}; + use weaver_renderer::pckt::{PcktRenderContext, render_document_content}; let ident = ident(); let rkey = rkey(); @@ -1886,14 +1886,19 @@ pub fn use_pckt_document_data( }; // Fetch publication to get base URL - let publication_url = - if let Ok(pub_record) = fetcher.fetch_record_slingshot(&doc.publication).await { + use jacquard::types::string::Uri; + let publication_url = if let Uri::At(site_uri) = &doc.site { + if let Ok(pub_record) = fetcher.fetch_record_slingshot(site_uri).await { jacquard::from_data::(&pub_record.value) .ok() .map(|p| p.url.as_ref().to_string()) } else { None - }; + } + } else { + // Site is an HTTPS URL, use it directly + Some(doc.site.as_str().to_string()) + }; // Render HTML let rendered_html = { @@ -1902,8 +1907,8 @@ pub fn use_pckt_document_data( AtIdentifier::Handle(h) => fetcher.resolve_handle(h).await.ok()?.into_static(), }; let ctx = PcktRenderContext::new(author_did); - if let Some(blocks) = &doc.content { - Some(render_content_blocks(blocks, &ctx, &fetcher).await) + if let Some(content) = &doc.content { + Some(render_document_content(content, &ctx, &fetcher).await) } else { Some(String::from("

No content

")) } @@ -1956,7 +1961,7 @@ pub fn use_pckt_document_data( use jacquard::prelude::IdentityResolver; use weaver_api::site_standard::document::Document as SiteStandardDocument; use weaver_api::site_standard::publication::Publication; - use weaver_renderer::pckt::{PcktRenderContext, render_content_blocks}; + use weaver_renderer::pckt::{PcktRenderContext, render_document_content}; let fetcher = use_context::(); @@ -1996,14 +2001,19 @@ pub fn use_pckt_document_data( }; // Fetch publication to get base URL - let publication_url = - if let Ok(pub_record) = fetcher.fetch_record_slingshot(&doc.publication).await { + use jacquard::types::string::Uri; + let publication_url = if let Uri::At(site_uri) = &doc.site { + if let Ok(pub_record) = fetcher.fetch_record_slingshot(site_uri).await { jacquard::from_data::(&pub_record.value) .ok() .map(|p| p.url.as_ref().to_string()) } else { None - }; + } + } else { + // Site is an HTTPS URL, use it directly + Some(doc.site.as_str().to_string()) + }; // Render HTML let rendered_html = { @@ -2012,8 +2022,8 @@ pub fn use_pckt_document_data( AtIdentifier::Handle(h) => fetcher.resolve_handle(h).await.ok()?.into_static(), }; let ctx = PcktRenderContext::new(author_did); - if let Some(blocks) = &doc.content { - Some(render_content_blocks(blocks, &ctx, &fetcher).await) + if let Some(content) = &doc.content { + Some(render_document_content(content, &ctx, &fetcher).await) } else { Some(String::from("

No content

")) } @@ -2061,3 +2071,163 @@ pub async fn cache_blob_bytes( cache.insert_bytes(cid, body, cache_key); Ok(()) } + +// ============================================================================ +// Custom Domain Document Resolution +// ============================================================================ + +use weaver_api::sh_weaver::domain::DocumentView; + +/// Typed data returned from custom domain document resolution. +#[derive(Clone, Debug, PartialEq)] +pub struct CustomDomainDocumentData { + pub document: DocumentView<'static>, + pub rendered_html: String, +} + +#[cfg(feature = "fullstack-server")] +pub fn use_custom_domain_document_data( + ident: ReadSignal>, + publication_rkey: ReadSignal, + path: ReadSignal, +) -> ( + Result>, RenderError>, + Memo>, +) { + let fetcher = use_context::(); + let fetcher = fetcher.clone(); + + let res = use_server_future(use_reactive!(|(ident, publication_rkey, path)| { + let fetcher = fetcher.clone(); + async move { + use jacquard::prelude::XrpcClient; + use jacquard::smol_str::format_smolstr; + use jacquard::types::aturi::AtUri; + use weaver_api::sh_weaver::domain::resolve_document::ResolveDocument; + use weaver_api::site_standard::document::Document; + use weaver_renderer::pckt::{PcktRenderContext, render_document_content}; + + let ident_val = ident(); + let rkey = publication_rkey(); + let path_val = path(); + + let author_did = match &ident_val { + AtIdentifier::Did(d) => d.clone().into_static(), + AtIdentifier::Handle(h) => fetcher.resolve_handle(h).await.ok()?.into_static(), + }; + + let pub_uri_str = + format_smolstr!("at://{}/site.standard.publication/{}", author_did, rkey); + let pub_uri = AtUri::new(&pub_uri_str).ok()?; + + let output = fetcher + .send( + ResolveDocument::new() + .publication(pub_uri) + .path(&path_val) + .build(), + ) + .await + .ok()? + .into_output() + .ok()?; + + let doc_view = output.document; + let document = jacquard::from_data::(&doc_view.record).ok()?; + + let rendered_html = if let Some(content) = &document.content { + let ctx = PcktRenderContext::new(author_did); + render_document_content(content, &ctx, &*fetcher.get_client()).await + } else { + String::new() + }; + + Some((serde_json::to_value(&doc_view).ok()?, rendered_html)) + } + })); + + let memo = use_memo(use_reactive!(|res| { + let res = res.as_ref().ok()?; + if let Some(Some((doc_json, html))) = &*res.read() { + let document = jacquard::from_json_value::(doc_json.clone()).ok()?; + Some(CustomDomainDocumentData { + document, + rendered_html: html.clone(), + }) + } else { + None + } + })); + + (res, memo) +} + +#[cfg(not(feature = "fullstack-server"))] +pub fn use_custom_domain_document_data( + ident: ReadSignal>, + publication_rkey: ReadSignal, + path: ReadSignal, +) -> ( + Resource>, + Memo>, +) { + let fetcher = use_context::(); + let fetcher = fetcher.clone(); + + let res = use_resource(move || { + let fetcher = fetcher.clone(); + async move { + use jacquard::IntoStatic; + use jacquard::prelude::XrpcClient; + use jacquard::smol_str::format_smolstr; + use jacquard::types::aturi::AtUri; + use weaver_api::sh_weaver::domain::resolve_document::ResolveDocument; + use weaver_api::site_standard::document::Document; + use weaver_renderer::pckt::{PcktRenderContext, render_document_content}; + + let ident_val = ident(); + let rkey = publication_rkey(); + let path_val = path(); + + let author_did = match &ident_val { + AtIdentifier::Did(d) => d.clone().into_static(), + AtIdentifier::Handle(h) => fetcher.resolve_handle(h).await.ok()?.into_static(), + }; + + let pub_uri_str = + format_smolstr!("at://{}/site.standard.publication/{}", author_did, rkey); + let pub_uri = AtUri::new(&pub_uri_str).ok()?; + + let output = fetcher + .send( + ResolveDocument::new() + .publication(pub_uri) + .path(&path_val) + .build(), + ) + .await + .ok()? + .into_output() + .ok()?; + + let doc_view = output.document.into_static(); + let document = jacquard::from_data::(&doc_view.record).ok()?; + + let rendered_html = if let Some(content) = &document.content { + let ctx = PcktRenderContext::new(author_did); + render_document_content(content, &ctx, &*fetcher.get_client()).await + } else { + String::new() + }; + + Some(CustomDomainDocumentData { + document: doc_view.clone(), + rendered_html, + }) + } + }); + + let memo = use_memo(move || res.cloned().flatten()); + + (res, memo) +} diff --git a/crates/weaver-app/src/host_mode.rs b/crates/weaver-app/src/host_mode.rs index dec6147..e914f46 100644 --- a/crates/weaver-app/src/host_mode.rs +++ b/crates/weaver-app/src/host_mode.rs @@ -5,6 +5,31 @@ use jacquard::smol_str::{SmolStr, format_smolstr}; use jacquard::types::string::AtIdentifier; use serde::{Deserialize, Serialize}; +/// Unified host context resolved by middleware. +/// +/// This is inserted into request extensions by the host resolution middleware +/// and read by the Dioxus app to determine which router to use. +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +pub enum HostContext { + /// Main weaver.sh domain - use full Route enum. + MainDomain, + /// Subdomain hosting (notebook.weaver.sh) - use SubdomainRoute. + Subdomain(SubdomainContext), + /// Custom domain (myblog.com) - use CustomDomainRoute. + CustomDomain(CustomDomainContext), +} + +impl HostContext { + /// Get the link mode for this host context. + pub fn link_mode(&self) -> LinkMode { + match self { + HostContext::MainDomain => LinkMode::MainDomain, + HostContext::Subdomain(_) => LinkMode::Subdomain, + HostContext::CustomDomain(_) => LinkMode::CustomDomain, + } + } +} + /// Context for subdomain routing - identifies the notebook being served. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(bound(deserialize = ""))] @@ -37,6 +62,23 @@ impl SubdomainContext { } } +/// Context for custom domain routing - identifies the publication being served. +#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] +#[serde(bound(deserialize = ""))] +pub struct CustomDomainContext { + /// Custom domain (e.g., "myblog.com"). + pub domain: SmolStr, + /// DID of the publication owner. + #[serde(deserialize_with = "deserialize_static_ident")] + pub owner: AtIdentifier<'static>, + /// Publication rkey. + pub publication_rkey: SmolStr, + /// Publication name. + pub publication_name: SmolStr, + /// For weaver-backed publications, the backing notebook URI. + pub notebook_uri: Option, +} + /// Link mode for generating appropriate URLs based on host context. /// /// Components use this context to generate links that work on both @@ -48,6 +90,8 @@ pub enum LinkMode { MainDomain, /// Subdomain - simplified paths like /:entry Subdomain, + /// Custom domain - paths like /:path for publications + CustomDomain, } impl LinkMode { @@ -56,6 +100,11 @@ impl LinkMode { matches!(self, LinkMode::Subdomain) } + /// Check if we're in a hosted mode (subdomain or custom domain). + pub fn is_hosted(&self) -> bool { + matches!(self, LinkMode::Subdomain | LinkMode::CustomDomain) + } + /// Generate link to a notebook entry by title. pub fn entry_link( &self, @@ -65,7 +114,7 @@ impl LinkMode { ) -> SmolStr { match self { LinkMode::MainDomain => format_smolstr!("/{}/{}/{}", ident, book_title, entry_title), - LinkMode::Subdomain => format_smolstr!("/{}", entry_title), + LinkMode::Subdomain | LinkMode::CustomDomain => format_smolstr!("/{}", entry_title), } } @@ -78,7 +127,7 @@ impl LinkMode { ) -> SmolStr { match self { LinkMode::MainDomain => format_smolstr!("/{}/{}/e/{}", ident, book_title, rkey), - LinkMode::Subdomain => format_smolstr!("/e/{}", rkey), + LinkMode::Subdomain | LinkMode::CustomDomain => format_smolstr!("/e/{}", rkey), } } @@ -91,7 +140,7 @@ impl LinkMode { ) -> SmolStr { match self { LinkMode::MainDomain => format_smolstr!("/{}/{}/e/{}/edit", ident, book_title, rkey), - LinkMode::Subdomain => format_smolstr!("/e/{}/edit", rkey), + LinkMode::Subdomain | LinkMode::CustomDomain => format_smolstr!("/e/{}/edit", rkey), } } @@ -99,7 +148,7 @@ impl LinkMode { pub fn notebook_link(&self, ident: &AtIdentifier<'_>, book_title: &str) -> SmolStr { match self { LinkMode::MainDomain => format_smolstr!("/{}/{}", ident, book_title), - LinkMode::Subdomain => SmolStr::new_static("/"), + LinkMode::Subdomain | LinkMode::CustomDomain => SmolStr::new_static("/"), } } @@ -107,7 +156,7 @@ impl LinkMode { pub fn profile_link(&self, ident: &AtIdentifier<'_>) -> SmolStr { match self { LinkMode::MainDomain => format_smolstr!("/{}", ident), - LinkMode::Subdomain => format_smolstr!("/u/{}", ident), + LinkMode::Subdomain | LinkMode::CustomDomain => format_smolstr!("/u/{}", ident), } } @@ -115,8 +164,10 @@ impl LinkMode { pub fn standalone_entry_link(&self, ident: &AtIdentifier<'_>, rkey: &str) -> SmolStr { match self { LinkMode::MainDomain => format_smolstr!("/{}/e/{}", ident, rkey), - // Standalone entries don't exist in subdomain mode - link to main domain - LinkMode::Subdomain => format_smolstr!("{}/{}/e/{}", WEAVER_APP_HOST, ident, rkey), + // Standalone entries don't exist in hosted mode - link to main domain + LinkMode::Subdomain | LinkMode::CustomDomain => { + format_smolstr!("{}/{}/e/{}", WEAVER_APP_HOST, ident, rkey) + } } } @@ -125,7 +176,9 @@ impl LinkMode { match self { LinkMode::MainDomain => format_smolstr!("/{}/e/{}/edit", ident, rkey), // Edit on main domain - LinkMode::Subdomain => format_smolstr!("{}/{}/e/{}/edit", WEAVER_APP_HOST, ident, rkey), + LinkMode::Subdomain | LinkMode::CustomDomain => { + format_smolstr!("{}/{}/e/{}/edit", WEAVER_APP_HOST, ident, rkey) + } } } @@ -135,10 +188,12 @@ impl LinkMode { (LinkMode::MainDomain, Some(nb)) => format_smolstr!("/{}/new?notebook={}", ident, nb), (LinkMode::MainDomain, None) => format_smolstr!("/{}/new", ident), // Drafts are on main domain - (LinkMode::Subdomain, Some(nb)) => { + (LinkMode::Subdomain | LinkMode::CustomDomain, Some(nb)) => { format_smolstr!("{}/{}/new?notebook={}", WEAVER_APP_HOST, ident, nb) } - (LinkMode::Subdomain, None) => format_smolstr!("{}/{}/new", WEAVER_APP_HOST, ident), + (LinkMode::Subdomain | LinkMode::CustomDomain, None) => { + format_smolstr!("{}/{}/new", WEAVER_APP_HOST, ident) + } } } @@ -146,7 +201,9 @@ impl LinkMode { pub fn drafts_link(&self, ident: &AtIdentifier<'_>) -> SmolStr { match self { LinkMode::MainDomain => format_smolstr!("/{}/drafts", ident), - LinkMode::Subdomain => format_smolstr!("{}/{}/drafts", WEAVER_APP_HOST, ident), + LinkMode::Subdomain | LinkMode::CustomDomain => { + format_smolstr!("{}/{}/drafts", WEAVER_APP_HOST, ident) + } } } @@ -154,7 +211,14 @@ impl LinkMode { pub fn invites_link(&self, ident: &AtIdentifier<'_>) -> SmolStr { match self { LinkMode::MainDomain => format_smolstr!("/{}/invites", ident), - LinkMode::Subdomain => format_smolstr!("{}/{}/invites", WEAVER_APP_HOST, ident), + LinkMode::Subdomain | LinkMode::CustomDomain => { + format_smolstr!("{}/{}/invites", WEAVER_APP_HOST, ident) + } } } + + /// Generate link to a document by path (for custom domain publications). + pub fn document_link(&self, path: &str) -> SmolStr { + format_smolstr!("/{}", path.trim_start_matches('/')) + } } diff --git a/crates/weaver-app/src/lib.rs b/crates/weaver-app/src/lib.rs index 72a58ee..f2e8693 100644 --- a/crates/weaver-app/src/lib.rs +++ b/crates/weaver-app/src/lib.rs @@ -29,12 +29,17 @@ pub mod perf; pub mod record_utils; pub mod service_worker; +pub mod custom_domain_app; +#[cfg(feature = "server")] +pub mod middleware; pub mod subdomain_app; pub mod views; +#[cfg(feature = "server")] +pub mod well_known; -pub use host_mode::{LinkMode, SubdomainContext}; -pub use subdomain_app::SubdomainApp; -pub use subdomain_app::SubdomainRoute; +pub use custom_domain_app::{CustomDomainApp, CustomDomainRoute}; +pub use host_mode::{CustomDomainContext, HostContext, LinkMode, SubdomainContext}; +pub use subdomain_app::{SubdomainApp, SubdomainRoute}; use auth::{AuthState, AuthStore}; use components::{EntryPage, Repository, RepositoryIndex}; @@ -48,16 +53,6 @@ use views::{ WhiteWindEntry, WhiteWindEntryNsid, }; -use crate::{ - env::WEAVER_APP_DOMAIN, - subdomain_app::{extract_subdomain, lookup_subdomain_context}, -}; - -/// Reserved subdomains that should not be used for notebooks. -const RESERVED_SUBDOMAINS: &[&str] = &[ - "www", "api", "admin", "app", "auth", "cdn", "alpha", "beta", "staging", "index", -]; - #[derive(Debug, Clone, Routable, PartialEq)] #[rustfmt::skip] pub enum Route { @@ -150,80 +145,30 @@ pub fn App() -> Element { )) }); + // Read host context from request extensions (set by middleware). #[cfg(feature = "fullstack-server")] - let ctx_resource = use_server_future({ - let fetcher = fetcher.clone(); - move || { - let fetcher = fetcher.clone(); - async move { - use dioxus::fullstack::FullstackContext; - use http::header::HOST; - - // Get host header from request - let Some(ctx) = FullstackContext::current() else { - tracing::warn!("No FullstackContext available"); - return None; - }; - let parts = ctx.parts_mut(); - - let Some(host_header) = parts.headers.get(HOST) else { - tracing::warn!("No Host header in request"); - return None; - }; - let Ok(host) = host_header.to_str() else { - tracing::warn!("Host header not valid UTF-8"); - return None; - }; + let host_ctx = { + use_server_cached(|| { + use dioxus::fullstack::FullstackContext; - let host_str = host.split(':').next().unwrap_or(host); - let Some(subdomain) = extract_subdomain(host_str, WEAVER_APP_DOMAIN) else { - tracing::info!( - host_str, - domain = WEAVER_APP_DOMAIN, - "Not a subdomain request" - ); - return None; - }; - - // Check if subdomain is reserved - if RESERVED_SUBDOMAINS.contains(&subdomain.as_str()) { - tracing::info!(subdomain, "Reserved subdomain, skipping notebook lookup"); - return None; - } - - // Look up notebook by global path - let result = lookup_subdomain_context(&fetcher, &subdomain).await; - if result.is_none() { - tracing::warn!(subdomain, "Notebook lookup failed for subdomain"); - } - result - } - } - })?; - - #[cfg(feature = "fullstack-server")] - let ctx = match &*ctx_resource.read() { - Some(ctx) => ctx.clone(), - None => { - return rsx! { div { "Loading..." } }; - } + let ctx = FullstackContext::current(); + ctx.and_then(|c| { + let parts = c.parts_mut(); + parts.extensions.get::().cloned() + }) + .unwrap_or(HostContext::MainDomain) + }) }; #[cfg(not(feature = "fullstack-server"))] - let ctx = { None:: }; + let host_ctx = HostContext::MainDomain; let auth_state = use_signal(|| AuthState::default()); #[allow(unused)] let auth_state = use_context_provider(|| auth_state); - // Provide link mode for router-agnostic link generation (subdomain mode) - let sub = use_context_provider(|| { - if ctx.is_some() { - LinkMode::Subdomain - } else { - LinkMode::MainDomain - } - }); + // Provide link mode for router-agnostic link generation. + let _link_mode = use_context_provider(|| host_ctx.link_mode()); #[cfg(all(target_family = "wasm", target_os = "unknown"))] let restore_result = { @@ -251,16 +196,21 @@ pub fn App() -> Element { use_context_provider(|| restore_result); - if sub == LinkMode::Subdomain { - tracing::info!("App: rendering SubdomainApp"); - use_context_provider(|| ctx.unwrap()); - rsx! { - SubdomainApp {} + // Dispatch to appropriate app based on host context. + match host_ctx { + HostContext::Subdomain(ctx) => { + tracing::info!("App: rendering SubdomainApp"); + use_context_provider(|| ctx); + rsx! { SubdomainApp {} } + } + HostContext::CustomDomain(ctx) => { + tracing::info!("App: rendering CustomDomainApp"); + use_context_provider(|| ctx); + rsx! { CustomDomainApp {} } } - } else { - tracing::info!("App: rendering MainDomainApp"); - rsx! { - MainDomainApp {} + HostContext::MainDomain => { + tracing::info!("App: rendering MainDomainApp"); + rsx! { MainDomainApp {} } } } } diff --git a/crates/weaver-app/src/main.rs b/crates/weaver-app/src/main.rs index 2148d8f..fb9e1e9 100644 --- a/crates/weaver-app/src/main.rs +++ b/crates/weaver-app/src/main.rs @@ -15,16 +15,6 @@ use weaver_app::{App, CONFIG, SubdomainApp, SubdomainContext, fetch}; static ALLOCATOR: LockedAllocator = LockedAllocator::new(FreeListAllocator::new()); -/// Base domain for subdomain extraction. -#[cfg(feature = "server")] -const BASE_DOMAIN: &str = weaver_app::env::WEAVER_APP_DOMAIN; - -/// Reserved subdomains that should not be used for notebooks. -#[cfg(feature = "server")] -const RESERVED_SUBDOMAINS: &[&str] = &[ - "www", "api", "admin", "app", "auth", "cdn", "alpha", "beta", "staging", "index", -]; - fn main() { // Set up better panic messages for wasm #[cfg(target_arch = "wasm32")] @@ -98,6 +88,18 @@ fn main() { axum::Router::new() .route("/favicon.ico", get(weaver_app::favicon)) .serve_dioxus_application(ServeConfig::builder(), App) + // Host context resolution. + .layer(middleware::from_fn({ + let fetcher = fetcher.clone(); + move |req: Request, next: Next| { + let fetcher = fetcher.clone(); + async move { + weaver_app::middleware::host_context_middleware(req, next, fetcher) + .await + } + } + })) + // Insert fetcher and blob cache into extensions. .layer(middleware::from_fn({ let blob_cache = blob_cache.clone(); let fetcher = fetcher.clone(); diff --git a/crates/weaver-app/src/middleware.rs b/crates/weaver-app/src/middleware.rs new file mode 100644 index 0000000..d00b06d --- /dev/null +++ b/crates/weaver-app/src/middleware.rs @@ -0,0 +1,182 @@ +//! Axum middleware for host-based routing. + +use std::sync::Arc; + +use axum::{ + extract::Request, + http::header::HOST, + middleware::Next, + response::{IntoResponse, Redirect, Response}, +}; +use jacquard::IntoStatic; +use jacquard::client::AgentSessionExt; +use jacquard::smol_str::SmolStr; +use jacquard::smol_str::ToSmolStr; + +use crate::{ + env::WEAVER_APP_DOMAIN, + fetch::Fetcher, + host_mode::{CustomDomainContext, HostContext, SubdomainContext}, + subdomain_app::{extract_subdomain, lookup_subdomain_context}, +}; + +/// Reserved subdomains that should not be used for notebooks. +const RESERVED_SUBDOMAINS: &[&str] = &[ + "www", "api", "admin", "app", "auth", "cdn", "alpha", "beta", "staging", "index", +]; + +/// Prefix for encoded publication hostnames (nb-{encoded}.weaver.sh). +const ENCODED_PUBLICATION_PREFIX: &str = "nb-"; + +/// Middleware that resolves host context and inserts it into request extensions. +/// +/// This handles: +/// - Encoded publication hostnames (nb-xxx.pub.weaver.sh) → redirect to real domain +/// - Subdomain routing (notebook.weaver.sh) → SubdomainContext +/// - Custom domain routing (myblog.com) → CustomDomainContext +/// - Main domain (weaver.sh) → MainDomain +pub async fn host_context_middleware( + mut req: Request, + next: Next, + fetcher: Arc, +) -> Response { + // Extract everything we need from the request BEFORE any async calls. + // The body type isn't Sync, so we can't hold &req across await points. + let host = extract_host(&req); + let path = req.uri().path().to_string(); + let query = req + .uri() + .query() + .map(|q| format!("?{}", q)) + .unwrap_or_default(); + + let Some(host) = host else { + tracing::warn!("No Host header in request"); + req.extensions_mut().insert(HostContext::MainDomain); + return next.run(req).await; + }; + + // Strip port if present. + let host_str = host.split(':').next().unwrap_or(&host).to_string(); + + // Check if this is a weaver domain subdomain. + if let Some(subdomain) = extract_subdomain(&host_str, WEAVER_APP_DOMAIN) { + // Check for encoded publication hostname (nb-xxx.pub.weaver.sh). + if let Some(redirect_url) = + handle_encoded_publication(&subdomain, &path, &query, fetcher.clone()).await + { + return Redirect::permanent(&redirect_url).into_response(); + } + + // Check for reserved subdomains. + if RESERVED_SUBDOMAINS.contains(&subdomain.as_str()) { + tracing::debug!(subdomain, "Reserved subdomain, using main domain"); + req.extensions_mut().insert(HostContext::MainDomain); + return next.run(req).await; + } + + // Try to look up notebook for this subdomain. + if let Some(ctx) = lookup_subdomain_context(&fetcher, &subdomain).await { + tracing::debug!(subdomain, "Resolved subdomain context"); + req.extensions_mut().insert(HostContext::Subdomain(ctx)); + return next.run(req).await; + } + + // Subdomain not found, fall through to main domain. + tracing::warn!(subdomain, "Subdomain not found, using main domain"); + req.extensions_mut().insert(HostContext::MainDomain); + return next.run(req).await; + } + + // Not a weaver subdomain - check for custom domain. + if let Some(ctx) = lookup_custom_domain(fetcher.clone(), &host_str).await { + tracing::debug!(domain = host_str, "Resolved custom domain context"); + req.extensions_mut().insert(HostContext::CustomDomain(ctx)); + return next.run(req).await; + } + + // Unknown domain, use main domain routing. + tracing::debug!(host = host_str, "Unknown host, using main domain"); + req.extensions_mut().insert(HostContext::MainDomain); + next.run(req).await +} + +/// Extract the Host header from the request. +fn extract_host(req: &Request) -> Option { + req.headers() + .get(HOST)? + .to_str() + .ok() + .map(|s| s.to_string()) +} + +/// Handle encoded publication hostname (nb-{encoded}.weaver.sh). +/// +/// Returns Some(redirect_url) if this is an encoded hostname that should redirect. +async fn handle_encoded_publication( + subdomain: &str, + path: &str, + query: &str, + fetcher: Arc, +) -> Option { + // Check if subdomain matches pattern: nb-{encoded} + if !subdomain.starts_with(ENCODED_PUBLICATION_PREFIX) { + return None; + } + + // Decode the publication subdomain. + let Some((did, rkey)) = weaver_common::domain_encoding::decode_publication_subdomain(subdomain) + else { + tracing::warn!(subdomain, "Failed to decode publication subdomain"); + return None; + }; + + // Look up the publication to get the real domain. + let domain = lookup_publication_domain(fetcher, did.as_str(), rkey.as_str()).await?; + + Some(format!("https://{}{}{}", domain, path, query)) +} + +/// Look up publication domain by DID and rkey. +async fn lookup_publication_domain(fetcher: Arc, did: &str, rkey: &str) -> Option { + use jacquard::types::string::Uri; + use weaver_api::site_standard::publication::Publication; + + let uri_str = format!("at://{}/site.standard.publication/{}", did, rkey); + let uri = Publication::uri(&uri_str).ok()?; + + let record = fetcher.fetch_record(&uri).await.ok()?; + + // Extract domain from the already-parsed publication URL. + match &record.value.url { + Uri::Https(url) | Uri::Wss(url) => url.host_str().map(|h| h.to_string()), + _ => None, + } +} + +/// Look up custom domain context. +async fn lookup_custom_domain(fetcher: Arc, domain: &str) -> Option { + use jacquard::prelude::XrpcClient; + use weaver_api::sh_weaver::domain::resolve_by_domain::ResolveByDomain; + + let output = fetcher + .send(ResolveByDomain::new().domain(domain).build()) + .await + .ok()? + .into_output() + .ok()?; + + let pub_view = output.publication; + + Some(CustomDomainContext { + domain: SmolStr::new(domain), + owner: jacquard::types::string::AtIdentifier::Did( + jacquard::types::string::Did::new(&pub_view.did) + .ok()? + .into_static(), + ), + publication_rkey: pub_view.rkey.to_smolstr(), + publication_name: pub_view.name.to_smolstr(), + notebook_uri: pub_view.notebook_uri.map(|u| u.to_smolstr()), + }) +} diff --git a/crates/weaver-app/src/subdomain_app.rs b/crates/weaver-app/src/subdomain_app.rs index d1ed370..23818a4 100644 --- a/crates/weaver-app/src/subdomain_app.rs +++ b/crates/weaver-app/src/subdomain_app.rs @@ -100,6 +100,7 @@ const LAYOUTS_CSS: Asset = asset!("/assets/styling/layouts.css"); /// Root component for subdomain app. #[component] pub fn SubdomainApp() -> Element { + tracing::info!("SubdomainApp: rendering root"); rsx! { document::Link { rel: "icon", href: crate::FAVICON } document::Link { rel: "preconnect", href: "https://fonts.googleapis.com" } @@ -118,7 +119,9 @@ pub fn SubdomainApp() -> Element { /// Landing page - check for custom "/" entry, else show notebook index. #[component] fn SubdomainLanding() -> Element { + tracing::info!("SubdomainLanding: start"); let ctx = use_context::(); + tracing::info!("SubdomainLanding: got context, rendering"); // TODO: Check for entry with custom path "/" for this notebook. // For now, just render the notebook index. diff --git a/crates/weaver-app/src/views/notebook.rs b/crates/weaver-app/src/views/notebook.rs index 00c2925..68be0a6 100644 --- a/crates/weaver-app/src/views/notebook.rs +++ b/crates/weaver-app/src/views/notebook.rs @@ -69,22 +69,25 @@ pub fn NotebookIndex( ident: ReadSignal>, book_title: ReadSignal, ) -> Element { - tracing::debug!( - "NotebookIndex component rendering for ident: {:?}, book: {}", + tracing::info!( + "NotebookIndex: start, ident={:?}, book={}", ident(), book_title() ); // Fetch full notebook metadata with SSR support // IMPORTANT: Call ALL hooks before any ? early returns to maintain hook order let (notebook_result, notebook_data) = data::use_notebook(ident, book_title); + tracing::info!("NotebookIndex: use_notebook returned"); let (entries_result, entries_resource) = data::use_notebook_entries(ident, book_title); - tracing::debug!("NotebookIndex got notebook data and entries"); + tracing::info!("NotebookIndex: use_notebook_entries returned"); #[cfg(feature = "fullstack-server")] notebook_result?; + tracing::info!("NotebookIndex: past notebook_result?"); #[cfg(feature = "fullstack-server")] entries_result?; + tracing::info!("NotebookIndex: past entries_result?"); // Check ownership for "Add Entry" button let auth_state = use_context::>(); diff --git a/crates/weaver-app/src/views/subdomain_navbar.rs b/crates/weaver-app/src/views/subdomain_navbar.rs index 2f95f05..c1453f4 100644 --- a/crates/weaver-app/src/views/subdomain_navbar.rs +++ b/crates/weaver-app/src/views/subdomain_navbar.rs @@ -26,9 +26,11 @@ const NOTEBOOK_CARD_CSS: Asset = asset!("/assets/styling/notebook-card.css"); #[component] pub fn SubdomainNavbar() -> Element { + tracing::info!("SubdomainNavbar: start"); let ctx = use_context::(); let route = use_route::(); let auth_state = use_context::>(); + tracing::info!("SubdomainNavbar: got context"); #[allow(unused)] let fetcher = use_context::(); @@ -180,10 +182,13 @@ fn SubdomainAuthButton(did: Did<'static>) -> Element { #[component] fn AuthorProfileLink(ident: ReadSignal>) -> Element { + tracing::info!("AuthorProfileLink: start, ident={:?}", ident()); let (handle_res, handle) = use_handle(ident); + tracing::info!("AuthorProfileLink: use_handle returned"); #[cfg(feature = "fullstack-server")] handle_res?; + tracing::info!("AuthorProfileLink: past handle_res check"); rsx! { Link { diff --git a/crates/weaver-app/src/well_known.rs b/crates/weaver-app/src/well_known.rs new file mode 100644 index 0000000..ef0c4a7 --- /dev/null +++ b/crates/weaver-app/src/well_known.rs @@ -0,0 +1,37 @@ +//! Well-known endpoints for site.standard compatibility. + +use crate::host_mode::CustomDomainContext; +use axum::{Json, http::StatusCode}; +use jacquard::smol_str::{SmolStr, format_smolstr}; +use serde::Serialize; + +/// Well-known publication response per site.standard spec. +#[derive(Debug, Clone, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct WellKnownPublication { + pub publication_uri: SmolStr, + pub name: SmolStr, + pub url: SmolStr, +} + +/// Handle /.well-known/site.standard.publication +/// +/// Returns publication info for the current custom domain. +/// This handler expects CustomDomainContext to be set by middleware. +pub async fn well_known_publication( + ctx: Option>, +) -> Result, StatusCode> { + let ctx = ctx.ok_or(StatusCode::NOT_FOUND)?; + + let publication_uri = format_smolstr!( + "at://{}/site.standard.publication/{}", + ctx.owner, + ctx.publication_rkey + ); + + Ok(Json(WellKnownPublication { + publication_uri, + name: ctx.publication_name.clone(), + url: format_smolstr!("https://{}", ctx.domain), + })) +} diff --git a/crates/weaver-common/src/domain_encoding.rs b/crates/weaver-common/src/domain_encoding.rs new file mode 100644 index 0000000..6740b42 --- /dev/null +++ b/crates/weaver-common/src/domain_encoding.rs @@ -0,0 +1,112 @@ +//! DNS-safe encoding for publication AT-URIs. +//! +//! Custom domains use self-describing CNAME records pointing to +//! `nb-{encoded-did}-{rkey}.weaver.sh`. This module handles +//! encoding and decoding the subdomain portion. + +use jacquard::IntoStatic; +use jacquard::types::string::{Did, Tid}; + +const PREFIX: &str = "nb-"; + +/// Encode a Publication AT-URI into a DNS-safe subdomain. +/// +/// Encoding rules: +/// - DID `:` separators become `-` +/// - `did:web` dots become `_` (underscores are invalid in domain names, so unambiguous) +/// - rkey is appended as last segment (TIDs never contain hyphens) +/// +/// Examples: +/// - `did:plc:z72i7hdynmk6r22` + `3jui7kd2y2e2b` → `nb-plc-z72i7hdynmk6r22-3jui7kd2y2e2b` +/// - `did:web:example.com` + `3jui7kd2y2e2b` → `nb-web-example_com-3jui7kd2y2e2b` +pub fn encode_publication_subdomain(did: &Did, rkey: &Tid) -> String { + let did_str = did.as_str(); + + // did:plc:abc123 -> plc-abc123 + // did:web:example.com -> web-example_com + let encoded_did = did_str + .strip_prefix("did:") + .expect("valid DID") + .replace(':', "-") + .replace('.', "_"); + + format!("{}{}-{}", PREFIX, encoded_did, rkey.as_str()) +} + +/// Decode a publication subdomain back to DID and rkey. +/// +/// Parsing strategy: work from both ends since rkeys (TIDs) never contain hyphens. +pub fn decode_publication_subdomain(subdomain: &str) -> Option<(Did<'static>, Tid)> { + let inner = subdomain.strip_prefix(PREFIX)?; + + // Split at the LAST hyphen - rkey is on the right (TIDs have no hyphens) + let (did_part, rkey_str) = inner.rsplit_once('-')?; + + // Parse rkey as TID + let rkey = Tid::from(rkey_str.to_owned()); + + // Reconstruct DID from encoded form + // plc-abc123 -> did:plc:abc123 + // web-example_com -> did:web:example.com + let (method, identifier) = did_part.split_once('-')?; + let decoded_identifier = identifier.replace('_', "."); + let did_str = format!("did:{}:{}", method, decoded_identifier); + let did = Did::new(&did_str).ok()?; + + Some((did.into_static(), rkey)) +} + +#[cfg(test)] +mod tests { + use super::*; + use jacquard::IntoStatic; + + #[test] + fn roundtrip_did_plc() { + let did = Did::new("did:plc:z72i7hdynmk6r22").unwrap(); + let rkey = Tid::from("3jui7kd2y2e2b".to_owned()); + + let encoded = encode_publication_subdomain(&did, &rkey); + assert_eq!(encoded, "nb-plc-z72i7hdynmk6r22-3jui7kd2y2e2b"); + + let (decoded_did, decoded_rkey) = decode_publication_subdomain(&encoded).unwrap(); + assert_eq!(decoded_did, did.into_static()); + assert_eq!(decoded_rkey, rkey); + } + + #[test] + fn roundtrip_did_web() { + let did = Did::new("did:web:example.com").unwrap(); + let rkey = Tid::from("3jui7kd2y2e2b".to_owned()); + + let encoded = encode_publication_subdomain(&did, &rkey); + assert_eq!(encoded, "nb-web-example_com-3jui7kd2y2e2b"); + + let (decoded_did, decoded_rkey) = decode_publication_subdomain(&encoded).unwrap(); + assert_eq!(decoded_did, did.into_static()); + assert_eq!(decoded_rkey, rkey); + } + + #[test] + fn roundtrip_did_web_with_hyphens() { + let did = Did::new("did:web:my-cool-site.example.com").unwrap(); + let rkey = Tid::from("3jui7kd2y2e2b".to_owned()); + + let encoded = encode_publication_subdomain(&did, &rkey); + assert_eq!(encoded, "nb-web-my-cool-site_example_com-3jui7kd2y2e2b"); + + let (decoded_did, decoded_rkey) = decode_publication_subdomain(&encoded).unwrap(); + assert_eq!(decoded_did, did.into_static()); + assert_eq!(decoded_rkey, rkey); + } + + #[test] + fn decode_invalid_prefix() { + assert!(decode_publication_subdomain("foo-plc-abc123-rkey").is_none()); + } + + #[test] + fn decode_missing_method() { + assert!(decode_publication_subdomain("nb-abc123").is_none()); + } +} diff --git a/crates/weaver-common/src/lib.rs b/crates/weaver-common/src/lib.rs index 357597a..20ae16e 100644 --- a/crates/weaver-common/src/lib.rs +++ b/crates/weaver-common/src/lib.rs @@ -4,6 +4,7 @@ pub mod agent; #[cfg(feature = "cache")] pub mod cache; pub mod constellation; +pub mod domain_encoding; pub mod error; #[cfg(feature = "perf")] pub mod perf; @@ -15,6 +16,7 @@ pub mod worker_rt; // Re-export jacquard for convenience pub use agent::{SessionPeer, WeaverExt}; +pub use domain_encoding::{decode_publication_subdomain, encode_publication_subdomain}; pub use error::WeaverError; // Re-export blake3 for topic hashing diff --git a/crates/weaver-index/migrations/clickhouse/041_publications.sql b/crates/weaver-index/migrations/clickhouse/041_publications.sql new file mode 100644 index 0000000..8737d23 --- /dev/null +++ b/crates/weaver-index/migrations/clickhouse/041_publications.sql @@ -0,0 +1,45 @@ +-- site.standard.publication records +-- Source of truth for custom domain claims + +CREATE TABLE IF NOT EXISTS publications ( + -- Identity + did String, + rkey String, + cid String, + + -- Materialized URI for convenience + uri String MATERIALIZED concat('at://', did, '/site.standard.publication/', rkey), + + -- Queryable fields from record + name String DEFAULT '', + description String DEFAULT '', + url String DEFAULT '', -- Canonical URL (e.g., https://myblog.com) + + -- Extracted domain from url for fast lookup + domain String DEFAULT '', -- e.g., myblog.com + + -- Weaver-specific: notebook AT-URI if this publication is backed by a notebook + notebook_uri String DEFAULT '', + + -- Encoded CNAME target for reverse lookup + cname_target String MATERIALIZED concat('nb-', + replaceAll(replaceAll(substring(did, 5), ':', '-'), '.', '_'), + '-', rkey, '.pub.weaver.sh'), + + -- Timestamps + created_at DateTime64(3) DEFAULT toDateTime64(0, 3), + event_time DateTime64(3), + indexed_at DateTime64(3) DEFAULT now64(3), + + -- Soft delete + deleted_at DateTime64(3) DEFAULT toDateTime64(0, 3), + record JSON DEFAULT '{}' +) +ENGINE = ReplacingMergeTree(indexed_at) +ORDER BY (did, rkey); + +-- Index for domain lookup +ALTER TABLE publications ADD INDEX idx_domain domain TYPE bloom_filter GRANULARITY 4; + +-- Index for CNAME target lookup +ALTER TABLE publications ADD INDEX idx_cname_target cname_target TYPE bloom_filter GRANULARITY 4; diff --git a/crates/weaver-index/migrations/clickhouse/042_publications_mv.sql b/crates/weaver-index/migrations/clickhouse/042_publications_mv.sql new file mode 100644 index 0000000..6854dce --- /dev/null +++ b/crates/weaver-index/migrations/clickhouse/042_publications_mv.sql @@ -0,0 +1,34 @@ +-- Materialized view to populate publications from raw_records + +CREATE MATERIALIZED VIEW IF NOT EXISTS publications_mv TO publications AS +SELECT + did, + rkey, + cid, + + -- Extract fields from record + coalesce(record.name, '') AS name, + coalesce(record.description, '') AS description, + coalesce(record.url, '') AS url, + + -- Extract domain from URL (strip protocol and path) + -- https://myblog.com/path -> myblog.com + replaceRegexpOne( + replaceRegexpOne( + replaceRegexpOne(toString(record.url), '^https://', ''), + '^http://', '' + ), + '/.*$', '' + ) AS domain, + + -- Extract notebookUri from record (weaver-specific) + coalesce(record.notebookUri, '') AS notebook_uri, + + event_time, + indexed_at, + + -- Soft delete: if operation is delete, set deleted_at + if(operation = 'delete', event_time, toDateTime64(0, 3)) as deleted_at, + record +FROM raw_records +WHERE collection = 'site.standard.publication' diff --git a/crates/weaver-index/migrations/clickhouse/043_documents.sql b/crates/weaver-index/migrations/clickhouse/043_documents.sql new file mode 100644 index 0000000..8e2a880 --- /dev/null +++ b/crates/weaver-index/migrations/clickhouse/043_documents.sql @@ -0,0 +1,44 @@ +-- site.standard.document records +-- Documents within a publication, with custom path routing support + +CREATE TABLE IF NOT EXISTS documents ( + -- Identity + did String, + rkey String, + cid String, + + -- Materialized URI + uri String MATERIALIZED concat('at://', did, '/site.standard.document/', rkey), + + -- Parent publication reference + publication_uri String DEFAULT '', -- at://did/site.standard.publication/rkey + publication_did String DEFAULT '', + publication_rkey String DEFAULT '', + + -- Queryable fields + title String DEFAULT '', + description String DEFAULT '', + path String DEFAULT '', -- Custom URL path (e.g., /posts/my-first-post) + + -- Weaver-specific: entry reference if content contains BookEntryView + entry_uri String DEFAULT '', -- AT-URI of the backing sh.weaver.notebook.entry + entry_index Int64 DEFAULT -1, -- Index within the notebook (-1 if not weaver content) + + -- Normalized path for lookup (lowercase, no trailing slash) + path_normalized String MATERIALIZED lower(trimRight(path, '/')), + + -- Timestamps + published_at DateTime64(3) DEFAULT toDateTime64(0, 3), + updated_at DateTime64(3) DEFAULT toDateTime64(0, 3), + event_time DateTime64(3), + indexed_at DateTime64(3) DEFAULT now64(3), + + -- Soft delete + deleted_at DateTime64(3) DEFAULT toDateTime64(0, 3), + record JSON DEFAULT '{}' +) +ENGINE = ReplacingMergeTree(indexed_at) +ORDER BY (publication_did, publication_rkey, path_normalized, rkey); + +-- Index for path lookup within a publication +ALTER TABLE documents ADD INDEX idx_path path_normalized TYPE bloom_filter GRANULARITY 4; diff --git a/crates/weaver-index/migrations/clickhouse/044_documents_mv.sql b/crates/weaver-index/migrations/clickhouse/044_documents_mv.sql new file mode 100644 index 0000000..949e0f1 --- /dev/null +++ b/crates/weaver-index/migrations/clickhouse/044_documents_mv.sql @@ -0,0 +1,53 @@ +-- Materialized view to populate documents from raw_records + +CREATE MATERIALIZED VIEW IF NOT EXISTS documents_mv TO documents AS +SELECT + did, + rkey, + cid, + + -- Extract site reference (renamed from publication in lexicon) + coalesce(record.site, '') AS publication_uri, + + -- Parse publication DID from at://did/collection/rkey (only if it's an AT-URI) + if( + startsWith(toString(record.site), 'at://'), + extractAll(toString(record.site), 'at://([^/]+)/')[1], + '' + ) AS publication_did, + + -- Parse publication rkey + if( + startsWith(toString(record.site), 'at://'), + extractAll(toString(record.site), '/([^/]+)$')[1], + '' + ) AS publication_rkey, + + -- Extract fields from record + coalesce(record.title, '') AS title, + coalesce(record.description, '') AS description, + coalesce(record.path, '') AS path, + + -- Extract weaver entry info from content if it's a BookEntryView + if( + toString(record.content.`$type`) = 'sh.weaver.notebook.defs#bookEntryView', + coalesce(record.content.entry.uri, ''), + '' + ) AS entry_uri, + if( + toString(record.content.`$type`) = 'sh.weaver.notebook.defs#bookEntryView', + toInt64OrZero(toString(record.content.`index`)), + -1 + ) AS entry_index, + + -- Timestamps + parseDateTime64BestEffortOrZero(toString(record.publishedAt), 3) AS published_at, + parseDateTime64BestEffortOrZero(toString(record.updatedAt), 3) AS updated_at, + event_time, + indexed_at, + + -- Soft delete + if(operation = 'delete', event_time, toDateTime64(0, 3)) as deleted_at, + record +FROM raw_records +WHERE collection = 'site.standard.document' diff --git a/crates/weaver-index/migrations/clickhouse/045_custom_domains.sql b/crates/weaver-index/migrations/clickhouse/045_custom_domains.sql new file mode 100644 index 0000000..dde4c3a --- /dev/null +++ b/crates/weaver-index/migrations/clickhouse/045_custom_domains.sql @@ -0,0 +1,38 @@ +-- Denormalized view for fast custom domain to publication lookup +-- This is the main lookup table for routing custom domain requests + +CREATE TABLE IF NOT EXISTS custom_domains ( + -- Domain being claimed + domain String, + + -- Publication details + publication_did String, + publication_rkey String, + publication_name String, + publication_url String, + cname_target String, + + -- For conflict resolution: first claim wins + created_at DateTime64(3), + indexed_at DateTime64(3) DEFAULT now64(3), + + -- Soft delete when publication is deleted or URL changes + deleted_at DateTime64(3) DEFAULT toDateTime64(0, 3) +) +ENGINE = ReplacingMergeTree(indexed_at) +ORDER BY (domain); + +-- MV to populate from publications +CREATE MATERIALIZED VIEW IF NOT EXISTS custom_domains_mv TO custom_domains AS +SELECT + domain, + did AS publication_did, + rkey AS publication_rkey, + name AS publication_name, + url AS publication_url, + cname_target, + event_time AS created_at, + indexed_at, + deleted_at +FROM publications +WHERE domain != '' AND deleted_at = toDateTime64(0, 3); diff --git a/crates/weaver-index/src/clickhouse.rs b/crates/weaver-index/src/clickhouse.rs index 4649417..b2fdcae 100644 --- a/crates/weaver-index/src/clickhouse.rs +++ b/crates/weaver-index/src/clickhouse.rs @@ -7,8 +7,9 @@ mod schema; pub use client::{Client, TableSize}; pub use migrations::{DbObject, MigrationResult, Migrator, ObjectType}; pub use queries::{ - CollaboratorRow, EditChainNode, EditHeadRow, EditNodeRow, EntryRow, HandleMappingRow, - NotebookRow, ProfileCountsRow, ProfileRow, ProfileWithCounts, StaleDraftRow, + CollaboratorRow, CustomDomainRow, DocumentRow, EditChainNode, EditHeadRow, EditNodeRow, + EntryRow, HandleMappingRow, NotebookRow, ProfileCountsRow, ProfileRow, ProfileWithCounts, + PublicationRow, StaleDraftRow, }; pub use resilient_inserter::{InserterConfig, ResilientRecordInserter}; pub use schema::{ diff --git a/crates/weaver-index/src/clickhouse/queries.rs b/crates/weaver-index/src/clickhouse/queries.rs index 0fabb0e..6c2c0fb 100644 --- a/crates/weaver-index/src/clickhouse/queries.rs +++ b/crates/weaver-index/src/clickhouse/queries.rs @@ -9,6 +9,7 @@ mod edit; mod identity; mod notebooks; mod profiles; +mod publications; pub use collab::PermissionRow; pub use collab_state::{CollaboratorRow, EditHeadRow}; @@ -16,3 +17,4 @@ pub use edit::{EditChainNode, EditNodeRow, StaleDraftRow}; pub use identity::HandleMappingRow; pub use notebooks::{EntryRow, NotebookRow}; pub use profiles::{ProfileCountsRow, ProfileRow, ProfileWithCounts}; +pub use publications::{CustomDomainRow, DocumentRow, PublicationRow}; diff --git a/crates/weaver-index/src/clickhouse/queries/notebooks.rs b/crates/weaver-index/src/clickhouse/queries/notebooks.rs index 89b1d47..a6087da 100644 --- a/crates/weaver-index/src/clickhouse/queries/notebooks.rs +++ b/crates/weaver-index/src/clickhouse/queries/notebooks.rs @@ -138,7 +138,9 @@ impl Client { /// List entries for a specific notebook, ordered by position in the notebook. /// /// Uses notebook_entries table to get entries that belong to this notebook. - /// Deduplicates entries by rkey, keeping the most recently updated version. + /// Query is structured to avoid expensive double-FINAL joins by: + /// 1. First filtering notebook_entries in a subquery with argMax for dedup + /// 2. Then joining only those specific entries pub async fn list_notebook_entries( &self, notebook_did: &str, @@ -146,32 +148,41 @@ impl Client { limit: u32, cursor: Option, ) -> Result, IndexError> { - use std::collections::HashMap; - + // Two-phase query to avoid memory-expensive FINAL on large tables: + // 1. Get entry refs from notebook_entries using argMax dedup (no FINAL) + // 2. Join only those specific entries (targeted lookup, not full table FINAL) let query = r#" + WITH entry_refs AS ( + SELECT + entry_did, + entry_rkey, + argMax(position, indexed_at) AS position + FROM notebook_entries + WHERE notebook_did = ? + AND notebook_rkey = ? + GROUP BY entry_did, entry_rkey + HAVING position > ? + ORDER BY position ASC + LIMIT ? + ) SELECT e.did AS did, e.rkey AS rkey, - e.cid AS cid, - e.uri AS uri, - e.title AS title, - e.path AS path, - e.tags AS tags, - e.author_dids AS author_dids, - e.created_at AS created_at, - e.updated_at AS updated_at, - e.indexed_at AS indexed_at, - e.record AS record - FROM notebook_entries ne FINAL - INNER JOIN entries e FINAL ON - e.did = ne.entry_did - AND e.rkey = ne.entry_rkey - AND e.deleted_at = toDateTime64(0, 3) - WHERE ne.notebook_did = ? - AND ne.notebook_rkey = ? - AND ne.position > ? - ORDER BY ne.position ASC - LIMIT ? + argMax(e.cid, e.indexed_at) AS cid, + argMax(e.uri, e.indexed_at) AS uri, + argMax(e.title, e.indexed_at) AS title, + argMax(e.path, e.indexed_at) AS path, + argMax(e.tags, e.indexed_at) AS tags, + argMax(e.author_dids, e.indexed_at) AS author_dids, + argMax(e.created_at, e.indexed_at) AS created_at, + argMax(e.updated_at, e.indexed_at) AS updated_at, + max(e.indexed_at) AS indexed_at, + argMax(e.record, e.indexed_at) AS record + FROM entries e + INNER JOIN entry_refs er ON e.did = er.entry_did AND e.rkey = er.entry_rkey + WHERE e.deleted_at = toDateTime64(0, 3) + GROUP BY e.did, e.rkey + ORDER BY any(er.position) ASC "#; let cursor_val = cursor.unwrap_or(0); @@ -182,8 +193,7 @@ impl Client { .bind(notebook_did) .bind(notebook_rkey) .bind(cursor_val) - // Fetch extra to account for duplicates we'll filter out - .bind(limit * 2) + .bind(limit) .fetch_all::() .await .map_err(|e| ClickHouseError::Query { @@ -191,28 +201,7 @@ impl Client { source: e, })?; - // Dedupe by rkey, keeping the most recently updated version - let mut seen: HashMap = HashMap::new(); - let mut deduped: Vec = Vec::with_capacity(rows.len()); - - for row in rows { - if let Some(&existing_idx) = seen.get(&row.rkey) { - // Keep the one with the more recent updated_at - if row.updated_at > deduped[existing_idx].updated_at { - deduped[existing_idx] = row; - } - } else { - seen.insert(row.rkey.clone(), deduped.len()); - deduped.push(row); - } - - // Stop once we have enough unique entries - if deduped.len() >= limit as usize { - break; - } - } - - Ok(deduped) + Ok(rows) } /// Get an entry by rkey, picking the most recent version across collaborators. @@ -716,29 +705,39 @@ impl Client { let offset = if index > 0 { index - 1 } else { 0 }; let fetch_count = if index > 0 { 3u32 } else { 2u32 }; + // Same pattern as list_notebook_entries - avoid double FINAL by using + // argMax aggregation for dedup instead let query = r#" + WITH entry_refs AS ( + SELECT + entry_did, + entry_rkey, + argMax(position, indexed_at) AS position + FROM notebook_entries + WHERE notebook_did = ? + AND notebook_rkey = ? + GROUP BY entry_did, entry_rkey + ORDER BY position ASC + LIMIT ? OFFSET ? + ) SELECT e.did AS did, e.rkey AS rkey, - e.cid AS cid, - e.uri AS uri, - e.title AS title, - e.path AS path, - e.tags AS tags, - e.author_dids AS author_dids, - e.created_at AS created_at, - e.updated_at AS updated_at, - e.indexed_at AS indexed_at, - e.record AS record - FROM notebook_entries ne FINAL - INNER JOIN entries e FINAL ON - e.did = ne.entry_did - AND e.rkey = ne.entry_rkey - AND e.deleted_at = toDateTime64(0, 3) - WHERE ne.notebook_did = ? - AND ne.notebook_rkey = ? - ORDER BY ne.position ASC - LIMIT ? OFFSET ? + argMax(e.cid, e.indexed_at) AS cid, + argMax(e.uri, e.indexed_at) AS uri, + argMax(e.title, e.indexed_at) AS title, + argMax(e.path, e.indexed_at) AS path, + argMax(e.tags, e.indexed_at) AS tags, + argMax(e.author_dids, e.indexed_at) AS author_dids, + argMax(e.created_at, e.indexed_at) AS created_at, + argMax(e.updated_at, e.indexed_at) AS updated_at, + max(e.indexed_at) AS indexed_at, + argMax(e.record, e.indexed_at) AS record + FROM entries e + INNER JOIN entry_refs er ON e.did = er.entry_did AND e.rkey = er.entry_rkey + WHERE e.deleted_at = toDateTime64(0, 3) + GROUP BY e.did, e.rkey + ORDER BY any(er.position) ASC "#; let rows: Vec = self diff --git a/crates/weaver-index/src/clickhouse/queries/publications.rs b/crates/weaver-index/src/clickhouse/queries/publications.rs new file mode 100644 index 0000000..8c62607 --- /dev/null +++ b/crates/weaver-index/src/clickhouse/queries/publications.rs @@ -0,0 +1,223 @@ +//! Publication and document queries for site.standard.* types + +use clickhouse::Row; +use serde::Deserialize; +use smol_str::SmolStr; + +use crate::clickhouse::Client; +use crate::error::{ClickHouseError, IndexError}; + +/// Publication row from the publications table. +#[derive(Debug, Clone, Row, Deserialize)] +pub struct PublicationRow { + pub did: SmolStr, + pub rkey: SmolStr, + pub cid: SmolStr, + pub name: SmolStr, + pub description: SmolStr, + pub url: SmolStr, + pub domain: SmolStr, + pub notebook_uri: SmolStr, + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] + pub event_time: chrono::DateTime, + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] + pub indexed_at: chrono::DateTime, + pub record: SmolStr, +} + +/// Custom domain lookup row from custom_domains table. +#[derive(Debug, Clone, Row, Deserialize)] +pub struct CustomDomainRow { + pub domain: SmolStr, + pub publication_did: SmolStr, + pub publication_rkey: SmolStr, + pub publication_name: SmolStr, + pub publication_url: SmolStr, + pub cname_target: SmolStr, + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] + pub created_at: chrono::DateTime, +} + +/// Document row from the documents table. +#[derive(Debug, Clone, Row, Deserialize)] +pub struct DocumentRow { + pub did: SmolStr, + pub rkey: SmolStr, + pub cid: SmolStr, + pub publication_did: SmolStr, + pub publication_rkey: SmolStr, + pub title: SmolStr, + pub description: SmolStr, + pub path: SmolStr, + pub entry_uri: SmolStr, + pub entry_index: i64, + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] + pub published_at: chrono::DateTime, + #[serde(with = "clickhouse::serde::chrono::datetime64::millis")] + pub indexed_at: chrono::DateTime, + pub record: SmolStr, +} + +impl Client { + /// Lookup publication by domain (for custom domain routing). + pub async fn get_publication_by_domain( + &self, + domain: &str, + ) -> Result, IndexError> { + let query = r#" + SELECT domain, publication_did, publication_rkey, publication_name, + publication_url, cname_target, created_at + FROM custom_domains FINAL + WHERE domain = ? AND deleted_at = toDateTime64(0, 3) + LIMIT 1 + "#; + self.inner() + .query(query) + .bind(domain) + .fetch_optional::() + .await + .map_err(|e| ClickHouseError::Query { + message: "failed to get publication by domain".into(), + source: e, + }) + .map_err(IndexError::from) + } + + /// Get publication by DID and rkey. + pub async fn get_publication( + &self, + did: &str, + rkey: &str, + ) -> Result, IndexError> { + let query = r#" + SELECT did, rkey, cid, name, description, url, domain, notebook_uri, + event_time, indexed_at, record + FROM publications FINAL + WHERE did = ? AND rkey = ? AND deleted_at = toDateTime64(0, 3) + LIMIT 1 + "#; + self.inner() + .query(query) + .bind(did) + .bind(rkey) + .fetch_optional::() + .await + .map_err(|e| ClickHouseError::Query { + message: "failed to get publication".into(), + source: e, + }) + .map_err(IndexError::from) + } + + /// Resolve document by path within a publication. + pub async fn resolve_document_by_path( + &self, + publication_did: &str, + publication_rkey: &str, + path: &str, + ) -> Result, IndexError> { + let normalized = path.to_lowercase().trim_end_matches('/').to_string(); + let query = r#" + SELECT did, rkey, cid, publication_did, publication_rkey, + title, description, path, entry_uri, entry_index, + published_at, indexed_at, record + FROM documents FINAL + WHERE publication_did = ? AND publication_rkey = ? + AND path_normalized = ? AND deleted_at = toDateTime64(0, 3) + ORDER BY indexed_at DESC + LIMIT 1 + "#; + self.inner() + .query(query) + .bind(publication_did) + .bind(publication_rkey) + .bind(&normalized) + .fetch_optional::() + .await + .map_err(|e| ClickHouseError::Query { + message: "failed to resolve document by path".into(), + source: e, + }) + .map_err(IndexError::from) + } + + /// List documents in a publication. + pub async fn list_publication_documents( + &self, + publication_did: &str, + publication_rkey: &str, + limit: u32, + cursor: Option, + ) -> Result, IndexError> { + let query = if cursor.is_some() { + r#" + SELECT did, rkey, cid, publication_did, publication_rkey, + title, description, path, entry_uri, entry_index, + published_at, indexed_at, record + FROM documents FINAL + WHERE publication_did = ? AND publication_rkey = ? + AND deleted_at = toDateTime64(0, 3) + AND toUnixTimestamp64Milli(published_at) < ? + ORDER BY published_at DESC + LIMIT ? + "# + } else { + r#" + SELECT did, rkey, cid, publication_did, publication_rkey, + title, description, path, entry_uri, entry_index, + published_at, indexed_at, record + FROM documents FINAL + WHERE publication_did = ? AND publication_rkey = ? + AND deleted_at = toDateTime64(0, 3) + ORDER BY published_at DESC + LIMIT ? + "# + }; + + let mut q = self + .inner() + .query(query) + .bind(publication_did) + .bind(publication_rkey); + + if let Some(c) = cursor { + q = q.bind(c); + } + + q.bind(limit) + .fetch_all::() + .await + .map_err(|e| ClickHouseError::Query { + message: "failed to list publication documents".into(), + source: e, + }) + .map_err(IndexError::from) + } + + /// Get document by DID and rkey. + pub async fn get_document( + &self, + did: &str, + rkey: &str, + ) -> Result, IndexError> { + let query = r#" + SELECT did, rkey, cid, publication_did, publication_rkey, + title, description, path, entry_uri, entry_index, + published_at, indexed_at, record + FROM documents FINAL + WHERE did = ? AND rkey = ? AND deleted_at = toDateTime64(0, 3) + LIMIT 1 + "#; + self.inner() + .query(query) + .bind(did) + .bind(rkey) + .fetch_optional::() + .await + .map_err(|e| ClickHouseError::Query { + message: "failed to get document".into(), + source: e, + }) + .map_err(IndexError::from) + } +} diff --git a/crates/weaver-index/src/endpoints/domain.rs b/crates/weaver-index/src/endpoints/domain.rs new file mode 100644 index 0000000..abc8665 --- /dev/null +++ b/crates/weaver-index/src/endpoints/domain.rs @@ -0,0 +1,255 @@ +//! sh.weaver.domain.* endpoint handlers + +use axum::{Json, extract::State}; +use jacquard::IntoStatic; +use serde::{Deserialize, Serialize}; +use jacquard::cowstr::ToCowStr; +use jacquard::types::string::{AtUri, Cid, Did}; +use jacquard_axum::ExtractXrpc; +use weaver_api::sh_weaver::domain::{ + DocumentView, PublicationView, + resolve_by_domain::{ResolveByDomainOutput, ResolveByDomainRequest}, + resolve_document::{ResolveDocumentOutput, ResolveDocumentRequest}, +}; + +use crate::clickhouse::{DocumentRow, PublicationRow}; +use crate::endpoints::notebook::parse_record_json; +use crate::endpoints::repo::XrpcErrorResponse; +use crate::server::AppState; + +/// Handle sh.weaver.domain.resolveByDomain +/// +/// Resolves a publication by its custom domain. +pub async fn resolve_by_domain( + State(state): State, + ExtractXrpc(args): ExtractXrpc, +) -> Result>, XrpcErrorResponse> { + let domain = args.domain.as_ref(); + + let custom_domain = state + .clickhouse + .get_publication_by_domain(domain) + .await + .map_err(|e| { + tracing::error!("Failed to lookup domain: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })? + .ok_or_else(|| XrpcErrorResponse::not_found("Domain not found"))?; + + // Fetch full publication record + let pub_row = state + .clickhouse + .get_publication( + &custom_domain.publication_did, + &custom_domain.publication_rkey, + ) + .await + .map_err(|e| { + tracing::error!("Failed to get publication: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })? + .ok_or_else(|| XrpcErrorResponse::not_found("Publication not found"))?; + + let publication = build_publication_view(&pub_row)?; + + Ok(Json( + ResolveByDomainOutput { + publication, + extra_data: None, + } + .into_static(), + )) +} + +/// Handle sh.weaver.domain.resolveDocument +/// +/// Resolves a document by path within a publication. +pub async fn resolve_document( + State(state): State, + ExtractXrpc(args): ExtractXrpc, +) -> Result>, XrpcErrorResponse> { + // Parse publication URI + let pub_uri = &args.publication; + let pub_authority = pub_uri.authority(); + let pub_rkey = pub_uri + .rkey() + .ok_or_else(|| XrpcErrorResponse::invalid_request("Publication URI must include rkey"))?; + + // Resolve authority to DID + let pub_did = crate::endpoints::actor::resolve_actor(&state, pub_authority).await?; + let pub_did_str = pub_did.as_str(); + let pub_rkey_str = pub_rkey.as_ref(); + + // Verify publication exists + let _pub_row = state + .clickhouse + .get_publication(pub_did_str, pub_rkey_str) + .await + .map_err(|e| { + tracing::error!("Failed to get publication: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })? + .ok_or_else(|| XrpcErrorResponse::not_found("Publication not found"))?; + + // Resolve document by path + let path = args.path.as_ref(); + let doc_row = state + .clickhouse + .resolve_document_by_path(pub_did_str, pub_rkey_str, path) + .await + .map_err(|e| { + tracing::error!("Failed to resolve document: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })? + .ok_or_else(|| XrpcErrorResponse::not_found("Document not found"))?; + + let document = build_document_view(&doc_row)?; + + Ok(Json( + ResolveDocumentOutput { + document, + extra_data: None, + } + .into_static(), + )) +} + +/// Build a PublicationView from a PublicationRow. +fn build_publication_view( + row: &PublicationRow, +) -> Result, XrpcErrorResponse> { + let uri_str = format!("at://{}/site.standard.publication/{}", row.did, row.rkey); + let uri = AtUri::new(&uri_str).map_err(|e| { + tracing::error!("Invalid publication URI: {}", e); + XrpcErrorResponse::internal_error("Invalid URI") + })?; + + let cid = Cid::new(row.cid.as_bytes()).map_err(|e| { + tracing::error!("Invalid publication CID: {}", e); + XrpcErrorResponse::internal_error("Invalid CID") + })?; + + let did = Did::new(&row.did).map_err(|e| { + tracing::error!("Invalid publication DID: {}", e); + XrpcErrorResponse::internal_error("Invalid DID") + })?; + + let record = parse_record_json(&row.record)?; + + let notebook_uri = if row.notebook_uri.is_empty() { + None + } else { + AtUri::new(&row.notebook_uri).ok() + }; + + Ok(PublicationView::new() + .uri(uri.into_static()) + .cid(cid.into_static()) + .did(did.into_static()) + .rkey(row.rkey.to_cowstr().into_static()) + .name(row.name.to_cowstr().into_static()) + .domain(row.domain.to_cowstr().into_static()) + .record(record) + .indexed_at(row.indexed_at.fixed_offset()) + .maybe_notebook_uri(notebook_uri.map(|u| u.into_static())) + .build()) +} + +/// Build a DocumentView from a DocumentRow. +fn build_document_view(row: &DocumentRow) -> Result, XrpcErrorResponse> { + let uri_str = format!("at://{}/site.standard.document/{}", row.did, row.rkey); + let uri = AtUri::new(&uri_str).map_err(|e| { + tracing::error!("Invalid document URI: {}", e); + XrpcErrorResponse::internal_error("Invalid URI") + })?; + + let cid = Cid::new(row.cid.as_bytes()).map_err(|e| { + tracing::error!("Invalid document CID: {}", e); + XrpcErrorResponse::internal_error("Invalid CID") + })?; + + let did = Did::new(&row.did).map_err(|e| { + tracing::error!("Invalid document DID: {}", e); + XrpcErrorResponse::internal_error("Invalid DID") + })?; + + let record = parse_record_json(&row.record)?; + + let entry_uri = if row.entry_uri.is_empty() { + None + } else { + AtUri::new(&row.entry_uri).ok() + }; + + let entry_index = if row.entry_index >= 0 { + Some(row.entry_index) + } else { + None + }; + + Ok(DocumentView::new() + .uri(uri.into_static()) + .cid(cid.into_static()) + .did(did.into_static()) + .rkey(row.rkey.to_cowstr().into_static()) + .title(row.title.to_cowstr().into_static()) + .path(row.path.to_cowstr().into_static()) + .record(record) + .indexed_at(row.indexed_at.fixed_offset()) + .maybe_entry_uri(entry_uri.map(|u| u.into_static())) + .maybe_entry_index(entry_index) + .build()) +} + +// === Internal Caddy Verification Endpoint === + +#[derive(Debug, Deserialize)] +pub struct VerifyDomainQuery { + pub domain: String, +} + +#[derive(Debug, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct VerifyDomainResponse { + pub valid: bool, + pub publication_uri: Option, +} + +/// Internal endpoint for Caddy on-demand TLS verification. +pub async fn verify_domain( + State(state): State, + axum::extract::Query(params): axum::extract::Query, +) -> Result, XrpcErrorResponse> { + let domain = ¶ms.domain; + tracing::info!(%domain, "Verifying custom domain for TLS"); + + let row = state + .clickhouse + .get_publication_by_domain(domain) + .await + .map_err(|e| { + tracing::error!(%domain, error = %e, "Database error"); + XrpcErrorResponse::internal_error("Database query failed") + })?; + + match row { + Some(r) => { + let uri = format!( + "at://{}/site.standard.publication/{}", + r.publication_did, r.publication_rkey + ); + tracing::info!(%domain, %uri, "Domain verified"); + Ok(Json(VerifyDomainResponse { + valid: true, + publication_uri: Some(uri), + })) + } + None => { + tracing::info!(%domain, "Domain not found"); + Ok(Json(VerifyDomainResponse { + valid: false, + publication_uri: None, + })) + } + } +} diff --git a/crates/weaver-index/src/endpoints/mod.rs b/crates/weaver-index/src/endpoints/mod.rs index 44f0dba..55fa7c0 100644 --- a/crates/weaver-index/src/endpoints/mod.rs +++ b/crates/weaver-index/src/endpoints/mod.rs @@ -14,6 +14,7 @@ use self::repo::XrpcErrorResponse; pub mod actor; pub mod bsky; pub mod collab; +pub mod domain; pub mod edit; pub mod identity; pub mod notebook; diff --git a/crates/weaver-index/src/endpoints/notebook.rs b/crates/weaver-index/src/endpoints/notebook.rs index 23f01ac..a88b7d6 100644 --- a/crates/weaver-index/src/endpoints/notebook.rs +++ b/crates/weaver-index/src/endpoints/notebook.rs @@ -192,8 +192,11 @@ pub async fn resolve_notebook( // Build BookEntryViews with prev/next navigation let mut entries: Vec> = Vec::with_capacity(entry_views.len()); for (idx, entry_view) in entry_views.iter().enumerate() { - let prev = (idx > 0) - .then(|| BookEntryRef::new().entry(entry_views[idx - 1].clone()).build()); + let prev = (idx > 0).then(|| { + BookEntryRef::new() + .entry(entry_views[idx - 1].clone()) + .build() + }); let next = entry_views .get(idx + 1) .map(|e| BookEntryRef::new().entry(e.clone()).build()); @@ -362,34 +365,31 @@ pub async fn get_entry( let did_str = did.as_str(); // Fetch entry and contributors in parallel - let (entry_result, contributors_result) = tokio::try_join!( - async { - state - .clickhouse - .get_entry_exact(did_str, rkey_str) - .await - .map_err(|e| { - tracing::error!("Failed to get entry: {}", e); - XrpcErrorResponse::internal_error("Database query failed") - }) - }, - async { - state - .clickhouse - .get_entry_contributors(did_str, rkey_str) - .await - .map_err(|e| { - tracing::error!("Failed to get contributors: {}", e); - XrpcErrorResponse::internal_error("Database query failed") - }) - } - )?; - - let entry_row = entry_result.ok_or_else(|| XrpcErrorResponse::not_found("Entry not found"))?; - + let contributors_result = state + .clickhouse + .get_entry_contributors(did_str, rkey_str) + .await + .map_err(|e| { + tracing::error!("Failed to get contributors: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; // Merge contributors with author_dids from record (dedupe) let mut all_author_dids: HashSet<&str> = contributors_result.iter().map(|s| s.as_str()).collect(); + + let entry_result = state + .clickhouse + .get_entry( + rkey_str, + &all_author_dids.iter().cloned().collect::>(), + ) + .await + .map_err(|e| { + tracing::error!("Failed to get entry: {}", e); + XrpcErrorResponse::internal_error("Database query failed") + })?; + let entry_row = entry_result.ok_or_else(|| XrpcErrorResponse::not_found("Entry not found"))?; + for did in &entry_row.author_dids { all_author_dids.insert(did.as_str()); } @@ -532,7 +532,7 @@ pub async fn resolve_entry( } /// Build an EntryView from an EntryRow with explicit author list (evidence-based contributors) -fn build_entry_view_with_authors( +pub fn build_entry_view_with_authors( entry_row: &crate::clickhouse::EntryRow, author_dids: &[SmolStr], profile_map: &HashMap<&str, &ProfileRow>, @@ -564,7 +564,7 @@ fn build_entry_view_with_authors( } /// Convert SmolStr to Option if non-empty -fn non_empty_cowstr(s: &smol_str::SmolStr) -> Option> { +pub fn non_empty_cowstr(s: &smol_str::SmolStr) -> Option> { if s.is_empty() { None } else { @@ -573,7 +573,7 @@ fn non_empty_cowstr(s: &smol_str::SmolStr) -> Option> } /// Parse record JSON string into owned Data -fn parse_record_json(json: &str) -> Result, XrpcErrorResponse> { +pub fn parse_record_json(json: &str) -> Result, XrpcErrorResponse> { let data: Data<'_> = serde_json::from_str(json).map_err(|e| { tracing::error!("Failed to parse record JSON: {}", e); XrpcErrorResponse::internal_error("Invalid record JSON stored") @@ -582,7 +582,7 @@ fn parse_record_json(json: &str) -> Result, XrpcErrorResponse> { } /// Hydrate author list from DIDs using profile map -fn hydrate_authors( +pub fn hydrate_authors( author_dids: &[SmolStr], profile_map: &HashMap<&str, &ProfileRow>, ) -> Result>, XrpcErrorResponse> { @@ -623,7 +623,7 @@ fn hydrate_authors( } /// Convert ProfileRow to ProfileDataView -fn profile_to_data_view( +pub fn profile_to_data_view( profile: &ProfileRow, ) -> Result, XrpcErrorResponse> { let did = Did::new(&profile.did).map_err(|e| { @@ -680,7 +680,7 @@ fn profile_to_data_view( } /// Parse cursor string to i64 timestamp millis -fn parse_cursor(cursor: Option<&str>) -> Result, XrpcErrorResponse> { +pub fn parse_cursor(cursor: Option<&str>) -> Result, XrpcErrorResponse> { cursor .map(|c| { c.parse::() @@ -1011,7 +1011,7 @@ pub async fn get_book_entry( } /// Build an EntryView from an EntryRow -fn build_entry_view( +pub fn build_entry_view( entry_row: &EntryRow, profile_map: &HashMap<&str, &ProfileRow>, ) -> Result, XrpcErrorResponse> { diff --git a/crates/weaver-index/src/landing.html b/crates/weaver-index/src/landing.html index 4c59a48..25a8a24 100644 --- a/crates/weaver-index/src/landing.html +++ b/crates/weaver-index/src/landing.html @@ -116,7 +116,7 @@ Y8. `""' .8P `""' This is an AT Protocol record index serving the Weaver writing platform.

Most API endpoints are available under /xrpc/.

    -
  • Web App (alpha): alpha.weaver.sh
  • +
  • Web App: weaver.sh
  • Source Code: tangled.org/@nonbinary.computer/weaver diff --git a/crates/weaver-index/src/server.rs b/crates/weaver-index/src/server.rs index 12c3753..00dc9ff 100644 --- a/crates/weaver-index/src/server.rs +++ b/crates/weaver-index/src/server.rs @@ -35,6 +35,9 @@ use weaver_api::sh_weaver::collab::get_resource_sessions::GetResourceSessionsReq 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::domain::{ + resolve_by_domain::ResolveByDomainRequest, resolve_document::ResolveDocumentRequest, +}; use weaver_api::sh_weaver::notebook::{ get_book_entry::GetBookEntryRequest, get_entry::GetEntryRequest, get_entry_feed::GetEntryFeedRequest, get_entry_notebooks::GetEntryNotebooksRequest, @@ -45,7 +48,7 @@ use weaver_api::sh_weaver::notebook::{ use crate::clickhouse::Client; use crate::config::ShardConfig; -use crate::endpoints::{actor, bsky, collab, edit, identity, notebook, repo}; +use crate::endpoints::{actor, bsky, collab, domain, edit, identity, notebook, repo}; use crate::error::{IndexError, ServerError}; use crate::sqlite::ShardRouter; @@ -140,6 +143,15 @@ pub fn router(state: AppState, did_doc: DidDocument<'static>) -> Router { .merge(ResolveGlobalNotebookRequest::into_router( notebook::resolve_global_notebook, )) + // Internal endpoint for Caddy on-demand TLS verification + .route("/internal/verify-domain", get(domain::verify_domain)) + // sh.weaver.domain.* endpoints + .merge(ResolveByDomainRequest::into_router( + domain::resolve_by_domain, + )) + .merge(ResolveDocumentRequest::into_router( + domain::resolve_document, + )) // sh.weaver.collab.* endpoints .merge(GetResourceParticipantsRequest::into_router( collab::get_resource_participants, diff --git a/crates/weaver-renderer/Cargo.toml b/crates/weaver-renderer/Cargo.toml index 637a834..156ddf9 100644 --- a/crates/weaver-renderer/Cargo.toml +++ b/crates/weaver-renderer/Cargo.toml @@ -6,7 +6,7 @@ license.workspace = true publish = false [features] -default = ["syntax-highlighting", "syntax-css"] +default = ["syntax-highlighting", "syntax-css", "pckt"] pckt = [] # Basic syntax highlighting (code_pretty.rs) - works in WASM syntax-highlighting = ["dep:syntect"] diff --git a/crates/weaver-renderer/src/atproto/embed_renderer.rs b/crates/weaver-renderer/src/atproto/embed_renderer.rs index 20ed27b..88f9f88 100644 --- a/crates/weaver-renderer/src/atproto/embed_renderer.rs +++ b/crates/weaver-renderer/src/atproto/embed_renderer.rs @@ -468,18 +468,27 @@ where // Fetch publication to get base URL for external link use weaver_api::site_standard::publication::Publication; - let publication_url: Option = agent - .fetch_record_slingshot(&doc.publication) - .await - .ok() - .and_then(|rec| { - jacquard::from_data::(&rec.value) - .ok() - .map(|pub_rec| pub_rec.url.as_ref().to_string()) - }); + let Uri::At(uri) = &doc.site else { + return Err(AtProtoPreprocessError::FetchFailed( + "Invalid site URI".to_string(), + )); + }; + let publication_url: Option = + agent + .fetch_record_slingshot(uri) + .await + .ok() + .and_then(|rec| { + jacquard::from_data::(&rec.value) + .ok() + .map(|pub_rec| pub_rec.url.as_ref().to_string()) + }); // Get author DID and handle from URI authority - use jacquard::types::string::{Did, Handle}; + use jacquard::types::{ + string::{Did, Handle}, + uri::Uri, + }; let (author_did, author_handle): (Did<'static>, Option>) = match uri.authority() { jacquard::types::ident::AtIdentifier::Did(d) => { @@ -557,7 +566,7 @@ where // Render content blocks if present if let Some(content) = &doc.content { - html.push_str(&render_content_blocks(content, &ctx, agent).await); + html.push_str(&render_content_blocks(vec![content.clone()].as_slice(), &ctx, agent).await); } else if let Some(text_content) = &doc.text_content { // Fallback to text_content if no structured content html.push_str("

    "); @@ -1270,11 +1279,13 @@ fn render_site_standard_record( .map(|d| d.into_static()) }); - let ctx = author_did.map(PcktRenderContext::new).unwrap_or_else(|| { - PcktRenderContext::new(jacquard::types::string::Did::unchecked( - "did:plc:unknown".into(), - )) - }); + let ctx = author_did + .map(PcktRenderContext::new) + .unwrap_or_else(|| unsafe { + PcktRenderContext::new(jacquard::types::string::Did::unchecked( + "did:plc:unknown".into(), + )) + }); let rkey = uri.rkey().map(|r| r.as_ref()).unwrap_or("unknown"); let toggle_id = format!("pckt-toggle-{}", rkey); @@ -1309,7 +1320,11 @@ fn render_site_standard_record( html.push_str("

    "); if let Some(content) = &doc.content { // Render actual content blocks using the sync renderer. - html.push_str(&render_content_blocks_sync(content, &ctx, resolved_content)); + html.push_str(&render_content_blocks_sync( + vec![content.clone()].as_slice(), + &ctx, + resolved_content, + )); } else if let Some(text_content) = &doc.text_content { // Fallback to text_content if no structured blocks. html.push_str("

    "); diff --git a/crates/weaver-renderer/src/pckt/block_renderer.rs b/crates/weaver-renderer/src/pckt/block_renderer.rs index 005df52..f3b606f 100644 --- a/crates/weaver-renderer/src/pckt/block_renderer.rs +++ b/crates/weaver-renderer/src/pckt/block_renderer.rs @@ -8,6 +8,8 @@ use weaver_api::blog_pckt::block::{ image::Image, list_item::ListItemContentItem, ordered_list::OrderedList, text::Text, website::Website, }; +use weaver_api::blog_pckt::content::Content as PcktContent; +use weaver_api::sh_weaver::notebook::{BookEntryView, entry::Entry}; use crate::facet::{NormalizedFacet, render_faceted_html}; @@ -445,7 +447,9 @@ fn render_bluesky_embed_sync( if let Some(rest) = uri_str.strip_prefix("at://") { if let Some((did, path)) = rest.split_once('/') { if let Some(rkey) = path.strip_prefix("app.bsky.feed.post/") { - html.push_str("