From f4529f019e9f4dce08137d88bf99c8acbc3da6a9 Mon Sep 17 00:00:00 2001 From: Orual Date: Sat, 27 Dec 2025 12:39:04 -0500 Subject: [PATCH] api codegen updates --- .../lexicons/blog_pckt_richtext_facet.json | 133 ++ .../lexicons/com_5jiji_test_listVideos.json | 18 + .../lexicons/com_yuna0x0_guestbook_sign.json | 33 + .../fyi_questionable_actor_profile.json | 25 + ...ames_firehose_barklesheep_placeSheeps.json | 62 + .../games_firehose_barklesheep_reaction.json | 32 + .../lexicons/io_atcr_hold_captain.json | 53 + .../lexicons/io_atcr_hold_crew.json | 49 + .../lexicons/io_atcr_hold_layer.json | 56 + .../lexicons/io_atcr_manifest.json | 195 ++ .../lexicons/io_atcr_sailor_profile.json | 34 + .../lexicons/io_atcr_sailor_star.json | 50 + crates/jacquard-api/lexicons/io_atcr_tag.json | 45 + .../lexicons/io_whiteside_linkedAccount.json | 33 + .../lexicons/io_whiteside_profile.json | 36 + crates/jacquard-api/src/blog_pckt/richtext.rs | 6 + .../src/blog_pckt/richtext/facet.rs | 1280 ++++++++++++ .../src/com__5jiji/test/list_videos.rs | 46 + crates/jacquard-api/src/com_yuna0x0.rs | 6 + .../jacquard-api/src/com_yuna0x0/guestbook.rs | 6 + .../src/com_yuna0x0/guestbook/sign.rs | 369 ++++ .../src/fyi_questionable/actor.rs | 6 + .../src/fyi_questionable/actor/profile.rs | 300 +++ crates/jacquard-api/src/games_firehose.rs | 6 + .../src/games_firehose/barklesheep.rs | 7 + .../barklesheep/place_sheeps.rs | 545 ++++++ .../games_firehose/barklesheep/reaction.rs | 370 ++++ crates/jacquard-api/src/io_atcr.rs | 9 + crates/jacquard-api/src/io_atcr/hold.rs | 8 + .../jacquard-api/src/io_atcr/hold/captain.rs | 549 ++++++ crates/jacquard-api/src/io_atcr/hold/crew.rs | 442 +++++ crates/jacquard-api/src/io_atcr/hold/layer.rs | 631 ++++++ crates/jacquard-api/src/io_atcr/manifest.rs | 1724 +++++++++++++++++ crates/jacquard-api/src/io_atcr/sailor.rs | 7 + .../src/io_atcr/sailor/profile.rs | 352 ++++ .../jacquard-api/src/io_atcr/sailor/star.rs | 544 ++++++ crates/jacquard-api/src/io_atcr/tag.rs | 490 +++++ crates/jacquard-api/src/io_whiteside.rs | 7 + .../src/io_whiteside/linked_account.rs | 372 ++++ .../jacquard-api/src/io_whiteside/profile.rs | 395 ++++ 40 files changed, 9331 insertions(+) create mode 100644 crates/jacquard-api/lexicons/blog_pckt_richtext_facet.json create mode 100644 crates/jacquard-api/lexicons/com_5jiji_test_listVideos.json create mode 100644 crates/jacquard-api/lexicons/com_yuna0x0_guestbook_sign.json create mode 100644 crates/jacquard-api/lexicons/fyi_questionable_actor_profile.json create mode 100644 crates/jacquard-api/lexicons/games_firehose_barklesheep_placeSheeps.json create mode 100644 crates/jacquard-api/lexicons/games_firehose_barklesheep_reaction.json create mode 100644 crates/jacquard-api/lexicons/io_atcr_hold_captain.json create mode 100644 crates/jacquard-api/lexicons/io_atcr_hold_crew.json create mode 100644 crates/jacquard-api/lexicons/io_atcr_hold_layer.json create mode 100644 crates/jacquard-api/lexicons/io_atcr_manifest.json create mode 100644 crates/jacquard-api/lexicons/io_atcr_sailor_profile.json create mode 100644 crates/jacquard-api/lexicons/io_atcr_sailor_star.json create mode 100644 crates/jacquard-api/lexicons/io_atcr_tag.json create mode 100644 crates/jacquard-api/lexicons/io_whiteside_linkedAccount.json create mode 100644 crates/jacquard-api/lexicons/io_whiteside_profile.json create mode 100644 crates/jacquard-api/src/blog_pckt/richtext.rs create mode 100644 crates/jacquard-api/src/blog_pckt/richtext/facet.rs create mode 100644 crates/jacquard-api/src/com__5jiji/test/list_videos.rs create mode 100644 crates/jacquard-api/src/com_yuna0x0.rs create mode 100644 crates/jacquard-api/src/com_yuna0x0/guestbook.rs create mode 100644 crates/jacquard-api/src/com_yuna0x0/guestbook/sign.rs create mode 100644 crates/jacquard-api/src/fyi_questionable/actor.rs create mode 100644 crates/jacquard-api/src/fyi_questionable/actor/profile.rs create mode 100644 crates/jacquard-api/src/games_firehose.rs create mode 100644 crates/jacquard-api/src/games_firehose/barklesheep.rs create mode 100644 crates/jacquard-api/src/games_firehose/barklesheep/place_sheeps.rs create mode 100644 crates/jacquard-api/src/games_firehose/barklesheep/reaction.rs create mode 100644 crates/jacquard-api/src/io_atcr.rs create mode 100644 crates/jacquard-api/src/io_atcr/hold.rs create mode 100644 crates/jacquard-api/src/io_atcr/hold/captain.rs create mode 100644 crates/jacquard-api/src/io_atcr/hold/crew.rs create mode 100644 crates/jacquard-api/src/io_atcr/hold/layer.rs create mode 100644 crates/jacquard-api/src/io_atcr/manifest.rs create mode 100644 crates/jacquard-api/src/io_atcr/sailor.rs create mode 100644 crates/jacquard-api/src/io_atcr/sailor/profile.rs create mode 100644 crates/jacquard-api/src/io_atcr/sailor/star.rs create mode 100644 crates/jacquard-api/src/io_atcr/tag.rs create mode 100644 crates/jacquard-api/src/io_whiteside.rs create mode 100644 crates/jacquard-api/src/io_whiteside/linked_account.rs create mode 100644 crates/jacquard-api/src/io_whiteside/profile.rs diff --git a/crates/jacquard-api/lexicons/blog_pckt_richtext_facet.json b/crates/jacquard-api/lexicons/blog_pckt_richtext_facet.json new file mode 100644 index 00000000..730a8dcf --- /dev/null +++ b/crates/jacquard-api/lexicons/blog_pckt_richtext_facet.json @@ -0,0 +1,133 @@ +{ + "lexicon": 1, + "id": "blog.pckt.richtext.facet", + "description": "Annotation of a sub-string within rich text.", + "defs": { + "atMention": { + "type": "object", + "description": "Facet feature for mentioning an AT URI", + "required": [ + "atURI" + ], + "properties": { + "atURI": { + "type": "string", + "format": "uri" + } + } + }, + "bold": { + "type": "object", + "description": "Facet feature for bold text", + "properties": {} + }, + "byteSlice": { + "type": "object", + "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text.", + "required": [ + "byteStart", + "byteEnd" + ], + "properties": { + "byteEnd": { + "type": "integer", + "minimum": 0 + }, + "byteStart": { + "type": "integer", + "minimum": 0 + } + } + }, + "code": { + "type": "object", + "description": "Facet feature for inline code", + "properties": {} + }, + "didMention": { + "type": "object", + "description": "Facet feature for mentioning a DID", + "required": [ + "did" + ], + "properties": { + "did": { + "type": "string", + "format": "did" + } + } + }, + "highlight": { + "type": "object", + "description": "Facet feature for highlighted text", + "properties": {} + }, + "id": { + "type": "object", + "description": "Facet feature for an identifier. Used for linking to a segment", + "properties": { + "id": { + "type": "string" + } + } + }, + "italic": { + "type": "object", + "description": "Facet feature for italic text", + "properties": {} + }, + "link": { + "type": "object", + "description": "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.", + "required": [ + "uri" + ], + "properties": { + "uri": { + "type": "string" + } + } + }, + "main": { + "type": "object", + "required": [ + "index", + "features" + ], + "properties": { + "features": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "#link", + "#didMention", + "#atMention", + "#code", + "#highlight", + "#underline", + "#strikethrough", + "#id", + "#bold", + "#italic" + ] + } + }, + "index": { + "type": "ref", + "ref": "#byteSlice" + } + } + }, + "strikethrough": { + "type": "object", + "description": "Facet feature for strikethrough markup", + "properties": {} + }, + "underline": { + "type": "object", + "description": "Facet feature for underline markup", + "properties": {} + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/com_5jiji_test_listVideos.json b/crates/jacquard-api/lexicons/com_5jiji_test_listVideos.json new file mode 100644 index 00000000..fdc5c367 --- /dev/null +++ b/crates/jacquard-api/lexicons/com_5jiji_test_listVideos.json @@ -0,0 +1,18 @@ +{ + "lexicon": 1, + "id": "com.5jiji.test.listVideos", + "defs": { + "main": { + "type": "query", + "description": "Lists videos from given creator", + "parameters": { + "type": "params", + "properties": {} + }, + "output": { + "description": "The list of videos", + "encoding": "application/json" + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/com_yuna0x0_guestbook_sign.json b/crates/jacquard-api/lexicons/com_yuna0x0_guestbook_sign.json new file mode 100644 index 00000000..a96bb1f3 --- /dev/null +++ b/crates/jacquard-api/lexicons/com_yuna0x0_guestbook_sign.json @@ -0,0 +1,33 @@ +{ + "lexicon": 1, + "id": "com.yuna0x0.guestbook.sign", + "defs": { + "main": { + "type": "record", + "description": "a sign in the guestbook", + "key": "tid", + "record": { + "type": "object", + "required": [ + "subject", + "createdAt", + "message" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "message": { + "type": "string", + "maxLength": 100 + }, + "subject": { + "type": "string", + "format": "at-identifier" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/fyi_questionable_actor_profile.json b/crates/jacquard-api/lexicons/fyi_questionable_actor_profile.json new file mode 100644 index 00000000..d14dab2f --- /dev/null +++ b/crates/jacquard-api/lexicons/fyi_questionable_actor_profile.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "fyi.questionable.actor.profile", + "defs": { + "main": { + "type": "record", + "description": "A declaration of a Questionable account profile.", + "key": "literal:self", + "record": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "displayName": { + "type": "string", + "maxLength": 640, + "maxGraphemes": 64 + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/games_firehose_barklesheep_placeSheeps.json b/crates/jacquard-api/lexicons/games_firehose_barklesheep_placeSheeps.json new file mode 100644 index 00000000..62f037f8 --- /dev/null +++ b/crates/jacquard-api/lexicons/games_firehose_barklesheep_placeSheeps.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "games.firehose.barklesheep.placeSheeps", + "defs": { + "main": { + "type": "procedure", + "description": "Place sheeps on the barkleboard", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "gameId", + "sheeps" + ], + "properties": { + "gameId": { + "type": "string" + }, + "sheeps": { + "type": "array", + "items": { + "type": "ref", + "ref": "#sheepPlacement" + } + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean" + } + } + } + } + }, + "sheepPlacement": { + "type": "object", + "required": [ + "type", + "start", + "horizontal" + ], + "properties": { + "horizontal": { + "type": "boolean" + }, + "start": { + "type": "integer" + }, + "type": { + "type": "string" + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/games_firehose_barklesheep_reaction.json b/crates/jacquard-api/lexicons/games_firehose_barklesheep_reaction.json new file mode 100644 index 00000000..e773900d --- /dev/null +++ b/crates/jacquard-api/lexicons/games_firehose_barklesheep_reaction.json @@ -0,0 +1,32 @@ +{ + "lexicon": 1, + "id": "games.firehose.barklesheep.reaction", + "defs": { + "main": { + "type": "record", + "description": "A reaction in a Barklesheep game", + "key": "tid", + "record": { + "type": "object", + "required": [ + "gameId", + "emoji", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "emoji": { + "type": "string", + "maxLength": 4 + }, + "gameId": { + "type": "string" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/io_atcr_hold_captain.json b/crates/jacquard-api/lexicons/io_atcr_hold_captain.json new file mode 100644 index 00000000..221b2eca --- /dev/null +++ b/crates/jacquard-api/lexicons/io_atcr_hold_captain.json @@ -0,0 +1,53 @@ +{ + "lexicon": 1, + "id": "io.atcr.hold.captain", + "defs": { + "main": { + "type": "record", + "description": "Represents the hold's ownership and metadata. Stored as a singleton record at rkey 'self' in the hold's embedded PDS.", + "key": "literal:self", + "record": { + "type": "object", + "required": [ + "owner", + "public", + "allowAllCrew", + "enableBlueskyPosts", + "deployedAt" + ], + "properties": { + "allowAllCrew": { + "type": "boolean", + "description": "Allow any authenticated user to register as crew" + }, + "deployedAt": { + "type": "string", + "description": "RFC3339 timestamp of when the hold was deployed", + "format": "datetime" + }, + "enableBlueskyPosts": { + "type": "boolean", + "description": "Enable Bluesky posts when manifests are pushed" + }, + "owner": { + "type": "string", + "description": "DID of the hold owner", + "format": "did" + }, + "provider": { + "type": "string", + "description": "Deployment provider (e.g., fly.io, aws, etc.)" + }, + "public": { + "type": "boolean", + "description": "Whether this hold allows public blob reads (pulls) without authentication" + }, + "region": { + "type": "string", + "description": "S3 region where blobs are stored" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/io_atcr_hold_crew.json b/crates/jacquard-api/lexicons/io_atcr_hold_crew.json new file mode 100644 index 00000000..cfc89569 --- /dev/null +++ b/crates/jacquard-api/lexicons/io_atcr_hold_crew.json @@ -0,0 +1,49 @@ +{ + "lexicon": 1, + "id": "io.atcr.hold.crew", + "defs": { + "main": { + "type": "record", + "description": "Crew member in a hold's embedded PDS. Grants access permissions to push blobs to the hold. Stored in the hold's embedded PDS (one record per member).", + "key": "any", + "record": { + "type": "object", + "required": [ + "member", + "role", + "permissions", + "addedAt" + ], + "properties": { + "addedAt": { + "type": "string", + "description": "RFC3339 timestamp of when the member was added", + "format": "datetime" + }, + "member": { + "type": "string", + "description": "DID of the crew member", + "format": "did" + }, + "permissions": { + "type": "array", + "description": "Specific permissions granted to this member", + "items": { + "type": "string" + } + }, + "role": { + "type": "string", + "description": "Member's role in the hold", + "knownValues": [ + "owner", + "admin", + "write", + "read" + ] + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/io_atcr_hold_layer.json b/crates/jacquard-api/lexicons/io_atcr_hold_layer.json new file mode 100644 index 00000000..0aac8b03 --- /dev/null +++ b/crates/jacquard-api/lexicons/io_atcr_hold_layer.json @@ -0,0 +1,56 @@ +{ + "lexicon": 1, + "id": "io.atcr.hold.layer", + "defs": { + "main": { + "type": "record", + "description": "Represents metadata about a container layer stored in the hold. Stored in the hold's embedded PDS for tracking and analytics.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "digest", + "size", + "mediaType", + "repository", + "userDid", + "userHandle", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "description": "RFC3339 timestamp of when the layer was uploaded", + "format": "datetime" + }, + "digest": { + "type": "string", + "description": "Layer digest (e.g., sha256:abc123...)" + }, + "mediaType": { + "type": "string", + "description": "Media type (e.g., application/vnd.oci.image.layer.v1.tar+gzip)" + }, + "repository": { + "type": "string", + "description": "Repository this layer belongs to" + }, + "size": { + "type": "integer", + "description": "Size in bytes" + }, + "userDid": { + "type": "string", + "description": "DID of user who uploaded this layer", + "format": "did" + }, + "userHandle": { + "type": "string", + "description": "Handle of user (for display purposes)", + "format": "handle" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/io_atcr_manifest.json b/crates/jacquard-api/lexicons/io_atcr_manifest.json new file mode 100644 index 00000000..2991d968 --- /dev/null +++ b/crates/jacquard-api/lexicons/io_atcr_manifest.json @@ -0,0 +1,195 @@ +{ + "lexicon": 1, + "id": "io.atcr.manifest", + "defs": { + "blobReference": { + "type": "object", + "description": "Reference to a blob stored in S3 or external storage", + "required": [ + "mediaType", + "size", + "digest" + ], + "properties": { + "annotations": { + "type": "unknown", + "description": "Optional OCI annotation metadata. Map of string keys to string values." + }, + "digest": { + "type": "string", + "description": "Content digest (e.g., 'sha256:...')" + }, + "mediaType": { + "type": "string", + "description": "MIME type of the blob" + }, + "size": { + "type": "integer", + "description": "Size in bytes" + }, + "urls": { + "type": "array", + "description": "Optional direct URLs to blob (for BYOS)", + "items": { + "type": "string", + "format": "uri" + } + } + } + }, + "main": { + "type": "record", + "description": "A container image manifest following OCI specification, stored in ATProto", + "key": "tid", + "record": { + "type": "object", + "required": [ + "repository", + "digest", + "mediaType", + "schemaVersion", + "createdAt" + ], + "properties": { + "annotations": { + "type": "unknown", + "description": "Optional OCI annotation metadata. Map of string keys to string values (e.g., org.opencontainers.image.title → 'My App')." + }, + "config": { + "type": "ref", + "description": "Reference to image configuration blob", + "ref": "#blobReference" + }, + "createdAt": { + "type": "string", + "description": "Record creation timestamp", + "format": "datetime" + }, + "digest": { + "type": "string", + "description": "Content digest (e.g., 'sha256:abc123...')" + }, + "holdDid": { + "type": "string", + "description": "DID of the hold service where blobs are stored (e.g., 'did:web:hold01.atcr.io'). Primary reference for hold resolution.", + "format": "did" + }, + "holdEndpoint": { + "type": "string", + "description": "Hold service endpoint URL where blobs are stored. DEPRECATED: Use holdDid instead. Kept for backward compatibility.", + "format": "uri" + }, + "layers": { + "type": "array", + "description": "Filesystem layers (for image manifests)", + "items": { + "type": "ref", + "ref": "#blobReference" + } + }, + "manifestBlob": { + "type": "blob", + "description": "The full OCI manifest stored as a blob in ATProto." + }, + "manifests": { + "type": "array", + "description": "Referenced manifests (for manifest lists/indexes)", + "items": { + "type": "ref", + "ref": "#manifestReference" + } + }, + "mediaType": { + "type": "string", + "description": "OCI media type", + "knownValues": [ + "application/vnd.oci.image.manifest.v1+json", + "application/vnd.docker.distribution.manifest.v2+json", + "application/vnd.oci.image.index.v1+json", + "application/vnd.docker.distribution.manifest.list.v2+json" + ] + }, + "repository": { + "type": "string", + "description": "Repository name (e.g., 'myapp'). Scoped to user's DID.", + "maxLength": 255 + }, + "schemaVersion": { + "type": "integer", + "description": "OCI schema version (typically 2)" + }, + "subject": { + "type": "ref", + "description": "Optional reference to another manifest (for attestations, signatures)", + "ref": "#blobReference" + } + } + } + }, + "manifestReference": { + "type": "object", + "description": "Reference to a manifest in a manifest list/index", + "required": [ + "mediaType", + "size", + "digest" + ], + "properties": { + "annotations": { + "type": "unknown", + "description": "Optional OCI annotation metadata. Map of string keys to string values." + }, + "digest": { + "type": "string", + "description": "Content digest (e.g., 'sha256:...')" + }, + "mediaType": { + "type": "string", + "description": "Media type of the referenced manifest" + }, + "platform": { + "type": "ref", + "description": "Platform information for this manifest", + "ref": "#platform" + }, + "size": { + "type": "integer", + "description": "Size in bytes" + } + } + }, + "platform": { + "type": "object", + "description": "Platform information describing OS and architecture", + "required": [ + "architecture", + "os" + ], + "properties": { + "architecture": { + "type": "string", + "description": "CPU architecture (e.g., 'amd64', 'arm64', 'arm')" + }, + "os": { + "type": "string", + "description": "Operating system (e.g., 'linux', 'windows', 'darwin')" + }, + "osFeatures": { + "type": "array", + "description": "Optional OS features", + "items": { + "type": "string" + } + }, + "osVersion": { + "type": "string", + "description": "Optional OS version" + }, + "variant": { + "type": "string", + "description": "Optional CPU variant (e.g., 'v7' for ARM)" + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/io_atcr_sailor_profile.json b/crates/jacquard-api/lexicons/io_atcr_sailor_profile.json new file mode 100644 index 00000000..5f622d4d --- /dev/null +++ b/crates/jacquard-api/lexicons/io_atcr_sailor_profile.json @@ -0,0 +1,34 @@ +{ + "lexicon": 1, + "id": "io.atcr.sailor.profile", + "defs": { + "main": { + "type": "record", + "description": "User profile for ATCR registry. Stores preferences like default hold for blob storage.", + "key": "literal:self", + "record": { + "type": "object", + "required": [ + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "description": "Profile creation timestamp", + "format": "datetime" + }, + "defaultHold": { + "type": "string", + "description": "Default hold endpoint for blob storage. If null, user has opted out of defaults.", + "format": "uri" + }, + "updatedAt": { + "type": "string", + "description": "Profile last updated timestamp", + "format": "datetime" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/io_atcr_sailor_star.json b/crates/jacquard-api/lexicons/io_atcr_sailor_star.json new file mode 100644 index 00000000..6bd67417 --- /dev/null +++ b/crates/jacquard-api/lexicons/io_atcr_sailor_star.json @@ -0,0 +1,50 @@ +{ + "lexicon": 1, + "id": "io.atcr.sailor.star", + "defs": { + "main": { + "type": "record", + "description": "A star (like) on a container image repository. Stored in the starrer's PDS, similar to Bluesky likes.", + "key": "any", + "record": { + "type": "object", + "required": [ + "subject", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "description": "Star creation timestamp", + "format": "datetime" + }, + "subject": { + "type": "ref", + "description": "The repository being starred", + "ref": "#subject" + } + } + } + }, + "subject": { + "type": "object", + "description": "Reference to a repository owned by a user", + "required": [ + "did", + "repository" + ], + "properties": { + "did": { + "type": "string", + "description": "DID of the repository owner", + "format": "did" + }, + "repository": { + "type": "string", + "description": "Repository name (e.g., 'myapp')", + "maxLength": 255 + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/io_atcr_tag.json b/crates/jacquard-api/lexicons/io_atcr_tag.json new file mode 100644 index 00000000..5a8b09c8 --- /dev/null +++ b/crates/jacquard-api/lexicons/io_atcr_tag.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "io.atcr.tag", + "defs": { + "main": { + "type": "record", + "description": "A named tag pointing to a specific manifest digest", + "key": "any", + "record": { + "type": "object", + "required": [ + "repository", + "tag", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "description": "Tag creation timestamp", + "format": "datetime" + }, + "manifest": { + "type": "string", + "description": "AT-URI of the manifest this tag points to (e.g., 'at://did:plc:xyz/io.atcr.manifest/abc123'). Preferred over manifestDigest for new records.", + "format": "at-uri" + }, + "manifestDigest": { + "type": "string", + "description": "DEPRECATED: Digest of the manifest (e.g., 'sha256:...'). Kept for backward compatibility with old records. New records should use 'manifest' field instead." + }, + "repository": { + "type": "string", + "description": "Repository name (e.g., 'myapp'). Scoped to user's DID.", + "maxLength": 255 + }, + "tag": { + "type": "string", + "description": "Tag name (e.g., 'latest', 'v1.0.0', '12-slim')", + "maxLength": 128 + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/io_whiteside_linkedAccount.json b/crates/jacquard-api/lexicons/io_whiteside_linkedAccount.json new file mode 100644 index 00000000..4bc70500 --- /dev/null +++ b/crates/jacquard-api/lexicons/io_whiteside_linkedAccount.json @@ -0,0 +1,33 @@ +{ + "lexicon": 1, + "id": "io.whiteside.linkedAccount", + "defs": { + "main": { + "type": "record", + "description": "A linked account record containing external account information", + "record": { + "type": "object", + "required": [ + "icon", + "name", + "link" + ], + "properties": { + "icon": { + "type": "string", + "description": "Icon identifier or URL for the linked account" + }, + "link": { + "type": "string", + "description": "URL to the linked account", + "format": "uri" + }, + "name": { + "type": "string", + "description": "Display name of the linked account" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/lexicons/io_whiteside_profile.json b/crates/jacquard-api/lexicons/io_whiteside_profile.json new file mode 100644 index 00000000..48295fee --- /dev/null +++ b/crates/jacquard-api/lexicons/io_whiteside_profile.json @@ -0,0 +1,36 @@ +{ + "lexicon": 1, + "id": "io.whiteside.profile", + "defs": { + "main": { + "type": "record", + "description": "Profile information (bio, skills, etc.)", + "key": "literal:bio", + "record": { + "type": "object", + "required": [ + "heading", + "content", + "updatedAt" + ], + "properties": { + "content": { + "type": "string", + "description": "Profile content in plain text or markdown format", + "maxLength": 5000 + }, + "heading": { + "type": "string", + "description": "Profile section heading (e.g. 'Hey, I'm John')", + "maxLength": 200 + }, + "updatedAt": { + "type": "string", + "description": "Last update timestamp in ISO 8601 format", + "format": "datetime" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/jacquard-api/src/blog_pckt/richtext.rs b/crates/jacquard-api/src/blog_pckt/richtext.rs new file mode 100644 index 00000000..3bf124e6 --- /dev/null +++ b/crates/jacquard-api/src/blog_pckt/richtext.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 facet; diff --git a/crates/jacquard-api/src/blog_pckt/richtext/facet.rs b/crates/jacquard-api/src/blog_pckt/richtext/facet.rs new file mode 100644 index 00000000..2ec67538 --- /dev/null +++ b/crates/jacquard-api/src/blog_pckt/richtext/facet.rs @@ -0,0 +1,1280 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: blog.pckt.richtext.facet +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Facet feature for mentioning an AT URI +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct AtMention<'a> { + #[serde(borrow)] + pub at_uri: jacquard_common::types::string::Uri<'a>, +} + +pub mod at_mention_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 AtUri; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type AtUri = Unset; + } + ///State transition - sets the `at_uri` field to Set + pub struct SetAtUri(PhantomData S>); + impl sealed::Sealed for SetAtUri {} + impl State for SetAtUri { + type AtUri = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `at_uri` field + pub struct at_uri(()); + } +} + +/// Builder for constructing an instance of this type +pub struct AtMentionBuilder<'a, S: at_mention_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> AtMention<'a> { + /// Create a new builder for this type + pub fn new() -> AtMentionBuilder<'a, at_mention_state::Empty> { + AtMentionBuilder::new() + } +} + +impl<'a> AtMentionBuilder<'a, at_mention_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + AtMentionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AtMentionBuilder<'a, S> +where + S: at_mention_state::State, + S::AtUri: at_mention_state::IsUnset, +{ + /// Set the `atURI` field (required) + pub fn at_uri( + mut self, + value: impl Into>, + ) -> AtMentionBuilder<'a, at_mention_state::SetAtUri> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + AtMentionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> AtMentionBuilder<'a, S> +where + S: at_mention_state::State, + S::AtUri: at_mention_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> AtMention<'a> { + AtMention { + at_uri: 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>, + >, + ) -> AtMention<'a> { + AtMention { + at_uri: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_blog_pckt_richtext_facet() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("blog.pckt.richtext.facet"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("atMention"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Facet feature for mentioning an AT URI", + )), + required: Some(vec![::jacquard_common::smol_str::SmolStr::new_static( + "atURI", + )]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("atURI"), + ::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("bold"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Facet feature for bold text", + )), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("byteSlice"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("byteStart"), + ::jacquard_common::smol_str::SmolStr::new_static("byteEnd") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("byteEnd"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "byteStart", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("code"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Facet feature for inline code", + )), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("didMention"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Facet feature for mentioning a DID", + )), + required: Some(vec![::jacquard_common::smol_str::SmolStr::new_static( + "did", + )]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + 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 + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("highlight"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Facet feature for highlighted text", + )), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Facet feature for an identifier. Used for linking to a segment", + )), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("id"), + ::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 + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("italic"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Facet feature for italic text", + )), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("link"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("uri")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::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 + }, + }), + ); + 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("index"), + ::jacquard_common::smol_str::SmolStr::new_static("features"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("features"), + ::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![ + ::jacquard_common::CowStr::new_static("#link"), + ::jacquard_common::CowStr::new_static( + "#didMention", + ), + ::jacquard_common::CowStr::new_static( + "#atMention", + ), + ::jacquard_common::CowStr::new_static("#code"), + ::jacquard_common::CowStr::new_static( + "#highlight", + ), + ::jacquard_common::CowStr::new_static( + "#underline", + ), + ::jacquard_common::CowStr::new_static( + "#strikethrough", + ), + ::jacquard_common::CowStr::new_static("#id"), + ::jacquard_common::CowStr::new_static("#bold"), + ::jacquard_common::CowStr::new_static( + "#italic", + ), + ], + closed: None, + }, + ), + min_length: None, + max_length: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("index"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#byteSlice"), + }, + ), + ); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("strikethrough"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Facet feature for strikethrough markup", + )), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("underline"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Facet feature for underline markup", + )), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map + }, + }, + ), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AtMention<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "atMention" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Facet feature for bold text +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct Bold<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Bold<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "bold" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct ByteSlice<'a> { + pub byte_end: i64, + pub byte_start: i64, +} + +pub mod byte_slice_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 ByteStart; + type ByteEnd; + } + /// 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; + } + ///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_start` field + pub struct byte_start(()); + ///Marker type for the `byte_end` field + pub struct byte_end(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ByteSliceBuilder<'a, S: byte_slice_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option, ::core::option::Option), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ByteSlice<'a> { + /// Create a new builder for this type + pub fn new() -> ByteSliceBuilder<'a, byte_slice_state::Empty> { + ByteSliceBuilder::new() + } +} + +impl<'a> ByteSliceBuilder<'a, byte_slice_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ByteSliceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ByteSliceBuilder<'a, S> +where + S: byte_slice_state::State, + S::ByteEnd: byte_slice_state::IsUnset, +{ + /// Set the `byteEnd` field (required) + pub fn byte_end( + mut self, + value: impl Into, + ) -> ByteSliceBuilder<'a, byte_slice_state::SetByteEnd> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ByteSliceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ByteSliceBuilder<'a, S> +where + S: byte_slice_state::State, + S::ByteStart: byte_slice_state::IsUnset, +{ + /// Set the `byteStart` field (required) + pub fn byte_start( + mut self, + value: impl Into, + ) -> ByteSliceBuilder<'a, byte_slice_state::SetByteStart> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ByteSliceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ByteSliceBuilder<'a, S> +where + S: byte_slice_state::State, + S::ByteStart: byte_slice_state::IsSet, + S::ByteEnd: byte_slice_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ByteSlice<'a> { + ByteSlice { + byte_end: self.__unsafe_private_named.0.unwrap(), + byte_start: self.__unsafe_private_named.1.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>, + >, + ) -> ByteSlice<'a> { + ByteSlice { + byte_end: self.__unsafe_private_named.0.unwrap(), + byte_start: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ByteSlice<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "byteSlice" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.byte_end; + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field("byte_end"), + min: 0i64, + actual: *value, + }); + } + } + { + let value = &self.byte_start; + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field("byte_start"), + min: 0i64, + actual: *value, + }); + } + } + Ok(()) + } +} + +/// Facet feature for inline code +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct Code<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Code<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "code" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Facet feature for mentioning a DID +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct DidMention<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, +} + +pub mod did_mention_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct DidMentionBuilder<'a, S: did_mention_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option>,), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> DidMention<'a> { + /// Create a new builder for this type + pub fn new() -> DidMentionBuilder<'a, did_mention_state::Empty> { + DidMentionBuilder::new() + } +} + +impl<'a> DidMentionBuilder<'a, did_mention_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + DidMentionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DidMentionBuilder<'a, S> +where + S: did_mention_state::State, + S::Did: did_mention_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> DidMentionBuilder<'a, did_mention_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + DidMentionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> DidMentionBuilder<'a, S> +where + S: did_mention_state::State, + S::Did: did_mention_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> DidMention<'a> { + DidMention { + did: 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>, + >, + ) -> DidMention<'a> { + DidMention { + did: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DidMention<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "didMention" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Facet feature for highlighted text +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct Highlight<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Highlight<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "highlight" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Facet feature for an identifier. Used for linking to a segment +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct Id<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub id: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Id<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "id" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Facet feature for italic text +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct Italic<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Italic<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "italic" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct Link<'a> { + #[serde(borrow)] + pub uri: jacquard_common::CowStr<'a>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Link<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "link" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Facet<'a> { + #[serde(borrow)] + pub features: Vec>, + #[serde(borrow)] + pub index: crate::blog_pckt::richtext::facet::ByteSlice<'a>, +} + +pub mod facet_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Index; + type Features; + } + /// 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; + } + ///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; + } + /// 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(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FacetBuilder<'a, S: facet_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Facet<'a> { + /// Create a new builder for this type + pub fn new() -> FacetBuilder<'a, facet_state::Empty> { + FacetBuilder::new() + } +} + +impl<'a> FacetBuilder<'a, facet_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FacetBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FacetBuilder<'a, S> +where + S: facet_state::State, + S::Features: facet_state::IsUnset, +{ + /// Set the `features` field (required) + pub fn features( + mut self, + value: impl Into>>, + ) -> FacetBuilder<'a, facet_state::SetFeatures> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + FacetBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FacetBuilder<'a, S> +where + S: facet_state::State, + S::Index: facet_state::IsUnset, +{ + /// Set the `index` field (required) + pub fn index( + mut self, + value: impl Into>, + ) -> FacetBuilder<'a, facet_state::SetIndex> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + FacetBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FacetBuilder<'a, S> +where + S: facet_state::State, + S::Index: facet_state::IsSet, + S::Features: facet_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Facet<'a> { + Facet { + features: self.__unsafe_private_named.0.unwrap(), + index: self.__unsafe_private_named.1.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>, + >, + ) -> Facet<'a> { + Facet { + features: self.__unsafe_private_named.0.unwrap(), + index: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(tag = "$type")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum FacetFeaturesItem<'a> { + #[serde(rename = "blog.pckt.richtext.facet#link")] + Link(Box>), + #[serde(rename = "blog.pckt.richtext.facet#didMention")] + DidMention(Box>), + #[serde(rename = "blog.pckt.richtext.facet#atMention")] + AtMention(Box>), + #[serde(rename = "blog.pckt.richtext.facet#code")] + Code(Box>), + #[serde(rename = "blog.pckt.richtext.facet#highlight")] + Highlight(Box>), + #[serde(rename = "blog.pckt.richtext.facet#underline")] + Underline(Box>), + #[serde(rename = "blog.pckt.richtext.facet#strikethrough")] + Strikethrough(Box>), + #[serde(rename = "blog.pckt.richtext.facet#id")] + Id(Box>), + #[serde(rename = "blog.pckt.richtext.facet#bold")] + Bold(Box>), + #[serde(rename = "blog.pckt.richtext.facet#italic")] + Italic(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Facet<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Facet feature for strikethrough markup +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct Strikethrough<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Strikethrough<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "strikethrough" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Facet feature for underline markup +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct Underline<'a> {} +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Underline<'a> { + fn nsid() -> &'static str { + "blog.pckt.richtext.facet" + } + fn def_name() -> &'static str { + "underline" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_blog_pckt_richtext_facet() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} diff --git a/crates/jacquard-api/src/com__5jiji/test/list_videos.rs b/crates/jacquard-api/src/com__5jiji/test/list_videos.rs new file mode 100644 index 00000000..5a63ddb6 --- /dev/null +++ b/crates/jacquard-api/src/com__5jiji/test/list_videos.rs @@ -0,0 +1,46 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.5jiji.test.listVideos +// +// 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 ListVideos; +/// The list of videos +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct ListVideosOutput { + pub body: bytes::Bytes, +} + +/// Response type for +///com.5jiji.test.listVideos +pub struct ListVideosResponse; +impl jacquard_common::xrpc::XrpcResp for ListVideosResponse { + const NSID: &'static str = "com.5jiji.test.listVideos"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ListVideosOutput; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for ListVideos { + const NSID: &'static str = "com.5jiji.test.listVideos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ListVideosResponse; +} + +/// Endpoint type for +///com.5jiji.test.listVideos +pub struct ListVideosRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ListVideosRequest { + const PATH: &'static str = "/xrpc/com.5jiji.test.listVideos"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ListVideos; + type Response = ListVideosResponse; +} diff --git a/crates/jacquard-api/src/com_yuna0x0.rs b/crates/jacquard-api/src/com_yuna0x0.rs new file mode 100644 index 00000000..8cd689fc --- /dev/null +++ b/crates/jacquard-api/src/com_yuna0x0.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 guestbook; diff --git a/crates/jacquard-api/src/com_yuna0x0/guestbook.rs b/crates/jacquard-api/src/com_yuna0x0/guestbook.rs new file mode 100644 index 00000000..7b8c63bb --- /dev/null +++ b/crates/jacquard-api/src/com_yuna0x0/guestbook.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 sign; diff --git a/crates/jacquard-api/src/com_yuna0x0/guestbook/sign.rs b/crates/jacquard-api/src/com_yuna0x0/guestbook/sign.rs new file mode 100644 index 00000000..0033a4e7 --- /dev/null +++ b/crates/jacquard-api/src/com_yuna0x0/guestbook/sign.rs @@ -0,0 +1,369 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: com.yuna0x0.guestbook.sign +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// a sign in the guestbook +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Sign<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub message: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub subject: jacquard_common::types::ident::AtIdentifier<'a>, +} + +pub mod sign_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type CreatedAt; + type Subject; + type Message; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type CreatedAt = Unset; + type Subject = Unset; + type Message = Unset; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type Subject = S::Subject; + type Message = S::Message; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type CreatedAt = S::CreatedAt; + type Subject = Set; + type 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 CreatedAt = S::CreatedAt; + type Subject = S::Subject; + type Message = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `message` field + pub struct message(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SignBuilder<'a, S: sign_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> Sign<'a> { + /// Create a new builder for this type + pub fn new() -> SignBuilder<'a, sign_state::Empty> { + SignBuilder::new() + } +} + +impl<'a> SignBuilder<'a, sign_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SignBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SignBuilder<'a, S> +where + S: sign_state::State, + S::CreatedAt: sign_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> SignBuilder<'a, sign_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SignBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SignBuilder<'a, S> +where + S: sign_state::State, + S::Message: sign_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> SignBuilder<'a, sign_state::SetMessage> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SignBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SignBuilder<'a, S> +where + S: sign_state::State, + S::Subject: sign_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> SignBuilder<'a, sign_state::SetSubject> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SignBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SignBuilder<'a, S> +where + S: sign_state::State, + S::CreatedAt: sign_state::IsSet, + S::Subject: sign_state::IsSet, + S::Message: sign_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Sign<'a> { + Sign { + created_at: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + subject: self.__unsafe_private_named.2.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>, + >, + ) -> Sign<'a> { + Sign { + created_at: self.__unsafe_private_named.0.unwrap(), + message: self.__unsafe_private_named.1.unwrap(), + subject: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Sign<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, SignRecord>, + 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 SignGetRecordOutput<'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: Sign<'a>, +} + +impl From> for Sign<'_> { + fn from(output: SignGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Sign<'_> { + const NSID: &'static str = "com.yuna0x0.guestbook.sign"; + type Record = SignRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct SignRecord; +impl jacquard_common::xrpc::XrpcResp for SignRecord { + const NSID: &'static str = "com.yuna0x0.guestbook.sign"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SignGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for SignRecord { + const NSID: &'static str = "com.yuna0x0.guestbook.sign"; + type Record = SignRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Sign<'a> { + fn nsid() -> &'static str { + "com.yuna0x0.guestbook.sign" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_com_yuna0x0_guestbook_sign() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.message; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 100usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field("message"), + max: 100usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +fn lexicon_doc_com_yuna0x0_guestbook_sign() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("com.yuna0x0.guestbook.sign"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static("a sign in the guestbook"), + ), + 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("subject"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), + ::jacquard_common::smol_str::SmolStr::new_static("message") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("message"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(100usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtIdentifier, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + }), + ); + map + }, + } +} diff --git a/crates/jacquard-api/src/fyi_questionable/actor.rs b/crates/jacquard-api/src/fyi_questionable/actor.rs new file mode 100644 index 00000000..1cb60f21 --- /dev/null +++ b/crates/jacquard-api/src/fyi_questionable/actor.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 profile; diff --git a/crates/jacquard-api/src/fyi_questionable/actor/profile.rs b/crates/jacquard-api/src/fyi_questionable/actor/profile.rs new file mode 100644 index 00000000..8fa24a15 --- /dev/null +++ b/crates/jacquard-api/src/fyi_questionable/actor/profile.rs @@ -0,0 +1,300 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: fyi.questionable.actor.profile +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A declaration of a Questionable account profile. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Profile<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub display_name: std::option::Option>, +} + +pub mod profile_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 {} + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty {} + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members {} +} + +/// Builder for constructing an instance of this type +pub struct ProfileBuilder<'a, S: profile_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Profile<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileBuilder<'a, profile_state::Empty> { + ProfileBuilder::new() + } +} + +impl<'a> ProfileBuilder<'a, profile_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `createdAt` field to an Option value (optional) + pub fn maybe_created_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `displayName` field (optional) + pub fn display_name(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `displayName` field to an Option value (optional) + pub fn maybe_display_name(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ProfileBuilder<'a, S> +where + S: profile_state::State, +{ + /// Build the final struct + pub fn build(self) -> Profile<'a> { + Profile { + created_at: self.__unsafe_private_named.0, + display_name: self.__unsafe_private_named.1, + 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>, + >, + ) -> Profile<'a> { + Profile { + created_at: self.__unsafe_private_named.0, + display_name: self.__unsafe_private_named.1, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Profile<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ProfileRecord>, + 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 ProfileGetRecordOutput<'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: Profile<'a>, +} + +impl From> for Profile<'_> { + fn from(output: ProfileGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Profile<'_> { + const NSID: &'static str = "fyi.questionable.actor.profile"; + type Record = ProfileRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ProfileRecord; +impl jacquard_common::xrpc::XrpcResp for ProfileRecord { + const NSID: &'static str = "fyi.questionable.actor.profile"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ProfileGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ProfileRecord { + const NSID: &'static str = "fyi.questionable.actor.profile"; + type Record = ProfileRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Profile<'a> { + fn nsid() -> &'static str { + "fyi.questionable.actor.profile" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_fyi_questionable_actor_profile() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.display_name { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 640usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "display_name", + ), + max: 640usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.display_name { + { + let count = + ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) + .count(); + if count > 64usize { + return Err( + ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "display_name", + ), + max: 64usize, + actual: count, + }, + ); + } + } + } + Ok(()) + } +} + +fn lexicon_doc_fyi_questionable_actor_profile() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> +{ + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("fyi.questionable.actor.profile"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "A declaration of a Questionable account profile.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("literal:self")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "displayName", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(640usize), + min_graphemes: None, + max_graphemes: Some(64usize), + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + }), + ); + map + }, + } +} diff --git a/crates/jacquard-api/src/games_firehose.rs b/crates/jacquard-api/src/games_firehose.rs new file mode 100644 index 00000000..e8daa66f --- /dev/null +++ b/crates/jacquard-api/src/games_firehose.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 barklesheep; diff --git a/crates/jacquard-api/src/games_firehose/barklesheep.rs b/crates/jacquard-api/src/games_firehose/barklesheep.rs new file mode 100644 index 00000000..354441c0 --- /dev/null +++ b/crates/jacquard-api/src/games_firehose/barklesheep.rs @@ -0,0 +1,7 @@ +// @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 place_sheeps; +pub mod reaction; diff --git a/crates/jacquard-api/src/games_firehose/barklesheep/place_sheeps.rs b/crates/jacquard-api/src/games_firehose/barklesheep/place_sheeps.rs new file mode 100644 index 00000000..ae140ff0 --- /dev/null +++ b/crates/jacquard-api/src/games_firehose/barklesheep/place_sheeps.rs @@ -0,0 +1,545 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: games.firehose.barklesheep.placeSheeps +// +// 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 PlaceSheeps<'a> { + #[serde(borrow)] + pub game_id: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub sheeps: Vec>, +} + +pub mod place_sheeps_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Sheeps; + type GameId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Sheeps = Unset; + type GameId = Unset; + } + ///State transition - sets the `sheeps` field to Set + pub struct SetSheeps(PhantomData S>); + impl sealed::Sealed for SetSheeps {} + impl State for SetSheeps { + type Sheeps = Set; + type GameId = S::GameId; + } + ///State transition - sets the `game_id` field to Set + pub struct SetGameId(PhantomData S>); + impl sealed::Sealed for SetGameId {} + impl State for SetGameId { + type Sheeps = S::Sheeps; + type GameId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `sheeps` field + pub struct sheeps(()); + ///Marker type for the `game_id` field + pub struct game_id(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PlaceSheepsBuilder<'a, S: place_sheeps_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option< + Vec>, + >, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PlaceSheeps<'a> { + /// Create a new builder for this type + pub fn new() -> PlaceSheepsBuilder<'a, place_sheeps_state::Empty> { + PlaceSheepsBuilder::new() + } +} + +impl<'a> PlaceSheepsBuilder<'a, place_sheeps_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PlaceSheepsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PlaceSheepsBuilder<'a, S> +where + S: place_sheeps_state::State, + S::GameId: place_sheeps_state::IsUnset, +{ + /// Set the `gameId` field (required) + pub fn game_id( + mut self, + value: impl Into>, + ) -> PlaceSheepsBuilder<'a, place_sheeps_state::SetGameId> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PlaceSheepsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PlaceSheepsBuilder<'a, S> +where + S: place_sheeps_state::State, + S::Sheeps: place_sheeps_state::IsUnset, +{ + /// Set the `sheeps` field (required) + pub fn sheeps( + mut self, + value: impl Into>>, + ) -> PlaceSheepsBuilder<'a, place_sheeps_state::SetSheeps> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + PlaceSheepsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PlaceSheepsBuilder<'a, S> +where + S: place_sheeps_state::State, + S::Sheeps: place_sheeps_state::IsSet, + S::GameId: place_sheeps_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PlaceSheeps<'a> { + PlaceSheeps { + game_id: self.__unsafe_private_named.0.unwrap(), + sheeps: self.__unsafe_private_named.1.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>, + >, + ) -> PlaceSheeps<'a> { + PlaceSheeps { + game_id: self.__unsafe_private_named.0.unwrap(), + sheeps: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct PlaceSheepsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub success: std::option::Option, +} + +/// Response type for +///games.firehose.barklesheep.placeSheeps +pub struct PlaceSheepsResponse; +impl jacquard_common::xrpc::XrpcResp for PlaceSheepsResponse { + const NSID: &'static str = "games.firehose.barklesheep.placeSheeps"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = PlaceSheepsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for PlaceSheeps<'a> { + const NSID: &'static str = "games.firehose.barklesheep.placeSheeps"; + const METHOD: jacquard_common::xrpc::XrpcMethod = + jacquard_common::xrpc::XrpcMethod::Procedure("application/json"); + type Response = PlaceSheepsResponse; +} + +/// Endpoint type for +///games.firehose.barklesheep.placeSheeps +pub struct PlaceSheepsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for PlaceSheepsRequest { + const PATH: &'static str = "/xrpc/games.firehose.barklesheep.placeSheeps"; + const METHOD: jacquard_common::xrpc::XrpcMethod = + jacquard_common::xrpc::XrpcMethod::Procedure("application/json"); + type Request<'de> = PlaceSheeps<'de>; + type Response = PlaceSheepsResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct SheepPlacement<'a> { + pub horizontal: bool, + pub start: i64, + #[serde(borrow)] + pub r#type: jacquard_common::CowStr<'a>, +} + +pub mod sheep_placement_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Horizontal; + type Start; + type Type; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Horizontal = Unset; + type Start = Unset; + type Type = Unset; + } + ///State transition - sets the `horizontal` field to Set + pub struct SetHorizontal(PhantomData S>); + impl sealed::Sealed for SetHorizontal {} + impl State for SetHorizontal { + type Horizontal = Set; + type Start = S::Start; + type Type = S::Type; + } + ///State transition - sets the `start` field to Set + pub struct SetStart(PhantomData S>); + impl sealed::Sealed for SetStart {} + impl State for SetStart { + type Horizontal = S::Horizontal; + type Start = Set; + type Type = S::Type; + } + ///State transition - sets the `type` field to Set + pub struct SetType(PhantomData S>); + impl sealed::Sealed for SetType {} + impl State for SetType { + type Horizontal = S::Horizontal; + type Start = S::Start; + type Type = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `horizontal` field + pub struct horizontal(()); + ///Marker type for the `start` field + pub struct start(()); + ///Marker type for the `type` field + pub struct r#type(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SheepPlacementBuilder<'a, S: sheep_placement_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> SheepPlacement<'a> { + /// Create a new builder for this type + pub fn new() -> SheepPlacementBuilder<'a, sheep_placement_state::Empty> { + SheepPlacementBuilder::new() + } +} + +impl<'a> SheepPlacementBuilder<'a, sheep_placement_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SheepPlacementBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SheepPlacementBuilder<'a, S> +where + S: sheep_placement_state::State, + S::Horizontal: sheep_placement_state::IsUnset, +{ + /// Set the `horizontal` field (required) + pub fn horizontal( + mut self, + value: impl Into, + ) -> SheepPlacementBuilder<'a, sheep_placement_state::SetHorizontal> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SheepPlacementBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SheepPlacementBuilder<'a, S> +where + S: sheep_placement_state::State, + S::Start: sheep_placement_state::IsUnset, +{ + /// Set the `start` field (required) + pub fn start( + mut self, + value: impl Into, + ) -> SheepPlacementBuilder<'a, sheep_placement_state::SetStart> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SheepPlacementBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SheepPlacementBuilder<'a, S> +where + S: sheep_placement_state::State, + S::Type: sheep_placement_state::IsUnset, +{ + /// Set the `type` field (required) + pub fn r#type( + mut self, + value: impl Into>, + ) -> SheepPlacementBuilder<'a, sheep_placement_state::SetType> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SheepPlacementBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SheepPlacementBuilder<'a, S> +where + S: sheep_placement_state::State, + S::Horizontal: sheep_placement_state::IsSet, + S::Start: sheep_placement_state::IsSet, + S::Type: sheep_placement_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SheepPlacement<'a> { + SheepPlacement { + horizontal: self.__unsafe_private_named.0.unwrap(), + start: self.__unsafe_private_named.1.unwrap(), + r#type: self.__unsafe_private_named.2.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>, + >, + ) -> SheepPlacement<'a> { + SheepPlacement { + horizontal: self.__unsafe_private_named.0.unwrap(), + start: self.__unsafe_private_named.1.unwrap(), + r#type: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_games_firehose_barklesheep_placeSheeps() +-> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("games.firehose.barklesheep.placeSheeps"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { + description: None, + parameters: None, + input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { + description: None, + encoding: ::jacquard_common::CowStr::new_static( + "application/json", + ), + schema: Some( + ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("gameId"), + ::jacquard_common::smol_str::SmolStr::new_static("sheeps") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("gameId"), + ::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("sheeps"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#sheepPlacement", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ), + }), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("sheepPlacement"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some(vec![ + ::jacquard_common::smol_str::SmolStr::new_static("type"), + ::jacquard_common::smol_str::SmolStr::new_static("start"), + ::jacquard_common::smol_str::SmolStr::new_static("horizontal"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("horizontal"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean( + ::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("start"), + ::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("type"), + ::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 + }, + }, + ), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SheepPlacement<'a> { + fn nsid() -> &'static str { + "games.firehose.barklesheep.placeSheeps" + } + fn def_name() -> &'static str { + "sheepPlacement" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_games_firehose_barklesheep_placeSheeps() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} diff --git a/crates/jacquard-api/src/games_firehose/barklesheep/reaction.rs b/crates/jacquard-api/src/games_firehose/barklesheep/reaction.rs new file mode 100644 index 00000000..d6abe549 --- /dev/null +++ b/crates/jacquard-api/src/games_firehose/barklesheep/reaction.rs @@ -0,0 +1,370 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: games.firehose.barklesheep.reaction +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A reaction in a Barklesheep game +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Reaction<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub emoji: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub game_id: jacquard_common::CowStr<'a>, +} + +pub mod reaction_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Emoji; + type GameId; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Emoji = Unset; + type GameId = Unset; + type CreatedAt = Unset; + } + ///State transition - sets the `emoji` field to Set + pub struct SetEmoji(PhantomData S>); + impl sealed::Sealed for SetEmoji {} + impl State for SetEmoji { + type Emoji = Set; + type GameId = S::GameId; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `game_id` field to Set + pub struct SetGameId(PhantomData S>); + impl sealed::Sealed for SetGameId {} + impl State for SetGameId { + type Emoji = S::Emoji; + type GameId = 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 Emoji = S::Emoji; + type GameId = S::GameId; + type CreatedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `emoji` field + pub struct emoji(()); + ///Marker type for the `game_id` field + pub struct game_id(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ReactionBuilder<'a, S: reaction_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> Reaction<'a> { + /// Create a new builder for this type + pub fn new() -> ReactionBuilder<'a, reaction_state::Empty> { + ReactionBuilder::new() + } +} + +impl<'a> ReactionBuilder<'a, reaction_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReactionBuilder<'a, S> +where + S: reaction_state::State, + S::CreatedAt: reaction_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ReactionBuilder<'a, reaction_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReactionBuilder<'a, S> +where + S: reaction_state::State, + S::Emoji: reaction_state::IsUnset, +{ + /// Set the `emoji` field (required) + pub fn emoji( + mut self, + value: impl Into>, + ) -> ReactionBuilder<'a, reaction_state::SetEmoji> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReactionBuilder<'a, S> +where + S: reaction_state::State, + S::GameId: reaction_state::IsUnset, +{ + /// Set the `gameId` field (required) + pub fn game_id( + mut self, + value: impl Into>, + ) -> ReactionBuilder<'a, reaction_state::SetGameId> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ReactionBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReactionBuilder<'a, S> +where + S: reaction_state::State, + S::Emoji: reaction_state::IsSet, + S::GameId: reaction_state::IsSet, + S::CreatedAt: reaction_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Reaction<'a> { + Reaction { + created_at: self.__unsafe_private_named.0.unwrap(), + emoji: self.__unsafe_private_named.1.unwrap(), + game_id: self.__unsafe_private_named.2.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>, + >, + ) -> Reaction<'a> { + Reaction { + created_at: self.__unsafe_private_named.0.unwrap(), + emoji: self.__unsafe_private_named.1.unwrap(), + game_id: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Reaction<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ReactionRecord>, + 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 ReactionGetRecordOutput<'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: Reaction<'a>, +} + +impl From> for Reaction<'_> { + fn from(output: ReactionGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Reaction<'_> { + const NSID: &'static str = "games.firehose.barklesheep.reaction"; + type Record = ReactionRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ReactionRecord; +impl jacquard_common::xrpc::XrpcResp for ReactionRecord { + const NSID: &'static str = "games.firehose.barklesheep.reaction"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ReactionGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ReactionRecord { + const NSID: &'static str = "games.firehose.barklesheep.reaction"; + type Record = ReactionRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Reaction<'a> { + fn nsid() -> &'static str { + "games.firehose.barklesheep.reaction" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_games_firehose_barklesheep_reaction() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.emoji; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 4usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field("emoji"), + max: 4usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +fn lexicon_doc_games_firehose_barklesheep_reaction() +-> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("games.firehose.barklesheep.reaction"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "A reaction in a Barklesheep game", + ), + ), + 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("gameId"), + ::jacquard_common::smol_str::SmolStr::new_static("emoji"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("emoji"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(4usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("gameId"), + ::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 + }, + }), + }), + ); + map + }, + } +} diff --git a/crates/jacquard-api/src/io_atcr.rs b/crates/jacquard-api/src/io_atcr.rs new file mode 100644 index 00000000..8617bf97 --- /dev/null +++ b/crates/jacquard-api/src/io_atcr.rs @@ -0,0 +1,9 @@ +// @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 hold; +pub mod manifest; +pub mod sailor; +pub mod tag; diff --git a/crates/jacquard-api/src/io_atcr/hold.rs b/crates/jacquard-api/src/io_atcr/hold.rs new file mode 100644 index 00000000..6f136b41 --- /dev/null +++ b/crates/jacquard-api/src/io_atcr/hold.rs @@ -0,0 +1,8 @@ +// @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 captain; +pub mod crew; +pub mod layer; diff --git a/crates/jacquard-api/src/io_atcr/hold/captain.rs b/crates/jacquard-api/src/io_atcr/hold/captain.rs new file mode 100644 index 00000000..2efaab96 --- /dev/null +++ b/crates/jacquard-api/src/io_atcr/hold/captain.rs @@ -0,0 +1,549 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: io.atcr.hold.captain +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Represents the hold's ownership and metadata. Stored as a singleton record at rkey 'self' in the hold's embedded PDS. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Captain<'a> { + /// Allow any authenticated user to register as crew + pub allow_all_crew: bool, + /// RFC3339 timestamp of when the hold was deployed + pub deployed_at: jacquard_common::types::string::Datetime, + /// Enable Bluesky posts when manifests are pushed + pub enable_bluesky_posts: bool, + /// DID of the hold owner + #[serde(borrow)] + pub owner: jacquard_common::types::string::Did<'a>, + /// Deployment provider (e.g., fly.io, aws, etc.) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub provider: std::option::Option>, + /// Whether this hold allows public blob reads (pulls) without authentication + pub public: bool, + /// S3 region where blobs are stored + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub region: std::option::Option>, +} + +pub mod captain_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Public; + type Owner; + type EnableBlueskyPosts; + type DeployedAt; + type AllowAllCrew; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Public = Unset; + type Owner = Unset; + type EnableBlueskyPosts = Unset; + type DeployedAt = Unset; + type AllowAllCrew = Unset; + } + ///State transition - sets the `public` field to Set + pub struct SetPublic(PhantomData S>); + impl sealed::Sealed for SetPublic {} + impl State for SetPublic { + type Public = Set; + type Owner = S::Owner; + type EnableBlueskyPosts = S::EnableBlueskyPosts; + type DeployedAt = S::DeployedAt; + type AllowAllCrew = S::AllowAllCrew; + } + ///State transition - sets the `owner` field to Set + pub struct SetOwner(PhantomData S>); + impl sealed::Sealed for SetOwner {} + impl State for SetOwner { + type Public = S::Public; + type Owner = Set; + type EnableBlueskyPosts = S::EnableBlueskyPosts; + type DeployedAt = S::DeployedAt; + type AllowAllCrew = S::AllowAllCrew; + } + ///State transition - sets the `enable_bluesky_posts` field to Set + pub struct SetEnableBlueskyPosts(PhantomData S>); + impl sealed::Sealed for SetEnableBlueskyPosts {} + impl State for SetEnableBlueskyPosts { + type Public = S::Public; + type Owner = S::Owner; + type EnableBlueskyPosts = Set; + type DeployedAt = S::DeployedAt; + type AllowAllCrew = S::AllowAllCrew; + } + ///State transition - sets the `deployed_at` field to Set + pub struct SetDeployedAt(PhantomData S>); + impl sealed::Sealed for SetDeployedAt {} + impl State for SetDeployedAt { + type Public = S::Public; + type Owner = S::Owner; + type EnableBlueskyPosts = S::EnableBlueskyPosts; + type DeployedAt = Set; + type AllowAllCrew = S::AllowAllCrew; + } + ///State transition - sets the `allow_all_crew` field to Set + pub struct SetAllowAllCrew(PhantomData S>); + impl sealed::Sealed for SetAllowAllCrew {} + impl State for SetAllowAllCrew { + type Public = S::Public; + type Owner = S::Owner; + type EnableBlueskyPosts = S::EnableBlueskyPosts; + type DeployedAt = S::DeployedAt; + type AllowAllCrew = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `public` field + pub struct public(()); + ///Marker type for the `owner` field + pub struct owner(()); + ///Marker type for the `enable_bluesky_posts` field + pub struct enable_bluesky_posts(()); + ///Marker type for the `deployed_at` field + pub struct deployed_at(()); + ///Marker type for the `allow_all_crew` field + pub struct allow_all_crew(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CaptainBuilder<'a, S: captain_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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Captain<'a> { + /// Create a new builder for this type + pub fn new() -> CaptainBuilder<'a, captain_state::Empty> { + CaptainBuilder::new() + } +} + +impl<'a> CaptainBuilder<'a, captain_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CaptainBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CaptainBuilder<'a, S> +where + S: captain_state::State, + S::AllowAllCrew: captain_state::IsUnset, +{ + /// Set the `allowAllCrew` field (required) + pub fn allow_all_crew( + mut self, + value: impl Into, + ) -> CaptainBuilder<'a, captain_state::SetAllowAllCrew> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CaptainBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CaptainBuilder<'a, S> +where + S: captain_state::State, + S::DeployedAt: captain_state::IsUnset, +{ + /// Set the `deployedAt` field (required) + pub fn deployed_at( + mut self, + value: impl Into, + ) -> CaptainBuilder<'a, captain_state::SetDeployedAt> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CaptainBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CaptainBuilder<'a, S> +where + S: captain_state::State, + S::EnableBlueskyPosts: captain_state::IsUnset, +{ + /// Set the `enableBlueskyPosts` field (required) + pub fn enable_bluesky_posts( + mut self, + value: impl Into, + ) -> CaptainBuilder<'a, captain_state::SetEnableBlueskyPosts> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + CaptainBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CaptainBuilder<'a, S> +where + S: captain_state::State, + S::Owner: captain_state::IsUnset, +{ + /// Set the `owner` field (required) + pub fn owner( + mut self, + value: impl Into>, + ) -> CaptainBuilder<'a, captain_state::SetOwner> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + CaptainBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: captain_state::State> CaptainBuilder<'a, S> { + /// Set the `provider` field (optional) + pub fn provider(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `provider` field to an Option value (optional) + pub fn maybe_provider(mut self, value: Option>) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> CaptainBuilder<'a, S> +where + S: captain_state::State, + S::Public: captain_state::IsUnset, +{ + /// Set the `public` field (required) + pub fn public( + mut self, + value: impl Into, + ) -> CaptainBuilder<'a, captain_state::SetPublic> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + CaptainBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: captain_state::State> CaptainBuilder<'a, S> { + /// Set the `region` field (optional) + pub fn region(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `region` field to an Option value (optional) + pub fn maybe_region(mut self, value: Option>) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> CaptainBuilder<'a, S> +where + S: captain_state::State, + S::Public: captain_state::IsSet, + S::Owner: captain_state::IsSet, + S::EnableBlueskyPosts: captain_state::IsSet, + S::DeployedAt: captain_state::IsSet, + S::AllowAllCrew: captain_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Captain<'a> { + Captain { + allow_all_crew: self.__unsafe_private_named.0.unwrap(), + deployed_at: self.__unsafe_private_named.1.unwrap(), + enable_bluesky_posts: self.__unsafe_private_named.2.unwrap(), + owner: self.__unsafe_private_named.3.unwrap(), + provider: self.__unsafe_private_named.4, + public: self.__unsafe_private_named.5.unwrap(), + region: self.__unsafe_private_named.6, + 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>, + >, + ) -> Captain<'a> { + Captain { + allow_all_crew: self.__unsafe_private_named.0.unwrap(), + deployed_at: self.__unsafe_private_named.1.unwrap(), + enable_bluesky_posts: self.__unsafe_private_named.2.unwrap(), + owner: self.__unsafe_private_named.3.unwrap(), + provider: self.__unsafe_private_named.4, + public: self.__unsafe_private_named.5.unwrap(), + region: self.__unsafe_private_named.6, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Captain<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, CaptainRecord>, + 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 CaptainGetRecordOutput<'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: Captain<'a>, +} + +impl From> for Captain<'_> { + fn from(output: CaptainGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Captain<'_> { + const NSID: &'static str = "io.atcr.hold.captain"; + type Record = CaptainRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct CaptainRecord; +impl jacquard_common::xrpc::XrpcResp for CaptainRecord { + const NSID: &'static str = "io.atcr.hold.captain"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CaptainGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for CaptainRecord { + const NSID: &'static str = "io.atcr.hold.captain"; + type Record = CaptainRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Captain<'a> { + fn nsid() -> &'static str { + "io.atcr.hold.captain" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_atcr_hold_captain() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_io_atcr_hold_captain() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("io.atcr.hold.captain"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "Represents the hold's ownership and metadata. Stored as a singleton record at rkey 'self' in the hold's embedded PDS.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("literal:self")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("owner"), + ::jacquard_common::smol_str::SmolStr::new_static("public"), + ::jacquard_common::smol_str::SmolStr::new_static("allowAllCrew"), + ::jacquard_common::smol_str::SmolStr::new_static("enableBlueskyPosts"), + ::jacquard_common::smol_str::SmolStr::new_static("deployedAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "allowAllCrew", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "deployedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "RFC3339 timestamp of when the hold was deployed", + ), + ), + 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( + "enableBlueskyPosts", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("owner"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID of the hold owner", + ), + ), + 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( + "provider", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Deployment provider (e.g., fly.io, aws, etc.)", + ), + ), + 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("public"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("region"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "S3 region where blobs are stored", + ), + ), + 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 + }, + }), + }), + ); + map + }, + } +} diff --git a/crates/jacquard-api/src/io_atcr/hold/crew.rs b/crates/jacquard-api/src/io_atcr/hold/crew.rs new file mode 100644 index 00000000..8072b207 --- /dev/null +++ b/crates/jacquard-api/src/io_atcr/hold/crew.rs @@ -0,0 +1,442 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: io.atcr.hold.crew +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Crew member in a hold's embedded PDS. Grants access permissions to push blobs to the hold. Stored in the hold's embedded PDS (one record per member). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Crew<'a> { + /// RFC3339 timestamp of when the member was added + pub added_at: jacquard_common::types::string::Datetime, + /// DID of the crew member + #[serde(borrow)] + pub member: jacquard_common::types::string::Did<'a>, + /// Specific permissions granted to this member + #[serde(borrow)] + pub permissions: Vec>, + /// Member's role in the hold + #[serde(borrow)] + pub role: jacquard_common::CowStr<'a>, +} + +pub mod crew_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Member; + type Permissions; + type AddedAt; + type Role; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Member = Unset; + type Permissions = Unset; + type AddedAt = Unset; + type Role = Unset; + } + ///State transition - sets the `member` field to Set + pub struct SetMember(PhantomData S>); + impl sealed::Sealed for SetMember {} + impl State for SetMember { + type Member = Set; + type Permissions = S::Permissions; + type AddedAt = S::AddedAt; + type Role = S::Role; + } + ///State transition - sets the `permissions` field to Set + pub struct SetPermissions(PhantomData S>); + impl sealed::Sealed for SetPermissions {} + impl State for SetPermissions { + type Member = S::Member; + type Permissions = Set; + type AddedAt = S::AddedAt; + type Role = S::Role; + } + ///State transition - sets the `added_at` field to Set + pub struct SetAddedAt(PhantomData S>); + impl sealed::Sealed for SetAddedAt {} + impl State for SetAddedAt { + type Member = S::Member; + type Permissions = S::Permissions; + type AddedAt = 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 Member = S::Member; + type Permissions = S::Permissions; + type AddedAt = S::AddedAt; + type Role = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `member` field + pub struct member(()); + ///Marker type for the `permissions` field + pub struct permissions(()); + ///Marker type for the `added_at` field + pub struct added_at(()); + ///Marker type for the `role` field + pub struct role(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CrewBuilder<'a, S: crew_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Crew<'a> { + /// Create a new builder for this type + pub fn new() -> CrewBuilder<'a, crew_state::Empty> { + CrewBuilder::new() + } +} + +impl<'a> CrewBuilder<'a, crew_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CrewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CrewBuilder<'a, S> +where + S: crew_state::State, + S::AddedAt: crew_state::IsUnset, +{ + /// Set the `addedAt` field (required) + pub fn added_at( + mut self, + value: impl Into, + ) -> CrewBuilder<'a, crew_state::SetAddedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + CrewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CrewBuilder<'a, S> +where + S: crew_state::State, + S::Member: crew_state::IsUnset, +{ + /// Set the `member` field (required) + pub fn member( + mut self, + value: impl Into>, + ) -> CrewBuilder<'a, crew_state::SetMember> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + CrewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CrewBuilder<'a, S> +where + S: crew_state::State, + S::Permissions: crew_state::IsUnset, +{ + /// Set the `permissions` field (required) + pub fn permissions( + mut self, + value: impl Into>>, + ) -> CrewBuilder<'a, crew_state::SetPermissions> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + CrewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CrewBuilder<'a, S> +where + S: crew_state::State, + S::Role: crew_state::IsUnset, +{ + /// Set the `role` field (required) + pub fn role( + mut self, + value: impl Into>, + ) -> CrewBuilder<'a, crew_state::SetRole> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + CrewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CrewBuilder<'a, S> +where + S: crew_state::State, + S::Member: crew_state::IsSet, + S::Permissions: crew_state::IsSet, + S::AddedAt: crew_state::IsSet, + S::Role: crew_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Crew<'a> { + Crew { + added_at: self.__unsafe_private_named.0.unwrap(), + member: self.__unsafe_private_named.1.unwrap(), + permissions: self.__unsafe_private_named.2.unwrap(), + role: self.__unsafe_private_named.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> Crew<'a> { + Crew { + added_at: self.__unsafe_private_named.0.unwrap(), + member: self.__unsafe_private_named.1.unwrap(), + permissions: self.__unsafe_private_named.2.unwrap(), + role: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Crew<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, CrewRecord>, + 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 CrewGetRecordOutput<'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: Crew<'a>, +} + +impl From> for Crew<'_> { + fn from(output: CrewGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Crew<'_> { + const NSID: &'static str = "io.atcr.hold.crew"; + type Record = CrewRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct CrewRecord; +impl jacquard_common::xrpc::XrpcResp for CrewRecord { + const NSID: &'static str = "io.atcr.hold.crew"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = CrewGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for CrewRecord { + const NSID: &'static str = "io.atcr.hold.crew"; + type Record = CrewRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Crew<'a> { + fn nsid() -> &'static str { + "io.atcr.hold.crew" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_atcr_hold_crew() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_io_atcr_hold_crew() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("io.atcr.hold.crew"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "Crew member in a hold's embedded PDS. Grants access permissions to push blobs to the hold. Stored in the hold's embedded PDS (one record per member).", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("any")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("member"), + ::jacquard_common::smol_str::SmolStr::new_static("role"), + ::jacquard_common::smol_str::SmolStr::new_static("permissions"), + ::jacquard_common::smol_str::SmolStr::new_static("addedAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("addedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "RFC3339 timestamp of when the member was added", + ), + ), + 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("member"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID of the crew member", + ), + ), + 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( + "permissions", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Specific permissions granted to this member", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("role"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Member's role in the hold", + ), + ), + 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 + }, + }), + }), + ); + map + }, + } +} diff --git a/crates/jacquard-api/src/io_atcr/hold/layer.rs b/crates/jacquard-api/src/io_atcr/hold/layer.rs new file mode 100644 index 00000000..16977ac4 --- /dev/null +++ b/crates/jacquard-api/src/io_atcr/hold/layer.rs @@ -0,0 +1,631 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: io.atcr.hold.layer +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Represents metadata about a container layer stored in the hold. Stored in the hold's embedded PDS for tracking and analytics. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Layer<'a> { + /// RFC3339 timestamp of when the layer was uploaded + pub created_at: jacquard_common::types::string::Datetime, + /// Layer digest (e.g., sha256:abc123...) + #[serde(borrow)] + pub digest: jacquard_common::CowStr<'a>, + /// Media type (e.g., application/vnd.oci.image.layer.v1.tar+gzip) + #[serde(borrow)] + pub media_type: jacquard_common::CowStr<'a>, + /// Repository this layer belongs to + #[serde(borrow)] + pub repository: jacquard_common::CowStr<'a>, + /// Size in bytes + pub size: i64, + /// DID of user who uploaded this layer + #[serde(borrow)] + pub user_did: jacquard_common::types::string::Did<'a>, + /// Handle of user (for display purposes) + #[serde(borrow)] + pub user_handle: jacquard_common::types::string::Handle<'a>, +} + +pub mod layer_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type CreatedAt; + type Digest; + type MediaType; + type Size; + type Repository; + type UserDid; + type UserHandle; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type CreatedAt = Unset; + type Digest = Unset; + type MediaType = Unset; + type Size = Unset; + type Repository = Unset; + type UserDid = Unset; + type UserHandle = 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 Digest = S::Digest; + type MediaType = S::MediaType; + type Size = S::Size; + type Repository = S::Repository; + type UserDid = S::UserDid; + type UserHandle = S::UserHandle; + } + ///State transition - sets the `digest` field to Set + pub struct SetDigest(PhantomData S>); + impl sealed::Sealed for SetDigest {} + impl State for SetDigest { + type CreatedAt = S::CreatedAt; + type Digest = Set; + type MediaType = S::MediaType; + type Size = S::Size; + type Repository = S::Repository; + type UserDid = S::UserDid; + type UserHandle = S::UserHandle; + } + ///State transition - sets the `media_type` field to Set + pub struct SetMediaType(PhantomData S>); + impl sealed::Sealed for SetMediaType {} + impl State for SetMediaType { + type CreatedAt = S::CreatedAt; + type Digest = S::Digest; + type MediaType = Set; + type Size = S::Size; + type Repository = S::Repository; + type UserDid = S::UserDid; + type UserHandle = S::UserHandle; + } + ///State transition - sets the `size` field to Set + pub struct SetSize(PhantomData S>); + impl sealed::Sealed for SetSize {} + impl State for SetSize { + type CreatedAt = S::CreatedAt; + type Digest = S::Digest; + type MediaType = S::MediaType; + type Size = Set; + type Repository = S::Repository; + type UserDid = S::UserDid; + type UserHandle = S::UserHandle; + } + ///State transition - sets the `repository` field to Set + pub struct SetRepository(PhantomData S>); + impl sealed::Sealed for SetRepository {} + impl State for SetRepository { + type CreatedAt = S::CreatedAt; + type Digest = S::Digest; + type MediaType = S::MediaType; + type Size = S::Size; + type Repository = Set; + type UserDid = S::UserDid; + type UserHandle = S::UserHandle; + } + ///State transition - sets the `user_did` field to Set + pub struct SetUserDid(PhantomData S>); + impl sealed::Sealed for SetUserDid {} + impl State for SetUserDid { + type CreatedAt = S::CreatedAt; + type Digest = S::Digest; + type MediaType = S::MediaType; + type Size = S::Size; + type Repository = S::Repository; + type UserDid = Set; + type UserHandle = S::UserHandle; + } + ///State transition - sets the `user_handle` field to Set + pub struct SetUserHandle(PhantomData S>); + impl sealed::Sealed for SetUserHandle {} + impl State for SetUserHandle { + type CreatedAt = S::CreatedAt; + type Digest = S::Digest; + type MediaType = S::MediaType; + type Size = S::Size; + type Repository = S::Repository; + type UserDid = S::UserDid; + type UserHandle = 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 `digest` field + pub struct digest(()); + ///Marker type for the `media_type` field + pub struct media_type(()); + ///Marker type for the `size` field + pub struct size(()); + ///Marker type for the `repository` field + pub struct repository(()); + ///Marker type for the `user_did` field + pub struct user_did(()); + ///Marker type for the `user_handle` field + pub struct user_handle(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LayerBuilder<'a, S: layer_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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Layer<'a> { + /// Create a new builder for this type + pub fn new() -> LayerBuilder<'a, layer_state::Empty> { + LayerBuilder::new() + } +} + +impl<'a> LayerBuilder<'a, layer_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LayerBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LayerBuilder<'a, S> +where + S: layer_state::State, + S::CreatedAt: layer_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> LayerBuilder<'a, layer_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LayerBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LayerBuilder<'a, S> +where + S: layer_state::State, + S::Digest: layer_state::IsUnset, +{ + /// Set the `digest` field (required) + pub fn digest( + mut self, + value: impl Into>, + ) -> LayerBuilder<'a, layer_state::SetDigest> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LayerBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LayerBuilder<'a, S> +where + S: layer_state::State, + S::MediaType: layer_state::IsUnset, +{ + /// Set the `mediaType` field (required) + pub fn media_type( + mut self, + value: impl Into>, + ) -> LayerBuilder<'a, layer_state::SetMediaType> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + LayerBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LayerBuilder<'a, S> +where + S: layer_state::State, + S::Repository: layer_state::IsUnset, +{ + /// Set the `repository` field (required) + pub fn repository( + mut self, + value: impl Into>, + ) -> LayerBuilder<'a, layer_state::SetRepository> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + LayerBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LayerBuilder<'a, S> +where + S: layer_state::State, + S::Size: layer_state::IsUnset, +{ + /// Set the `size` field (required) + pub fn size(mut self, value: impl Into) -> LayerBuilder<'a, layer_state::SetSize> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + LayerBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LayerBuilder<'a, S> +where + S: layer_state::State, + S::UserDid: layer_state::IsUnset, +{ + /// Set the `userDid` field (required) + pub fn user_did( + mut self, + value: impl Into>, + ) -> LayerBuilder<'a, layer_state::SetUserDid> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + LayerBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LayerBuilder<'a, S> +where + S: layer_state::State, + S::UserHandle: layer_state::IsUnset, +{ + /// Set the `userHandle` field (required) + pub fn user_handle( + mut self, + value: impl Into>, + ) -> LayerBuilder<'a, layer_state::SetUserHandle> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + LayerBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LayerBuilder<'a, S> +where + S: layer_state::State, + S::CreatedAt: layer_state::IsSet, + S::Digest: layer_state::IsSet, + S::MediaType: layer_state::IsSet, + S::Size: layer_state::IsSet, + S::Repository: layer_state::IsSet, + S::UserDid: layer_state::IsSet, + S::UserHandle: layer_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Layer<'a> { + Layer { + created_at: self.__unsafe_private_named.0.unwrap(), + digest: self.__unsafe_private_named.1.unwrap(), + media_type: self.__unsafe_private_named.2.unwrap(), + repository: self.__unsafe_private_named.3.unwrap(), + size: self.__unsafe_private_named.4.unwrap(), + user_did: self.__unsafe_private_named.5.unwrap(), + user_handle: self.__unsafe_private_named.6.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>, + >, + ) -> Layer<'a> { + Layer { + created_at: self.__unsafe_private_named.0.unwrap(), + digest: self.__unsafe_private_named.1.unwrap(), + media_type: self.__unsafe_private_named.2.unwrap(), + repository: self.__unsafe_private_named.3.unwrap(), + size: self.__unsafe_private_named.4.unwrap(), + user_did: self.__unsafe_private_named.5.unwrap(), + user_handle: self.__unsafe_private_named.6.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Layer<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, LayerRecord>, + 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 LayerGetRecordOutput<'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: Layer<'a>, +} + +impl From> for Layer<'_> { + fn from(output: LayerGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Layer<'_> { + const NSID: &'static str = "io.atcr.hold.layer"; + type Record = LayerRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct LayerRecord; +impl jacquard_common::xrpc::XrpcResp for LayerRecord { + const NSID: &'static str = "io.atcr.hold.layer"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = LayerGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for LayerRecord { + const NSID: &'static str = "io.atcr.hold.layer"; + type Record = LayerRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Layer<'a> { + fn nsid() -> &'static str { + "io.atcr.hold.layer" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_atcr_hold_layer() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_io_atcr_hold_layer() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("io.atcr.hold.layer"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "Represents metadata about a container layer stored in the hold. Stored in the hold's embedded PDS for tracking and analytics.", + ), + ), + 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("digest"), + ::jacquard_common::smol_str::SmolStr::new_static("size"), + ::jacquard_common::smol_str::SmolStr::new_static("mediaType"), + ::jacquard_common::smol_str::SmolStr::new_static("repository"), + ::jacquard_common::smol_str::SmolStr::new_static("userDid"), + ::jacquard_common::smol_str::SmolStr::new_static("userHandle"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "RFC3339 timestamp of when the layer was uploaded", + ), + ), + 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("digest"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Layer digest (e.g., sha256:abc123...)", + ), + ), + 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( + "mediaType", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Media type (e.g., application/vnd.oci.image.layer.v1.tar+gzip)", + ), + ), + 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( + "repository", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Repository this layer belongs to", + ), + ), + 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("size"), + ::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("userDid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID of user who uploaded this layer", + ), + ), + 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( + "userHandle", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Handle of user (for display purposes)", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, + ), + 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 + }, + } +} diff --git a/crates/jacquard-api/src/io_atcr/manifest.rs b/crates/jacquard-api/src/io_atcr/manifest.rs new file mode 100644 index 00000000..c63f880c --- /dev/null +++ b/crates/jacquard-api/src/io_atcr/manifest.rs @@ -0,0 +1,1724 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: io.atcr.manifest +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Reference to a blob stored in S3 or external storage +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct BlobReference<'a> { + /// Optional OCI annotation metadata. Map of string keys to string values. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub annotations: std::option::Option>, + /// Content digest (e.g., 'sha256:...') + #[serde(borrow)] + pub digest: jacquard_common::CowStr<'a>, + /// MIME type of the blob + #[serde(borrow)] + pub media_type: jacquard_common::CowStr<'a>, + /// Size in bytes + pub size: i64, + /// Optional direct URLs to blob (for BYOS) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub urls: std::option::Option>>, +} + +pub mod blob_reference_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 MediaType; + type Size; + type Digest; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type MediaType = Unset; + type Size = Unset; + type Digest = Unset; + } + ///State transition - sets the `media_type` field to Set + pub struct SetMediaType(PhantomData S>); + impl sealed::Sealed for SetMediaType {} + impl State for SetMediaType { + type MediaType = Set; + type Size = S::Size; + type Digest = S::Digest; + } + ///State transition - sets the `size` field to Set + pub struct SetSize(PhantomData S>); + impl sealed::Sealed for SetSize {} + impl State for SetSize { + type MediaType = S::MediaType; + type Size = Set; + type Digest = S::Digest; + } + ///State transition - sets the `digest` field to Set + pub struct SetDigest(PhantomData S>); + impl sealed::Sealed for SetDigest {} + impl State for SetDigest { + type MediaType = S::MediaType; + type Size = S::Size; + type Digest = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `media_type` field + pub struct media_type(()); + ///Marker type for the `size` field + pub struct size(()); + ///Marker type for the `digest` field + pub struct digest(()); + } +} + +/// Builder for constructing an instance of this type +pub struct BlobReferenceBuilder<'a, S: blob_reference_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>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> BlobReference<'a> { + /// Create a new builder for this type + pub fn new() -> BlobReferenceBuilder<'a, blob_reference_state::Empty> { + BlobReferenceBuilder::new() + } +} + +impl<'a> BlobReferenceBuilder<'a, blob_reference_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + BlobReferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: blob_reference_state::State> BlobReferenceBuilder<'a, S> { + /// Set the `annotations` field (optional) + pub fn annotations( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `annotations` field to an Option value (optional) + pub fn maybe_annotations( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> BlobReferenceBuilder<'a, S> +where + S: blob_reference_state::State, + S::Digest: blob_reference_state::IsUnset, +{ + /// Set the `digest` field (required) + pub fn digest( + mut self, + value: impl Into>, + ) -> BlobReferenceBuilder<'a, blob_reference_state::SetDigest> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + BlobReferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlobReferenceBuilder<'a, S> +where + S: blob_reference_state::State, + S::MediaType: blob_reference_state::IsUnset, +{ + /// Set the `mediaType` field (required) + pub fn media_type( + mut self, + value: impl Into>, + ) -> BlobReferenceBuilder<'a, blob_reference_state::SetMediaType> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + BlobReferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> BlobReferenceBuilder<'a, S> +where + S: blob_reference_state::State, + S::Size: blob_reference_state::IsUnset, +{ + /// Set the `size` field (required) + pub fn size( + mut self, + value: impl Into, + ) -> BlobReferenceBuilder<'a, blob_reference_state::SetSize> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + BlobReferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: blob_reference_state::State> BlobReferenceBuilder<'a, S> { + /// Set the `urls` field (optional) + pub fn urls( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `urls` field to an Option value (optional) + pub fn maybe_urls( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> BlobReferenceBuilder<'a, S> +where + S: blob_reference_state::State, + S::MediaType: blob_reference_state::IsSet, + S::Size: blob_reference_state::IsSet, + S::Digest: blob_reference_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> BlobReference<'a> { + BlobReference { + annotations: self.__unsafe_private_named.0, + digest: self.__unsafe_private_named.1.unwrap(), + media_type: self.__unsafe_private_named.2.unwrap(), + size: self.__unsafe_private_named.3.unwrap(), + urls: self.__unsafe_private_named.4, + 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>, + >, + ) -> BlobReference<'a> { + BlobReference { + annotations: self.__unsafe_private_named.0, + digest: self.__unsafe_private_named.1.unwrap(), + media_type: self.__unsafe_private_named.2.unwrap(), + size: self.__unsafe_private_named.3.unwrap(), + urls: self.__unsafe_private_named.4, + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_io_atcr_manifest() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("io.atcr.manifest"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blobReference"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Reference to a blob stored in S3 or external storage", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("mediaType"), + ::jacquard_common::smol_str::SmolStr::new_static("size"), + ::jacquard_common::smol_str::SmolStr::new_static("digest") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "annotations", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("digest"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Content digest (e.g., 'sha256:...')", + ), + ), + 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( + "mediaType", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "MIME type of the blob", + ), + ), + 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("size"), + ::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("urls"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Optional direct URLs to blob (for BYOS)", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + 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 container image manifest following OCI specification, stored in ATProto", + ), + ), + 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("repository"), + ::jacquard_common::smol_str::SmolStr::new_static("digest"), + ::jacquard_common::smol_str::SmolStr::new_static("mediaType"), + ::jacquard_common::smol_str::SmolStr::new_static("schemaVersion"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "annotations", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("config"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#blobReference", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Record creation timestamp", + ), + ), + 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("digest"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Content digest (e.g., 'sha256:abc123...')", + ), + ), + 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("holdDid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DID of the hold service where blobs are stored (e.g., 'did:web:hold01.atcr.io'). Primary reference for hold resolution.", + ), + ), + 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( + "holdEndpoint", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Hold service endpoint URL where blobs are stored. DEPRECATED: Use holdDid instead. Kept for backward compatibility.", + ), + ), + 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("layers"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Filesystem layers (for image manifests)", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#blobReference", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "manifestBlob", + ), + ::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( + "manifests", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Referenced manifests (for manifest lists/indexes)", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#manifestReference", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "mediaType", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static("OCI media type"), + ), + 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( + "repository", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Repository name (e.g., 'myapp'). Scoped to user's DID.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(255usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "schemaVersion", + ), + ::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("subject"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#blobReference", + ), + }), + ); + map + }, + }), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("manifestReference"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Reference to a manifest in a manifest list/index", + )), + required: Some(vec![ + ::jacquard_common::smol_str::SmolStr::new_static("mediaType"), + ::jacquard_common::smol_str::SmolStr::new_static("size"), + ::jacquard_common::smol_str::SmolStr::new_static("digest"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("annotations"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown( + ::jacquard_lexicon::lexicon::LexUnknown { description: None }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("digest"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( + "Content digest (e.g., 'sha256:...')", + )), + 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("mediaType"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( + "Media type of the referenced manifest", + )), + 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("platform"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#platform"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("size"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, + ), + ); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("platform"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Platform information describing OS and architecture", + )), + required: Some(vec![ + ::jacquard_common::smol_str::SmolStr::new_static("architecture"), + ::jacquard_common::smol_str::SmolStr::new_static("os"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("architecture"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( + "CPU architecture (e.g., 'amd64', 'arm64', 'arm')", + )), + 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("os"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( + "Operating system (e.g., 'linux', 'windows', 'darwin')", + )), + 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("osFeatures"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array( + ::jacquard_lexicon::lexicon::LexArray { + description: Some(::jacquard_common::CowStr::new_static( + "Optional OS features", + )), + items: ::jacquard_lexicon::lexicon::LexArrayItem::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, + }, + ), + min_length: None, + max_length: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("osVersion"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( + "Optional OS version", + )), + 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("variant"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( + "Optional CPU variant (e.g., 'v7' for ARM)", + )), + 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 + }, + }, + ), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BlobReference<'a> { + fn nsid() -> &'static str { + "io.atcr.manifest" + } + fn def_name() -> &'static str { + "blobReference" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_atcr_manifest() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// A container image manifest following OCI specification, stored in ATProto +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Manifest<'a> { + /// Optional OCI annotation metadata. Map of string keys to string values (e.g., org.opencontainers.image.title → 'My App'). + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub annotations: std::option::Option>, + /// Reference to image configuration blob + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub config: std::option::Option>, + /// Record creation timestamp + pub created_at: jacquard_common::types::string::Datetime, + /// Content digest (e.g., 'sha256:abc123...') + #[serde(borrow)] + pub digest: jacquard_common::CowStr<'a>, + /// DID of the hold service where blobs are stored (e.g., 'did:web:hold01.atcr.io'). Primary reference for hold resolution. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub hold_did: std::option::Option>, + /// Hold service endpoint URL where blobs are stored. DEPRECATED: Use holdDid instead. Kept for backward compatibility. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub hold_endpoint: std::option::Option>, + /// Filesystem layers (for image manifests) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub layers: std::option::Option>>, + /// The full OCI manifest stored as a blob in ATProto. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub manifest_blob: std::option::Option>, + /// Referenced manifests (for manifest lists/indexes) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub manifests: std::option::Option>>, + /// OCI media type + #[serde(borrow)] + pub media_type: jacquard_common::CowStr<'a>, + /// Repository name (e.g., 'myapp'). Scoped to user's DID. + #[serde(borrow)] + pub repository: jacquard_common::CowStr<'a>, + /// OCI schema version (typically 2) + pub schema_version: i64, + /// Optional reference to another manifest (for attestations, signatures) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subject: std::option::Option>, +} + +pub mod manifest_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type CreatedAt; + type SchemaVersion; + type Repository; + type MediaType; + type Digest; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type CreatedAt = Unset; + type SchemaVersion = Unset; + type Repository = Unset; + type MediaType = Unset; + type Digest = 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 SchemaVersion = S::SchemaVersion; + type Repository = S::Repository; + type MediaType = S::MediaType; + type Digest = S::Digest; + } + ///State transition - sets the `schema_version` field to Set + pub struct SetSchemaVersion(PhantomData S>); + impl sealed::Sealed for SetSchemaVersion {} + impl State for SetSchemaVersion { + type CreatedAt = S::CreatedAt; + type SchemaVersion = Set; + type Repository = S::Repository; + type MediaType = S::MediaType; + type Digest = S::Digest; + } + ///State transition - sets the `repository` field to Set + pub struct SetRepository(PhantomData S>); + impl sealed::Sealed for SetRepository {} + impl State for SetRepository { + type CreatedAt = S::CreatedAt; + type SchemaVersion = S::SchemaVersion; + type Repository = Set; + type MediaType = S::MediaType; + type Digest = S::Digest; + } + ///State transition - sets the `media_type` field to Set + pub struct SetMediaType(PhantomData S>); + impl sealed::Sealed for SetMediaType {} + impl State for SetMediaType { + type CreatedAt = S::CreatedAt; + type SchemaVersion = S::SchemaVersion; + type Repository = S::Repository; + type MediaType = Set; + type Digest = S::Digest; + } + ///State transition - sets the `digest` field to Set + pub struct SetDigest(PhantomData S>); + impl sealed::Sealed for SetDigest {} + impl State for SetDigest { + type CreatedAt = S::CreatedAt; + type SchemaVersion = S::SchemaVersion; + type Repository = S::Repository; + type MediaType = S::MediaType; + type Digest = 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 `schema_version` field + pub struct schema_version(()); + ///Marker type for the `repository` field + pub struct repository(()); + ///Marker type for the `media_type` field + pub struct media_type(()); + ///Marker type for the `digest` field + pub struct digest(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ManifestBuilder<'a, S: manifest_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, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Manifest<'a> { + /// Create a new builder for this type + pub fn new() -> ManifestBuilder<'a, manifest_state::Empty> { + ManifestBuilder::new() + } +} + +impl<'a> ManifestBuilder<'a, manifest_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ManifestBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, None, None, None, None, None, None, None, None, None, None, None, None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { + /// Set the `annotations` field (optional) + pub fn annotations( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `annotations` field to an Option value (optional) + pub fn maybe_annotations( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { + /// Set the `config` field (optional) + pub fn config( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `config` field to an Option value (optional) + pub fn maybe_config( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> ManifestBuilder<'a, S> +where + S: manifest_state::State, + S::CreatedAt: manifest_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ManifestBuilder<'a, manifest_state::SetCreatedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ManifestBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ManifestBuilder<'a, S> +where + S: manifest_state::State, + S::Digest: manifest_state::IsUnset, +{ + /// Set the `digest` field (required) + pub fn digest( + mut self, + value: impl Into>, + ) -> ManifestBuilder<'a, manifest_state::SetDigest> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ManifestBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { + /// Set the `holdDid` field (optional) + pub fn hold_did( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `holdDid` field to an Option value (optional) + pub fn maybe_hold_did( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { + /// Set the `holdEndpoint` field (optional) + pub fn hold_endpoint( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `holdEndpoint` field to an Option value (optional) + pub fn maybe_hold_endpoint( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { + /// Set the `layers` field (optional) + pub fn layers( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `layers` field to an Option value (optional) + pub fn maybe_layers( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { + /// Set the `manifestBlob` field (optional) + pub fn manifest_blob( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `manifestBlob` field to an Option value (optional) + pub fn maybe_manifest_blob( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { + /// Set the `manifests` field (optional) + pub fn manifests( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `manifests` field to an Option value (optional) + pub fn maybe_manifests( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S> ManifestBuilder<'a, S> +where + S: manifest_state::State, + S::MediaType: manifest_state::IsUnset, +{ + /// Set the `mediaType` field (required) + pub fn media_type( + mut self, + value: impl Into>, + ) -> ManifestBuilder<'a, manifest_state::SetMediaType> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + ManifestBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ManifestBuilder<'a, S> +where + S: manifest_state::State, + S::Repository: manifest_state::IsUnset, +{ + /// Set the `repository` field (required) + pub fn repository( + mut self, + value: impl Into>, + ) -> ManifestBuilder<'a, manifest_state::SetRepository> { + self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into()); + ManifestBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ManifestBuilder<'a, S> +where + S: manifest_state::State, + S::SchemaVersion: manifest_state::IsUnset, +{ + /// Set the `schemaVersion` field (required) + pub fn schema_version( + mut self, + value: impl Into, + ) -> ManifestBuilder<'a, manifest_state::SetSchemaVersion> { + self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into()); + ManifestBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { + /// Set the `subject` field (optional) + pub fn subject( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.12 = value.into(); + self + } + /// Set the `subject` field to an Option value (optional) + pub fn maybe_subject( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.12 = value; + self + } +} + +impl<'a, S> ManifestBuilder<'a, S> +where + S: manifest_state::State, + S::CreatedAt: manifest_state::IsSet, + S::SchemaVersion: manifest_state::IsSet, + S::Repository: manifest_state::IsSet, + S::MediaType: manifest_state::IsSet, + S::Digest: manifest_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Manifest<'a> { + Manifest { + annotations: self.__unsafe_private_named.0, + config: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2.unwrap(), + digest: self.__unsafe_private_named.3.unwrap(), + hold_did: self.__unsafe_private_named.4, + hold_endpoint: self.__unsafe_private_named.5, + layers: self.__unsafe_private_named.6, + manifest_blob: self.__unsafe_private_named.7, + manifests: self.__unsafe_private_named.8, + media_type: self.__unsafe_private_named.9.unwrap(), + repository: self.__unsafe_private_named.10.unwrap(), + schema_version: self.__unsafe_private_named.11.unwrap(), + subject: self.__unsafe_private_named.12, + 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>, + >, + ) -> Manifest<'a> { + Manifest { + annotations: self.__unsafe_private_named.0, + config: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2.unwrap(), + digest: self.__unsafe_private_named.3.unwrap(), + hold_did: self.__unsafe_private_named.4, + hold_endpoint: self.__unsafe_private_named.5, + layers: self.__unsafe_private_named.6, + manifest_blob: self.__unsafe_private_named.7, + manifests: self.__unsafe_private_named.8, + media_type: self.__unsafe_private_named.9.unwrap(), + repository: self.__unsafe_private_named.10.unwrap(), + schema_version: self.__unsafe_private_named.11.unwrap(), + subject: self.__unsafe_private_named.12, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Manifest<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ManifestRecord>, + 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 ManifestGetRecordOutput<'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: Manifest<'a>, +} + +impl From> for Manifest<'_> { + fn from(output: ManifestGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Manifest<'_> { + const NSID: &'static str = "io.atcr.manifest"; + type Record = ManifestRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ManifestRecord; +impl jacquard_common::xrpc::XrpcResp for ManifestRecord { + const NSID: &'static str = "io.atcr.manifest"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ManifestGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ManifestRecord { + const NSID: &'static str = "io.atcr.manifest"; + type Record = ManifestRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Manifest<'a> { + fn nsid() -> &'static str { + "io.atcr.manifest" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_atcr_manifest() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.repository; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 255usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field("repository"), + max: 255usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +/// Reference to a manifest in a manifest list/index +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct ManifestReference<'a> { + /// Optional OCI annotation metadata. Map of string keys to string values. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub annotations: std::option::Option>, + /// Content digest (e.g., 'sha256:...') + #[serde(borrow)] + pub digest: jacquard_common::CowStr<'a>, + /// Media type of the referenced manifest + #[serde(borrow)] + pub media_type: jacquard_common::CowStr<'a>, + /// Platform information for this manifest + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub platform: std::option::Option>, + /// Size in bytes + pub size: i64, +} + +pub mod manifest_reference_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Digest; + type Size; + type MediaType; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Digest = Unset; + type Size = Unset; + type MediaType = Unset; + } + ///State transition - sets the `digest` field to Set + pub struct SetDigest(PhantomData S>); + impl sealed::Sealed for SetDigest {} + impl State for SetDigest { + type Digest = Set; + type Size = S::Size; + type MediaType = S::MediaType; + } + ///State transition - sets the `size` field to Set + pub struct SetSize(PhantomData S>); + impl sealed::Sealed for SetSize {} + impl State for SetSize { + type Digest = S::Digest; + type Size = Set; + type MediaType = S::MediaType; + } + ///State transition - sets the `media_type` field to Set + pub struct SetMediaType(PhantomData S>); + impl sealed::Sealed for SetMediaType {} + impl State for SetMediaType { + type Digest = S::Digest; + type Size = S::Size; + type MediaType = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `digest` field + pub struct digest(()); + ///Marker type for the `size` field + pub struct size(()); + ///Marker type for the `media_type` field + pub struct media_type(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ManifestReferenceBuilder<'a, S: manifest_reference_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, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ManifestReference<'a> { + /// Create a new builder for this type + pub fn new() -> ManifestReferenceBuilder<'a, manifest_reference_state::Empty> { + ManifestReferenceBuilder::new() + } +} + +impl<'a> ManifestReferenceBuilder<'a, manifest_reference_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ManifestReferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: manifest_reference_state::State> ManifestReferenceBuilder<'a, S> { + /// Set the `annotations` field (optional) + pub fn annotations( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `annotations` field to an Option value (optional) + pub fn maybe_annotations( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> ManifestReferenceBuilder<'a, S> +where + S: manifest_reference_state::State, + S::Digest: manifest_reference_state::IsUnset, +{ + /// Set the `digest` field (required) + pub fn digest( + mut self, + value: impl Into>, + ) -> ManifestReferenceBuilder<'a, manifest_reference_state::SetDigest> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ManifestReferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ManifestReferenceBuilder<'a, S> +where + S: manifest_reference_state::State, + S::MediaType: manifest_reference_state::IsUnset, +{ + /// Set the `mediaType` field (required) + pub fn media_type( + mut self, + value: impl Into>, + ) -> ManifestReferenceBuilder<'a, manifest_reference_state::SetMediaType> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ManifestReferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: manifest_reference_state::State> ManifestReferenceBuilder<'a, S> { + /// Set the `platform` field (optional) + pub fn platform( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `platform` field to an Option value (optional) + pub fn maybe_platform(mut self, value: Option>) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> ManifestReferenceBuilder<'a, S> +where + S: manifest_reference_state::State, + S::Size: manifest_reference_state::IsUnset, +{ + /// Set the `size` field (required) + pub fn size( + mut self, + value: impl Into, + ) -> ManifestReferenceBuilder<'a, manifest_reference_state::SetSize> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + ManifestReferenceBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ManifestReferenceBuilder<'a, S> +where + S: manifest_reference_state::State, + S::Digest: manifest_reference_state::IsSet, + S::Size: manifest_reference_state::IsSet, + S::MediaType: manifest_reference_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ManifestReference<'a> { + ManifestReference { + annotations: self.__unsafe_private_named.0, + digest: self.__unsafe_private_named.1.unwrap(), + media_type: self.__unsafe_private_named.2.unwrap(), + platform: self.__unsafe_private_named.3, + size: self.__unsafe_private_named.4.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>, + >, + ) -> ManifestReference<'a> { + ManifestReference { + annotations: self.__unsafe_private_named.0, + digest: self.__unsafe_private_named.1.unwrap(), + media_type: self.__unsafe_private_named.2.unwrap(), + platform: self.__unsafe_private_named.3, + size: self.__unsafe_private_named.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ManifestReference<'a> { + fn nsid() -> &'static str { + "io.atcr.manifest" + } + fn def_name() -> &'static str { + "manifestReference" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_atcr_manifest() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Platform information describing OS and architecture +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct Platform<'a> { + /// CPU architecture (e.g., 'amd64', 'arm64', 'arm') + #[serde(borrow)] + pub architecture: jacquard_common::CowStr<'a>, + /// Operating system (e.g., 'linux', 'windows', 'darwin') + #[serde(borrow)] + pub os: jacquard_common::CowStr<'a>, + /// Optional OS features + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub os_features: std::option::Option>>, + /// Optional OS version + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub os_version: std::option::Option>, + /// Optional CPU variant (e.g., 'v7' for ARM) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub variant: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Platform<'a> { + fn nsid() -> &'static str { + "io.atcr.manifest" + } + fn def_name() -> &'static str { + "platform" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_atcr_manifest() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} diff --git a/crates/jacquard-api/src/io_atcr/sailor.rs b/crates/jacquard-api/src/io_atcr/sailor.rs new file mode 100644 index 00000000..a86e4556 --- /dev/null +++ b/crates/jacquard-api/src/io_atcr/sailor.rs @@ -0,0 +1,7 @@ +// @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 profile; +pub mod star; diff --git a/crates/jacquard-api/src/io_atcr/sailor/profile.rs b/crates/jacquard-api/src/io_atcr/sailor/profile.rs new file mode 100644 index 00000000..b0f58f83 --- /dev/null +++ b/crates/jacquard-api/src/io_atcr/sailor/profile.rs @@ -0,0 +1,352 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: io.atcr.sailor.profile +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// User profile for ATCR registry. Stores preferences like default hold for blob storage. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Profile<'a> { + /// Profile creation timestamp + pub created_at: jacquard_common::types::string::Datetime, + /// Default hold endpoint for blob storage. If null, user has opted out of defaults. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub default_hold: std::option::Option>, + /// Profile last updated timestamp + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub updated_at: std::option::Option, +} + +pub mod profile_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + 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; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ProfileBuilder<'a, S: profile_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> Profile<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileBuilder<'a, profile_state::Empty> { + ProfileBuilder::new() + } +} + +impl<'a> ProfileBuilder<'a, profile_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ProfileBuilder<'a, S> +where + S: profile_state::State, + S::CreatedAt: profile_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ProfileBuilder<'a, profile_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `defaultHold` field (optional) + pub fn default_hold( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `defaultHold` field to an Option value (optional) + pub fn maybe_default_hold( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { + /// Set the `updatedAt` field (optional) + pub fn updated_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `updatedAt` field to an Option value (optional) + pub fn maybe_updated_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ProfileBuilder<'a, S> +where + S: profile_state::State, + S::CreatedAt: profile_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Profile<'a> { + Profile { + created_at: self.__unsafe_private_named.0.unwrap(), + default_hold: self.__unsafe_private_named.1, + updated_at: self.__unsafe_private_named.2, + 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>, + >, + ) -> Profile<'a> { + Profile { + created_at: self.__unsafe_private_named.0.unwrap(), + default_hold: self.__unsafe_private_named.1, + updated_at: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> Profile<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ProfileRecord>, + 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 ProfileGetRecordOutput<'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: Profile<'a>, +} + +impl From> for Profile<'_> { + fn from(output: ProfileGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Profile<'_> { + const NSID: &'static str = "io.atcr.sailor.profile"; + type Record = ProfileRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ProfileRecord; +impl jacquard_common::xrpc::XrpcResp for ProfileRecord { + const NSID: &'static str = "io.atcr.sailor.profile"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ProfileGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ProfileRecord { + const NSID: &'static str = "io.atcr.sailor.profile"; + type Record = ProfileRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Profile<'a> { + fn nsid() -> &'static str { + "io.atcr.sailor.profile" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_atcr_sailor_profile() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_io_atcr_sailor_profile() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("io.atcr.sailor.profile"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "User profile for ATCR registry. Stores preferences like default hold for blob storage.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("literal:self")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Profile creation timestamp", + ), + ), + 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( + "defaultHold", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Default hold endpoint for blob storage. If null, user has opted out of defaults.", + ), + ), + 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( + "updatedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Profile last updated timestamp", + ), + ), + 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 + }, + } +} diff --git a/crates/jacquard-api/src/io_atcr/sailor/star.rs b/crates/jacquard-api/src/io_atcr/sailor/star.rs new file mode 100644 index 00000000..75bb564f --- /dev/null +++ b/crates/jacquard-api/src/io_atcr/sailor/star.rs @@ -0,0 +1,544 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: io.atcr.sailor.star +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A star (like) on a container image repository. Stored in the starrer's PDS, similar to Bluesky likes. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Star<'a> { + /// Star creation timestamp + pub created_at: jacquard_common::types::string::Datetime, + /// The repository being starred + #[serde(borrow)] + pub subject: crate::io_atcr::sailor::star::Subject<'a>, +} + +pub mod star_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Subject; + type CreatedAt; + } + /// 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; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type CreatedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct StarBuilder<'a, S: star_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Star<'a> { + /// Create a new builder for this type + pub fn new() -> StarBuilder<'a, star_state::Empty> { + StarBuilder::new() + } +} + +impl<'a> StarBuilder<'a, star_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + StarBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarBuilder<'a, S> +where + S: star_state::State, + S::CreatedAt: star_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> StarBuilder<'a, star_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + StarBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarBuilder<'a, S> +where + S: star_state::State, + S::Subject: star_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> StarBuilder<'a, star_state::SetSubject> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + StarBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> StarBuilder<'a, S> +where + S: star_state::State, + S::Subject: star_state::IsSet, + S::CreatedAt: star_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Star<'a> { + Star { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.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>, + >, + ) -> Star<'a> { + Star { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Star<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, StarRecord>, + 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 StarGetRecordOutput<'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: Star<'a>, +} + +impl From> for Star<'_> { + fn from(output: StarGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Star<'_> { + const NSID: &'static str = "io.atcr.sailor.star"; + type Record = StarRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct StarRecord; +impl jacquard_common::xrpc::XrpcResp for StarRecord { + const NSID: &'static str = "io.atcr.sailor.star"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = StarGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for StarRecord { + const NSID: &'static str = "io.atcr.sailor.star"; + type Record = StarRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Star<'a> { + fn nsid() -> &'static str { + "io.atcr.sailor.star" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_atcr_sailor_star() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_io_atcr_sailor_star() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("io.atcr.sailor.star"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "A star (like) on a container image repository. Stored in the starrer's PDS, similar to Bluesky likes.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("any")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Star creation timestamp", + ), + ), + 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("subject"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#subject"), + }), + ); + map + }, + }), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Reference to a repository owned by a user", + )), + required: Some(vec![ + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_common::smol_str::SmolStr::new_static("repository"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("did"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( + "DID of the repository owner", + )), + 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("repository"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( + "Repository name (e.g., 'myapp')", + )), + format: None, + default: None, + min_length: None, + max_length: Some(255usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map + }, + }, + ), + ); + map + }, + } +} + +/// Reference to a repository owned by a user +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Subject<'a> { + /// DID of the repository owner + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// Repository name (e.g., 'myapp') + #[serde(borrow)] + pub repository: jacquard_common::CowStr<'a>, +} + +pub mod subject_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Repository; + type Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Repository = Unset; + type Did = Unset; + } + ///State transition - sets the `repository` field to Set + pub struct SetRepository(PhantomData S>); + impl sealed::Sealed for SetRepository {} + impl State for SetRepository { + type Repository = 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 Repository = S::Repository; + type Did = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `repository` field + pub struct repository(()); + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SubjectBuilder<'a, S: subject_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Subject<'a> { + /// Create a new builder for this type + pub fn new() -> SubjectBuilder<'a, subject_state::Empty> { + SubjectBuilder::new() + } +} + +impl<'a> SubjectBuilder<'a, subject_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SubjectBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubjectBuilder<'a, S> +where + S: subject_state::State, + S::Did: subject_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> SubjectBuilder<'a, subject_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SubjectBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubjectBuilder<'a, S> +where + S: subject_state::State, + S::Repository: subject_state::IsUnset, +{ + /// Set the `repository` field (required) + pub fn repository( + mut self, + value: impl Into>, + ) -> SubjectBuilder<'a, subject_state::SetRepository> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SubjectBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubjectBuilder<'a, S> +where + S: subject_state::State, + S::Repository: subject_state::IsSet, + S::Did: subject_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Subject<'a> { + Subject { + did: self.__unsafe_private_named.0.unwrap(), + repository: self.__unsafe_private_named.1.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>, + >, + ) -> Subject<'a> { + Subject { + did: self.__unsafe_private_named.0.unwrap(), + repository: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Subject<'a> { + fn nsid() -> &'static str { + "io.atcr.sailor.star" + } + fn def_name() -> &'static str { + "subject" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_atcr_sailor_star() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.repository; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 255usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field("repository"), + max: 255usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} diff --git a/crates/jacquard-api/src/io_atcr/tag.rs b/crates/jacquard-api/src/io_atcr/tag.rs new file mode 100644 index 00000000..90f2b27a --- /dev/null +++ b/crates/jacquard-api/src/io_atcr/tag.rs @@ -0,0 +1,490 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: io.atcr.tag +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A named tag pointing to a specific manifest digest +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Tag<'a> { + /// Tag creation timestamp + pub created_at: jacquard_common::types::string::Datetime, + /// AT-URI of the manifest this tag points to (e.g., 'at://did:plc:xyz/io.atcr.manifest/abc123'). Preferred over manifestDigest for new records. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub manifest: std::option::Option>, + /// DEPRECATED: Digest of the manifest (e.g., 'sha256:...'). Kept for backward compatibility with old records. New records should use 'manifest' field instead. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub manifest_digest: std::option::Option>, + /// Repository name (e.g., 'myapp'). Scoped to user's DID. + #[serde(borrow)] + pub repository: jacquard_common::CowStr<'a>, + /// Tag name (e.g., 'latest', 'v1.0.0', '12-slim') + #[serde(borrow)] + pub tag: jacquard_common::CowStr<'a>, +} + +pub mod tag_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Repository; + type CreatedAt; + type Tag; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Repository = Unset; + type CreatedAt = Unset; + type Tag = Unset; + } + ///State transition - sets the `repository` field to Set + pub struct SetRepository(PhantomData S>); + impl sealed::Sealed for SetRepository {} + impl State for SetRepository { + type Repository = 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 Repository = S::Repository; + 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 Repository = S::Repository; + type CreatedAt = S::CreatedAt; + type Tag = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `repository` field + pub struct repository(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `tag` field + pub struct tag(()); + } +} + +/// Builder for constructing an instance of this type +pub struct TagBuilder<'a, S: tag_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>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Tag<'a> { + /// Create a new builder for this type + pub fn new() -> TagBuilder<'a, tag_state::Empty> { + TagBuilder::new() + } +} + +impl<'a> TagBuilder<'a, tag_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + TagBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TagBuilder<'a, S> +where + S: tag_state::State, + S::CreatedAt: tag_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> TagBuilder<'a, tag_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + TagBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: tag_state::State> TagBuilder<'a, S> { + /// Set the `manifest` field (optional) + pub fn manifest( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `manifest` field to an Option value (optional) + pub fn maybe_manifest( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: tag_state::State> TagBuilder<'a, S> { + /// Set the `manifestDigest` field (optional) + pub fn manifest_digest( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `manifestDigest` field to an Option value (optional) + pub fn maybe_manifest_digest(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> TagBuilder<'a, S> +where + S: tag_state::State, + S::Repository: tag_state::IsUnset, +{ + /// Set the `repository` field (required) + pub fn repository( + mut self, + value: impl Into>, + ) -> TagBuilder<'a, tag_state::SetRepository> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + TagBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TagBuilder<'a, S> +where + S: tag_state::State, + S::Tag: tag_state::IsUnset, +{ + /// Set the `tag` field (required) + pub fn tag( + mut self, + value: impl Into>, + ) -> TagBuilder<'a, tag_state::SetTag> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + TagBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TagBuilder<'a, S> +where + S: tag_state::State, + S::Repository: tag_state::IsSet, + S::CreatedAt: tag_state::IsSet, + S::Tag: tag_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Tag<'a> { + Tag { + created_at: self.__unsafe_private_named.0.unwrap(), + manifest: self.__unsafe_private_named.1, + manifest_digest: self.__unsafe_private_named.2, + repository: self.__unsafe_private_named.3.unwrap(), + tag: self.__unsafe_private_named.4.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>, + >, + ) -> Tag<'a> { + Tag { + created_at: self.__unsafe_private_named.0.unwrap(), + manifest: self.__unsafe_private_named.1, + manifest_digest: self.__unsafe_private_named.2, + repository: self.__unsafe_private_named.3.unwrap(), + tag: self.__unsafe_private_named.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Tag<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, TagRecord>, + 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 TagGetRecordOutput<'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: Tag<'a>, +} + +impl From> for Tag<'_> { + fn from(output: TagGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Tag<'_> { + const NSID: &'static str = "io.atcr.tag"; + type Record = TagRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct TagRecord; +impl jacquard_common::xrpc::XrpcResp for TagRecord { + const NSID: &'static str = "io.atcr.tag"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = TagGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for TagRecord { + const NSID: &'static str = "io.atcr.tag"; + type Record = TagRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Tag<'a> { + fn nsid() -> &'static str { + "io.atcr.tag" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_atcr_tag() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.repository; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 255usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field("repository"), + max: 255usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.tag; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 128usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field("tag"), + max: 128usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +fn lexicon_doc_io_atcr_tag() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("io.atcr.tag"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "A named tag pointing to a specific manifest digest", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("any")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("repository"), + ::jacquard_common::smol_str::SmolStr::new_static("tag"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Tag creation timestamp", + ), + ), + 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( + "manifest", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "AT-URI of the manifest this tag points to (e.g., 'at://did:plc:xyz/io.atcr.manifest/abc123'). Preferred over manifestDigest for new records.", + ), + ), + 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( + "manifestDigest", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "DEPRECATED: Digest of the manifest (e.g., 'sha256:...'). Kept for backward compatibility with old records. New records should use 'manifest' field instead.", + ), + ), + 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( + "repository", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Repository name (e.g., 'myapp'). Scoped to user's DID.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(255usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("tag"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Tag name (e.g., 'latest', 'v1.0.0', '12-slim')", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(128usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + }), + ); + map + }, + } +} diff --git a/crates/jacquard-api/src/io_whiteside.rs b/crates/jacquard-api/src/io_whiteside.rs new file mode 100644 index 00000000..62c01f1a --- /dev/null +++ b/crates/jacquard-api/src/io_whiteside.rs @@ -0,0 +1,7 @@ +// @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 linked_account; +pub mod profile; diff --git a/crates/jacquard-api/src/io_whiteside/linked_account.rs b/crates/jacquard-api/src/io_whiteside/linked_account.rs new file mode 100644 index 00000000..dab31700 --- /dev/null +++ b/crates/jacquard-api/src/io_whiteside/linked_account.rs @@ -0,0 +1,372 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: io.whiteside.linkedAccount +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// A linked account record containing external account information +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct LinkedAccount<'a> { + /// Icon identifier or URL for the linked account + #[serde(borrow)] + pub icon: jacquard_common::CowStr<'a>, + /// URL to the linked account + #[serde(borrow)] + pub link: jacquard_common::types::string::Uri<'a>, + /// Display name of the linked account + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +pub mod linked_account_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Name; + type Link; + type Icon; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Name = Unset; + type Link = Unset; + type Icon = 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 Link = S::Link; + type Icon = S::Icon; + } + ///State transition - sets the `link` field to Set + pub struct SetLink(PhantomData S>); + impl sealed::Sealed for SetLink {} + impl State for SetLink { + type Name = S::Name; + type Link = Set; + type Icon = S::Icon; + } + ///State transition - sets the `icon` field to Set + pub struct SetIcon(PhantomData S>); + impl sealed::Sealed for SetIcon {} + impl State for SetIcon { + type Name = S::Name; + type Link = S::Link; + type Icon = 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 `link` field + pub struct link(()); + ///Marker type for the `icon` field + pub struct icon(()); + } +} + +/// Builder for constructing an instance of this type +pub struct LinkedAccountBuilder<'a, S: linked_account_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> LinkedAccount<'a> { + /// Create a new builder for this type + pub fn new() -> LinkedAccountBuilder<'a, linked_account_state::Empty> { + LinkedAccountBuilder::new() + } +} + +impl<'a> LinkedAccountBuilder<'a, linked_account_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + LinkedAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LinkedAccountBuilder<'a, S> +where + S: linked_account_state::State, + S::Icon: linked_account_state::IsUnset, +{ + /// Set the `icon` field (required) + pub fn icon( + mut self, + value: impl Into>, + ) -> LinkedAccountBuilder<'a, linked_account_state::SetIcon> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + LinkedAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LinkedAccountBuilder<'a, S> +where + S: linked_account_state::State, + S::Link: linked_account_state::IsUnset, +{ + /// Set the `link` field (required) + pub fn link( + mut self, + value: impl Into>, + ) -> LinkedAccountBuilder<'a, linked_account_state::SetLink> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + LinkedAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LinkedAccountBuilder<'a, S> +where + S: linked_account_state::State, + S::Name: linked_account_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> LinkedAccountBuilder<'a, linked_account_state::SetName> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + LinkedAccountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> LinkedAccountBuilder<'a, S> +where + S: linked_account_state::State, + S::Name: linked_account_state::IsSet, + S::Link: linked_account_state::IsSet, + S::Icon: linked_account_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> LinkedAccount<'a> { + LinkedAccount { + icon: self.__unsafe_private_named.0.unwrap(), + link: self.__unsafe_private_named.1.unwrap(), + name: self.__unsafe_private_named.2.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>, + >, + ) -> LinkedAccount<'a> { + LinkedAccount { + icon: self.__unsafe_private_named.0.unwrap(), + link: self.__unsafe_private_named.1.unwrap(), + name: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> LinkedAccount<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, LinkedAccountRecord>, + 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 LinkedAccountGetRecordOutput<'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: LinkedAccount<'a>, +} + +impl From> for LinkedAccount<'_> { + fn from(output: LinkedAccountGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for LinkedAccount<'_> { + const NSID: &'static str = "io.whiteside.linkedAccount"; + type Record = LinkedAccountRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct LinkedAccountRecord; +impl jacquard_common::xrpc::XrpcResp for LinkedAccountRecord { + const NSID: &'static str = "io.whiteside.linkedAccount"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = LinkedAccountGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for LinkedAccountRecord { + const NSID: &'static str = "io.whiteside.linkedAccount"; + type Record = LinkedAccountRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LinkedAccount<'a> { + fn nsid() -> &'static str { + "io.whiteside.linkedAccount" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_whiteside_linkedAccount() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +fn lexicon_doc_io_whiteside_linkedAccount() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("io.whiteside.linkedAccount"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "A linked account record containing external account information", + ), + ), + key: None, + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("icon"), + ::jacquard_common::smol_str::SmolStr::new_static("name"), + ::jacquard_common::smol_str::SmolStr::new_static("link") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("icon"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Icon identifier or URL for the linked account", + ), + ), + 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("link"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "URL to the linked account", + ), + ), + 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("name"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Display name of the linked account", + ), + ), + 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 + }, + }), + }), + ); + map + }, + } +} diff --git a/crates/jacquard-api/src/io_whiteside/profile.rs b/crates/jacquard-api/src/io_whiteside/profile.rs new file mode 100644 index 00000000..dd22fd33 --- /dev/null +++ b/crates/jacquard-api/src/io_whiteside/profile.rs @@ -0,0 +1,395 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: io.whiteside.profile +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Profile information (bio, skills, etc.) +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct Profile<'a> { + /// Profile content in plain text or markdown format + #[serde(borrow)] + pub content: jacquard_common::CowStr<'a>, + /// Profile section heading (e.g. 'Hey, I'm John') + #[serde(borrow)] + pub heading: jacquard_common::CowStr<'a>, + /// Last update timestamp in ISO 8601 format + pub updated_at: jacquard_common::types::string::Datetime, +} + +pub mod profile_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[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 Heading; + type UpdatedAt; + type Content; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Heading = Unset; + type UpdatedAt = Unset; + type Content = Unset; + } + ///State transition - sets the `heading` field to Set + pub struct SetHeading(PhantomData S>); + impl sealed::Sealed for SetHeading {} + impl State for SetHeading { + type Heading = Set; + type UpdatedAt = S::UpdatedAt; + type Content = S::Content; + } + ///State transition - sets the `updated_at` field to Set + pub struct SetUpdatedAt(PhantomData S>); + impl sealed::Sealed for SetUpdatedAt {} + impl State for SetUpdatedAt { + type Heading = S::Heading; + type UpdatedAt = 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 Heading = S::Heading; + type UpdatedAt = S::UpdatedAt; + type Content = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `heading` field + pub struct heading(()); + ///Marker type for the `updated_at` field + pub struct updated_at(()); + ///Marker type for the `content` field + pub struct content(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ProfileBuilder<'a, S: profile_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> Profile<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileBuilder<'a, profile_state::Empty> { + ProfileBuilder::new() + } +} + +impl<'a> ProfileBuilder<'a, profile_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ProfileBuilder<'a, S> +where + S: profile_state::State, + S::Content: profile_state::IsUnset, +{ + /// Set the `content` field (required) + pub fn content( + mut self, + value: impl Into>, + ) -> ProfileBuilder<'a, profile_state::SetContent> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ProfileBuilder<'a, S> +where + S: profile_state::State, + S::Heading: profile_state::IsUnset, +{ + /// Set the `heading` field (required) + pub fn heading( + mut self, + value: impl Into>, + ) -> ProfileBuilder<'a, profile_state::SetHeading> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ProfileBuilder<'a, S> +where + S: profile_state::State, + S::UpdatedAt: profile_state::IsUnset, +{ + /// Set the `updatedAt` field (required) + pub fn updated_at( + mut self, + value: impl Into, + ) -> ProfileBuilder<'a, profile_state::SetUpdatedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ProfileBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ProfileBuilder<'a, S> +where + S: profile_state::State, + S::Heading: profile_state::IsSet, + S::UpdatedAt: profile_state::IsSet, + S::Content: profile_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Profile<'a> { + Profile { + content: self.__unsafe_private_named.0.unwrap(), + heading: self.__unsafe_private_named.1.unwrap(), + updated_at: self.__unsafe_private_named.2.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>, + >, + ) -> Profile<'a> { + Profile { + content: self.__unsafe_private_named.0.unwrap(), + heading: self.__unsafe_private_named.1.unwrap(), + updated_at: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Profile<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, ProfileRecord>, + 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 ProfileGetRecordOutput<'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: Profile<'a>, +} + +impl From> for Profile<'_> { + fn from(output: ProfileGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Profile<'_> { + const NSID: &'static str = "io.whiteside.profile"; + type Record = ProfileRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct ProfileRecord; +impl jacquard_common::xrpc::XrpcResp for ProfileRecord { + const NSID: &'static str = "io.whiteside.profile"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ProfileGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for ProfileRecord { + const NSID: &'static str = "io.whiteside.profile"; + type Record = ProfileRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Profile<'a> { + fn nsid() -> &'static str { + "io.whiteside.profile" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_io_whiteside_profile() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.content; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 5000usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field("content"), + max: 5000usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.heading; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 200usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field("heading"), + max: 200usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +fn lexicon_doc_io_whiteside_profile() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("io.whiteside.profile"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "Profile information (bio, skills, etc.)", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("literal:bio")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("heading"), + ::jacquard_common::smol_str::SmolStr::new_static("content"), + ::jacquard_common::smol_str::SmolStr::new_static("updatedAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("content"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Profile content in plain text or markdown format", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(5000usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("heading"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Profile section heading (e.g. 'Hey, I'm John')", + ), + ), + format: None, + default: None, + min_length: None, + max_length: Some(200usize), + min_graphemes: None, + max_graphemes: None, + 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( + "Last update timestamp in ISO 8601 format", + ), + ), + 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 + }, + } +} -- 2.51.2