···66// Any manual changes will be overwritten on the next regeneration.
7788//! Generated bindings for the `space.polymodel.actor` Lexicon namespace/module.
99+pub mod bootstrap_profile;
910pub mod get_profile;
1011pub mod get_session;
1112pub mod profile;
···11+// @generated by jacquard-lexicon. DO NOT EDIT.
22+//
33+// Lexicon: space.polymodel.actor.bootstrapProfile
44+//
55+// This file was automatically generated from Lexicon schemas.
66+// Any manual changes will be overwritten on the next regeneration.
77+88+#[allow(unused_imports)]
99+use alloc::collections::BTreeMap;
1010+1111+#[allow(unused_imports)]
1212+use core::marker::PhantomData;
1313+use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
1414+use jacquard_common::deps::smol_str::SmolStr;
1515+use jacquard_common::types::string::{AtUri, Cid};
1616+use jacquard_common::types::value::Data;
1717+use jacquard_derive::IntoStatic;
1818+use serde::{Serialize, Deserialize};
1919+use crate::space_polymodel::actor::ProfileView;
2020+2121+#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
2222+#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
2323+pub struct BootstrapProfileOutput<S: BosStr = DefaultStr> {
2424+ #[serde(skip_serializing_if = "Option::is_none")]
2525+ pub cid: Option<Cid<S>>,
2626+ pub profile: ProfileView<S>,
2727+ pub status: BootstrapProfileOutputStatus<S>,
2828+ #[serde(skip_serializing_if = "Option::is_none")]
2929+ pub uri: Option<AtUri<S>>,
3030+ #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
3131+ pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
3232+}
3333+3434+3535+#[derive(Debug, Clone, PartialEq, Eq, Hash)]
3636+pub enum BootstrapProfileOutputStatus<S: BosStr = DefaultStr> {
3737+ ExistingLocal,
3838+ ExistingRemote,
3939+ Created,
4040+ Other(S),
4141+}
4242+4343+impl<S: BosStr> BootstrapProfileOutputStatus<S> {
4444+ pub fn as_str(&self) -> &str {
4545+ match self {
4646+ Self::ExistingLocal => "existingLocal",
4747+ Self::ExistingRemote => "existingRemote",
4848+ Self::Created => "created",
4949+ Self::Other(s) => s.as_ref(),
5050+ }
5151+ }
5252+ /// Construct from a string-like value, matching known values.
5353+ pub fn from_value(s: S) -> Self {
5454+ match s.as_ref() {
5555+ "existingLocal" => Self::ExistingLocal,
5656+ "existingRemote" => Self::ExistingRemote,
5757+ "created" => Self::Created,
5858+ _ => Self::Other(s),
5959+ }
6060+ }
6161+}
6262+6363+impl<S: BosStr> core::fmt::Display for BootstrapProfileOutputStatus<S> {
6464+ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
6565+ write!(f, "{}", self.as_str())
6666+ }
6767+}
6868+6969+impl<S: BosStr> AsRef<str> for BootstrapProfileOutputStatus<S> {
7070+ fn as_ref(&self) -> &str {
7171+ self.as_str()
7272+ }
7373+}
7474+7575+impl<S: BosStr> Serialize for BootstrapProfileOutputStatus<S> {
7676+ fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
7777+ where
7878+ Ser: serde::Serializer,
7979+ {
8080+ serializer.serialize_str(self.as_str())
8181+ }
8282+}
8383+8484+impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
8585+for BootstrapProfileOutputStatus<S> {
8686+ fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
8787+ where
8888+ D: serde::Deserializer<'de>,
8989+ {
9090+ let s = S::deserialize(deserializer)?;
9191+ Ok(Self::from_value(s))
9292+ }
9393+}
9494+9595+impl<S: BosStr + Default> Default for BootstrapProfileOutputStatus<S> {
9696+ fn default() -> Self {
9797+ Self::Other(Default::default())
9898+ }
9999+}
100100+101101+impl<S: BosStr> jacquard_common::IntoStatic for BootstrapProfileOutputStatus<S>
102102+where
103103+ S: BosStr + jacquard_common::IntoStatic,
104104+ S::Output: BosStr,
105105+{
106106+ type Output = BootstrapProfileOutputStatus<S::Output>;
107107+ fn into_static(self) -> Self::Output {
108108+ match self {
109109+ BootstrapProfileOutputStatus::ExistingLocal => {
110110+ BootstrapProfileOutputStatus::ExistingLocal
111111+ }
112112+ BootstrapProfileOutputStatus::ExistingRemote => {
113113+ BootstrapProfileOutputStatus::ExistingRemote
114114+ }
115115+ BootstrapProfileOutputStatus::Created => {
116116+ BootstrapProfileOutputStatus::Created
117117+ }
118118+ BootstrapProfileOutputStatus::Other(v) => {
119119+ BootstrapProfileOutputStatus::Other(v.into_static())
120120+ }
121121+ }
122122+ }
123123+}
124124+125125+/** Request marker for the `space.polymodel.actor.bootstrapProfile` procedure.
126126+127127+This endpoint has no request parameters or input body; send this marker with `jacquard::Client`.*/
128128+129129+#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Copy)]
130130+pub struct BootstrapProfile;
131131+/** Response marker for the `space.polymodel.actor.bootstrapProfile` procedure.
132132+133133+Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `BootstrapProfileOutput<S>` for this endpoint.*/
134134+pub struct BootstrapProfileResponse;
135135+impl jacquard_common::xrpc::XrpcResp for BootstrapProfileResponse {
136136+ const NSID: &'static str = "space.polymodel.actor.bootstrapProfile";
137137+ const ENCODING: &'static str = "application/json";
138138+ type Output<S: BosStr> = BootstrapProfileOutput<S>;
139139+ type Err = jacquard_common::xrpc::GenericError;
140140+}
141141+142142+impl jacquard_common::xrpc::XrpcRequest for BootstrapProfile {
143143+ const NSID: &'static str = "space.polymodel.actor.bootstrapProfile";
144144+ const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
145145+ "application/json",
146146+ );
147147+ type Response = BootstrapProfileResponse;
148148+}
149149+150150+/** Endpoint marker for the `space.polymodel.actor.bootstrapProfile` procedure.
151151+152152+Path: `/xrpc/space.polymodel.actor.bootstrapProfile`. The request payload type is `BootstrapProfile`; use this marker with lower-level `XrpcEndpoint` APIs when you need endpoint metadata.*/
153153+pub struct BootstrapProfileRequest;
154154+impl jacquard_common::xrpc::XrpcEndpoint for BootstrapProfileRequest {
155155+ const PATH: &'static str = "/xrpc/space.polymodel.actor.bootstrapProfile";
156156+ const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
157157+ "application/json",
158158+ );
159159+ type Request<S: BosStr> = BootstrapProfile;
160160+ type Response = BootstrapProfileResponse;
161161+}
+6
crates/polymodel-api/src/space_polymodel/graph.rs
···44// Any manual changes will be overwritten on the next regeneration.
5566//! Generated bindings for the `space.polymodel.graph` Lexicon namespace/module.
77+pub mod create_like;
88+pub mod create_save;
99+pub mod create_tag;
1010+pub mod delete_like;
1111+pub mod delete_save;
1212+pub mod delete_tag;
713pub mod get_list;
814pub mod like;
915pub mod list;
···66// Any manual changes will be overwritten on the next regeneration.
7788//! Generated bindings for the `space.polymodel.library` Lexicon namespace/module.
99+pub mod delete_thing;
910pub mod get_author_things;
1011pub mod get_feed;
1112pub mod get_model;
1213pub mod get_thing;
1314pub mod model;
1415pub mod part;
1616+pub mod publish_thing;
1517pub mod search_things;
1818+pub mod stage_file;
1619pub mod thing;
2020+pub mod update_thing;
172118221923#[allow(unused_imports)]
···11+-- PM-28: owner-scoped upload staging for raw geometry bytes.
22+--
33+-- stageFile writes blobs to the authenticated actor's PDS first, then stores the
44+-- reassembly metadata needed by publishThing to build space.polymodel.library.defs#file.
55+CREATE TABLE upload_staging (
66+ owner_did TEXT NOT NULL,
77+ upload_id TEXT NOT NULL,
88+ sha256 TEXT NOT NULL,
99+ mime_type TEXT NOT NULL,
1010+ size INTEGER NOT NULL,
1111+ filename TEXT,
1212+ status TEXT NOT NULL,
1313+ file_json TEXT NOT NULL,
1414+ chunks_json TEXT NOT NULL,
1515+ created_at INTEGER NOT NULL,
1616+ updated_at INTEGER NOT NULL,
1717+ PRIMARY KEY (owner_did, upload_id)
1818+);
1919+2020+CREATE INDEX idx_upload_staging_owner_updated
2121+ ON upload_staging(owner_did, updated_at DESC);
+56
migrations/004_social_record_cids.sql
···11+-- Store CIDs on all social record projection tables. Existing rows cannot be
22+-- backfilled because previous schema versions did not store record CIDs; rebuild
33+-- these derived tables instead of introducing placeholder CIDs. Hydrant/firehose
44+-- can replay social records, and eager writes after this migration preserve CIDs.
55+66+DROP TABLE likes;
77+CREATE TABLE likes (
88+ did TEXT NOT NULL,
99+ rkey TEXT NOT NULL,
1010+ cid TEXT NOT NULL,
1111+ subject_uri TEXT NOT NULL,
1212+ created_at INTEGER NOT NULL,
1313+ PRIMARY KEY (did, rkey),
1414+ UNIQUE (did, subject_uri)
1515+);
1616+CREATE INDEX idx_likes_subject ON likes(subject_uri);
1717+1818+DROP TABLE saves;
1919+CREATE TABLE saves (
2020+ did TEXT NOT NULL,
2121+ rkey TEXT NOT NULL,
2222+ cid TEXT NOT NULL,
2323+ subject_uri TEXT NOT NULL,
2424+ note TEXT,
2525+ created_at INTEGER NOT NULL,
2626+ PRIMARY KEY (did, rkey),
2727+ UNIQUE (did, subject_uri)
2828+);
2929+CREATE INDEX idx_saves_subject ON saves(subject_uri);
3030+3131+DROP TABLE tags;
3232+CREATE TABLE tags (
3333+ did TEXT NOT NULL,
3434+ rkey TEXT NOT NULL,
3535+ cid TEXT NOT NULL,
3636+ subject_uri TEXT NOT NULL,
3737+ tag TEXT NOT NULL,
3838+ created_at INTEGER NOT NULL,
3939+ PRIMARY KEY (did, rkey)
4040+);
4141+CREATE INDEX idx_tags_subject ON tags(subject_uri);
4242+CREATE INDEX idx_tags_tag ON tags(tag);
4343+4444+DROP TABLE listitems;
4545+CREATE TABLE listitems (
4646+ did TEXT NOT NULL,
4747+ rkey TEXT NOT NULL,
4848+ cid TEXT NOT NULL,
4949+ list_uri TEXT NOT NULL,
5050+ subject_uri TEXT NOT NULL,
5151+ created_at INTEGER NOT NULL,
5252+ PRIMARY KEY (did, rkey)
5353+);
5454+CREATE INDEX idx_listitems_list ON listitems(list_uri, created_at);
5555+5656+UPDATE content_stats SET like_count = 0, save_count = 0, tag_count = 0;