-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add activity/history and media/playlist schemas (#50)
- Loading branch information
Showing
2 changed files
with
205 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://common.schemas.verida.io/activity/history/v0.1.0/schema.json", | ||
"title": "History", | ||
"titlePlural": "Histories", | ||
"description": "General history of activities such as listening, watching, browsing, etc.", | ||
"type": "object", | ||
"appearance": { | ||
"style": { | ||
"color": "#4A90E2", | ||
"icon": "./icon.svg" | ||
} | ||
}, | ||
"database": { | ||
"name": "activity_history", | ||
"indexes": { | ||
"name": ["name", "activityType", "timestamp"], | ||
"insertedAt": ["insertedAt"], | ||
"timestamp": ["timestamp"], | ||
"source": ["sourceApplication", "sourceId"] | ||
} | ||
}, | ||
"layouts": { | ||
"create": [ | ||
"name", | ||
"timestamp", | ||
"activityType" | ||
], | ||
"view": [ | ||
"name", | ||
"timestamp", | ||
"activityType", | ||
"duration", | ||
"summary", | ||
"url", | ||
"sourceApplication", | ||
"sourceId" | ||
] | ||
}, | ||
"allOf": [ | ||
{ | ||
"$ref": "https://core.schemas.verida.io/base/v0.1.0/schema.json" | ||
}, | ||
{ | ||
"properties": { | ||
"timestamp": { | ||
"title": "Timestamp", | ||
"description": "When the activity occurred", | ||
"type": "string", | ||
"format": "date-time" | ||
}, | ||
"activityType": { | ||
"title": "Activity Type", | ||
"description": "Type of activity (e.g., listening, watching, browsing)", | ||
"type": "string", | ||
"enum": ["listening", "watching", "browsing", "reading"] | ||
}, | ||
"url": { | ||
"title": "URL", | ||
"description": "The link of source information" | ||
}, | ||
"duration": { | ||
"title": "Duration", | ||
"description": "Duration of the activity in seconds", | ||
"type": "integer", | ||
"minimum": 0 | ||
} | ||
}, | ||
"required": [ | ||
"name", | ||
"timestamp", | ||
"activityType" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
{ | ||
"$schema": "https://json-schema.org/draft/2020-12/schema", | ||
"$id": "https://common.schemas.verida.io/media/playlist/v0.1.0/schema.json", | ||
"title": "Playlist", | ||
"titlePlural": "Playlists", | ||
"description": "A generic schema for playlists from platforms like Spotify, YouTube, etc.", | ||
"type": "object", | ||
"appearance": { | ||
"style": { | ||
"color": "#1DB954", | ||
"icon": "./icon.svg" | ||
} | ||
}, | ||
"database": { | ||
"name": "media_playlist", | ||
"indexes": { | ||
"name": ["name"], | ||
"source": ["sourceApplication", "sourceId"] | ||
} | ||
}, | ||
"layouts": { | ||
"create": [ | ||
"name", | ||
"type" | ||
], | ||
"view": [ | ||
"name", | ||
"type", | ||
"tracks" | ||
] | ||
}, | ||
"$defs": { | ||
"type": { | ||
"type": "string", | ||
"enum": ["audio", "video"], | ||
"title": "Type", | ||
"description": "Type of the playlist or track, either audio or video" | ||
}, | ||
"person": { | ||
"type": "object", | ||
"title": "Person", | ||
"description": "Schema representing a person", | ||
"properties": { | ||
"email": { | ||
"type": "string", | ||
"format": "email", | ||
"description": "Email address of the person" | ||
}, | ||
"displayName": { | ||
"type": "string", | ||
"description": "Display name of the person" | ||
} | ||
}, | ||
"required": ["displayName"] | ||
}, | ||
"track": { | ||
"type": "object", | ||
"title": "Track", | ||
"description": "Schema representing a track or video in the playlist", | ||
"properties": { | ||
"id": { | ||
"title": "Track ID", | ||
"description": "Unique identifier for the track/video", | ||
"type": "string" | ||
}, | ||
"title": { | ||
"title": "Title", | ||
"description": "Title of the track/video", | ||
"type": "string" | ||
}, | ||
"artist": { | ||
"title": "Artist/Creator", | ||
"description": "Name of the artist or content creator", | ||
"type": "string" | ||
}, | ||
"album": { | ||
"title": "Album", | ||
"description": "Album name (if applicable, e.g., for Spotify)", | ||
"type": "string" | ||
}, | ||
"thumbnail": { | ||
"title": "Thumbnail", | ||
"description": "URL of the thumbnail image", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"duration": { | ||
"title": "Duration", | ||
"description": "Duration of the track/video in milliseconds", | ||
"type": "integer" | ||
}, | ||
"url": { | ||
"title": "URL", | ||
"description": "Direct URL to the track/video", | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"type": { | ||
"$ref": "#/$defs/type" | ||
} | ||
}, | ||
"required": ["id", "title"] | ||
} | ||
}, | ||
"allOf": [ | ||
{ | ||
"$ref": "https://core.schemas.verida.io/base/v0.1.0/schema.json" | ||
}, | ||
{ | ||
"properties": { | ||
"type": { | ||
"$ref": "#/$defs/type" | ||
}, | ||
"owner": { | ||
"$ref": "#/$defs/person" | ||
}, | ||
"tracks": { | ||
"type": "array", | ||
"title": "Tracks", | ||
"description": "Array of track or video items in the playlist", | ||
"items": { | ||
"$ref": "#/$defs/track" | ||
} | ||
} | ||
}, | ||
"required": ["name", "type"] | ||
} | ||
] | ||
} |