relay filter/appview bootstrap
1mod channel;
2mod invite;
3mod lattice;
4mod membership;
5mod shard;
6
7pub use channel::*;
8pub use invite::*;
9pub use lattice::*;
10pub use membership::*;
11pub use shard::*;
12
13use chrono::{DateTime, Utc};
14use serde::{Deserialize, Serialize};
15
16pub const LATTICE_COLLECTION: &str = "systems.gmstn.development.lattice";
17pub const SHARD_COLLECTION: &str = "systems.gmstn.development.shard";
18pub const CHANNEL_COLLECTION: &str = "systems.gmstn.development.channel";
19pub const INVITE_COLLECTION: &str = "systems.gmstn.development.channel.invite";
20pub const MEMBERSHIP_COLLECTION: &str = "systems.gmstn.development.channel.membership";
21
22#[derive(Debug, Clone, Serialize, Deserialize)]
23pub struct AtpRecord {
24 #[serde(rename = "$type")]
25 pub record_type: String,
26 #[serde(rename = "createdAt")]
27 pub created_at: String,
28 #[serde(flatten)]
29 pub extra: serde_json::Value,
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
33pub struct CidRef {
34 pub cid: String,
35}
36
37#[derive(Debug, Clone)]
38pub struct NewAccount {
39 pub did: String,
40 pub handle: String,
41 pub created_at: DateTime<Utc>,
42}
43
44#[derive(Debug, Clone, sqlx::FromRow)]
45pub struct Record {
46 pub uri: String,
47 pub cid: String,
48 pub collection: String,
49 pub creator_did: String,
50 pub created_at: DateTime<Utc>,
51 pub indexed_at: DateTime<Utc>,
52 pub data: serde_json::Value,
53 pub target_did: Option<String>,
54 pub ref_cids: Vec<String>,
55}
56
57#[derive(Debug, Clone)]
58pub struct NewRecord {
59 pub uri: String,
60 pub cid: String,
61 pub collection: String,
62 pub creator_did: String,
63 pub created_at: DateTime<Utc>,
64 pub indexed_at: DateTime<Utc>,
65 pub data: serde_json::Value,
66 pub target_did: Option<String>,
67 pub ref_cids: Vec<String>,
68}