Skip to content

Instantly share code, notes, and snippets.

@csuwildcat
Last active August 1, 2023 21:11
Show Gist options
  • Save csuwildcat/ab2065f8ab4dc4cfbbca18f33ab3ebc4 to your computer and use it in GitHub Desktop.
Save csuwildcat/ab2065f8ab4dc4cfbbca18f33ab3ebc4 to your computer and use it in GitHub Desktop.
{
definition: {
protocol: "https://identity.foundation/protocols/person",
types: {
name: {
schema: "https://identity.foundation/schemas/person-name",
dataFormats: ["application/json"]
/*
{
first: "",
last: "",
middle: "",
nickname: "",
handle: ""
}
*/
},
social: {
schema: "https://identity.foundation/schemas/person-social",
dataFormats: ["application/json"]
/*
{
tagline: "",
bio: "",
website: "",
apps: {
twitter: "",
facebook: "",
instagram: "",
linkedin: "",
github: "",
tidal: "",
...
}
}
*/
},
messaging: {
schema: "https://identity.foundation/schemas/person-messaging",
dataFormats: ["application/json"]
/*
{
email: "",
apps: {
twitter: "",
facebook: "",
instagram: "",
whatsapp: "",
wechat: "",
signal: "",
telegram: "",
...
}
}
*/
},
phone: {
schema: "https://identity.foundation/schemas/person-phone",
dataFormats: ["application/json"]
/*
{
"countryCode": "",
"areaCode": "",
"localNumber": "",
"extension": ""
}
*/
},
address: {
schema: "https://identity.foundation/schemas/person-address",
dataFormats: ["application/json"]
/*
{
street: "",
substreet: "",
locality: "",
region: "",
country: "",
countryCode: ISO 3166-1 alpha-2
postalCode: ""
}
*/
},
icon: {
dataFormats: ["image/png", "jpeg", "gif"]
},
avatar: {
dataFormats: ["image/png", "jpeg", "gif"]
},
photo: {
dataFormats: ["image/png", "jpeg", "gif"]
}
},
structure: {
name: {
$actions: [
{
who: "anyone",
can: "read"
},
]
},
social: {
$actions: [
{
who: "anyone",
can: "read"
}
]
},
icon: {
$actions: [
{
who: "anyone",
can: "read"
}
]
},
avatar: {
$actions: [
{
who: "anyone",
can: "read"
}
]
},
photo: {
$actions: [
{
who: "anyone",
can: "read"
}
]
},
messaging: {},
address: {},
phone: {}
}
}
}
@andorsk
Copy link

andorsk commented Aug 1, 2023

fyi: added JSON schemas for all the objects here: https://github.com/getZION/simple-web5-chat/pull/29/files

@andorsk
Copy link

andorsk commented Aug 1, 2023

@csuwildcat my initial concern here is that since the objects are separated out, you will have to do many operations under a profile then some weird linking. I would suggest nesting the fields in a "profile" bucket, then you can query the profile object directly and get it's children for specific fields.

https://github.com/getZION/simple-web5-chat/pull/29/commits/56969a32114c75330213f81261a1a892a6f7c251#diff-27191c763d7ee36d64d314e92b361c9e6d3743adc3f0a15656d95036d0dd2729R60

goes like:

  • profile
    • profile/name
    • profile/address
graph TD
   subgraph DWN
    subgraph ProfileBucket
       subgraph Profile1
         name
         address
       end
       subgraph Profile2
          name2[name]
          address2[address]
       end
    end
 end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment