[ABANDONED] API server for Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

278 lines
5.4 KiB

// Containers
//
// Users
// - Partition Key: pk (userId)
// Groups
// - Partition Key: pk (groupId)
// GroupDirectory
// - Partition Key: pk
// Posts
// - Partition Key: pk (postId)
// Ancestry
// - Partition Key: pk (postId)
// Points: total reward value + likes
export type UserItemType = 'user' | 'token' | 'post' | 'follow' | 'timeline'
export type UserPrivacyType = 'public' | 'group' | 'subscribers' | 'private'
export type UserTransactionType = 'purchase' | 'award'
export type GroupStatus = 'pending' | 'paid'
export type GroupItemType = 'group' | 'membership' | 'report' | 'block'
export type GroupMembershipType = 'admin' | 'moderator' | 'member'
export type ReportStatus = 'pending' | 'complete'
export type BlockType = 'user' | 'group'
export interface GroupListing {
id: string
pk: 'pk'
name: string
open: boolean
requiresApproval: boolean
members: number
posts: number
awards: number
points: number
latestAwards: PostAwardPartial[]
created: number
}
export interface Group {
id: string
pk: string // ID
t: 'group'
userId: string
name: string // Prenormalized ID
about?: string
codeOfConduct?: string
imageUrl?: string
coverImageUrl?: string
open: boolean
requiresApproval: boolean
status: GroupStatus
active: boolean
created: number
}
export interface GroupPartial {
id: string
name: string
imageUrl?: string
coverImageUrl?: string
}
export interface GroupMembership {
id?: string
pk: string // Group ID
t: 'membership'
userId: string
pending: boolean
membership: GroupMembershipType
invitation?: string
created: number
}
export interface GroupInvitation {
id: string
pk: string // Group ID
t: 'invitation'
userId: string
limit: number
expiration: number
uses: number
active: boolean
created: number
}
export interface GroupReport {
id: string
pk: string // Group ID
t: 'report'
postId: string
reportedById: string
description?: string
status: string
created: number
}
export interface GroupBlock {
id?: string
pk: string // Group ID
t: 'block'
blockedId: string // User or Group ID
userId: string // blocker ID
created: number
}
export interface User {
id: string
pk: string // ID
t: 'user'
group?: GroupPartial
name: string
about?: string
imageUrl?: string
coverImageUrl?: string
email: string
emailVerified: boolean
passwordHash: string
installations: Installation[]
awards: number // Total Awards
points: number
balance: number // Currency (Flex)
subscriberCount: number
subscribedCount: number
pending: boolean
requiresApproval: boolean
privacy: UserPrivacyType
paid: boolean
active: boolean
created: number // Timestamp
}
export interface UserToken {
id: string
pk: string // userId
t: 'token'
userAgent: string
ip: string
expires: number
created: number
}
export interface UserPost {
id?: string
postId: string
pk: string // userId
t: 'post'
created: number
}
export interface UserSubscription {
id?: string
subscriberId: string
pk: string
t: 'subscription'
pending: boolean
created: number
}
export interface UserBlock {
id?: string
blockedId: string
pk: string
t: 'block'
blockType: BlockType
description?: string
created: number
}
export interface IUserTransaction {
id: string
pk: string
t: 'transaction'
transactionType: UserTransactionType
fromUserId: string
toUserId: string
amount: number
created: number
}
export interface UserTimelinePost {
id?: string
postId: string
pk: string // userId
t: 'timeline'
created: number
}
export interface PostAttachment {
imageUrl: string
caption?: string
cover?: string
}
export interface Status {
imageUrl: string
text: string
created: number
}
export interface Post {
id: string
pk: string // postId
t: 'post'
userId: string
root: string
parents: string[] // Post IDs
text?: string
cover?: string
attachments: PostAttachment[]
status?: Status
visible: boolean
awards: number
latestAwards: PostAwardPartial[]
created: number
}
export interface IPostAward {
id: string
pk: string // postId
t: 'award'
userId: string
imageUrl: string
text: string
userText: string
cost: number
reward: number
created: number
}
export interface PostAwardPartial {
userId: string
imageUrl: string
text: string
userText: string
created: number
}
export interface PostRelationship {
id: string
parents: string[] // Post IDs
pk: string // root post ID
}
export interface Installation {
id: string
appId: string
settings: object
created: number
}
export interface AppRevision {
version: string
displayName: string
imageUrl: string
coverImageUrl: string
description: string
websiteUrl: string
companyName: string
composerUrl: string
composerSchema: object
rendererUrl: string
rendererSchema: object
initCallbackUrl: string
composeCallbackUrl: string
}
export interface App {
id: string
userId: string
name: string
version: string
rating: number
revisions: AppRevision[]
currentRevisionIndex: number
publicKey: string
privateKey: string
created: number
}