Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 48 additions & 14 deletions jsonschemas/feeds/activity.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,61 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "activity.schema.json",
"type": "object",
"description": "Activity entity for feeds import.",
"required": ["id", "type", "user_id", "fids"],
"properties": {
"id": { "type": "string" },
"type": { "type": "string" },
"user_id": { "type": "string" },
"id": { "type": "string", "minLength": 1 },
"type": {
"type": "string",
"minLength": 1,
"description": "Activity type, e.g. 'post', 'photo'."
},
"user_id": { "type": "string", "minLength": 1 },
"fids": {
"type": "array",
"items": { "type": "string" }
"items": { "type": "string", "minLength": 1 },
"minItems": 1,
"description": "List of feed IDs (fids) this activity is posted to."
},
"text": { "type": "string" },
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": { "type": "string" },
"image_url": { "type": "string" },
"thumb_url": { "type": "string" },
"asset_url": { "type": "string" },
"type": {
"type": "string",
"description": "e.g. text, image, audio, video, file, poll."
},
"image_url": {
"type": "string",
"format": "uri",
"pattern": "^https://"
},
"thumb_url": {
"type": "string",
"format": "uri",
"pattern": "^https://"
},
"asset_url": {
"type": "string",
"format": "uri",
"pattern": "^https://"
},
"migrate_resources": { "type": "boolean" },
"custom": { "type": "object" }
"custom": { "type": "object", "additionalProperties": true }
}
}
},
"visibility": { "type": "string" },
"visibility_tag": { "type": "string" },
"visibility": {
"type": "string",
"enum": ["public", "private", "tag"],
"description": "Defaults to 'public' when empty."
},
"visibility_tag": {
"type": "string",
"description": "Required semantics when visibility='tag' (enforced at runtime, not in schema)."
},
"location": {
"type": "object",
"properties": {
Expand All @@ -41,7 +71,7 @@
},
"parent_id": { "type": "string" },
"poll_id": { "type": "string" },
"custom": { "type": "object" },
"custom": { "type": "object", "additionalProperties": true },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" },
"edited_at": { "type": "string", "format": "date-time" },
Expand All @@ -53,7 +83,11 @@
"interest_tags": {
"type": "array",
"items": { "type": "string" }
},
"collection_refs": {
"type": "array",
"items": { "type": "string" },
"description": "Collection IDs this activity references."
}
},
"required": ["id", "type", "user_id", "fids"]
}
}
33 changes: 33 additions & 0 deletions jsonschemas/feeds/bookmark.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "bookmark.schema.json",
"type": "object",
"description": "Bookmark entity for feeds import. Use 'object_id' (with optional 'object_type'). 'activity_id' is supported for backward compatibility only. See importer/v2/items/bookmark.go.",
"required": ["user_id"],
"properties": {
"user_id": { "type": "string", "minLength": 1 },
"object_id": {
"type": "string",
"description": "ID of the bookmarked object (activity or comment)."
},
"object_type": {
"type": "string",
"enum": ["activity", "comment"],
"default": "activity",
"description": "Type of the bookmarked object. Defaults to 'activity' when empty."
},
"activity_id": {
"type": "string",
"deprecated": true,
"description": "Deprecated: use 'object_id'. If 'object_id' is empty, 'activity_id' is copied over for backward compatibility."
},
"folder_id": { "type": "string" },
"custom": { "type": "object", "additionalProperties": true },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" }
},
"anyOf": [
{ "required": ["object_id"] },
{ "required": ["activity_id"] }
]
}
16 changes: 11 additions & 5 deletions jsonschemas/feeds/collection.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "collection.schema.json",
"type": "object",
"description": "Collection entity for feeds import.",
"required": ["name", "id", "custom"],
"properties": {
"name": { "type": "string" },
"id": { "type": "string" },
"name": { "type": "string", "minLength": 1 },
"id": { "type": "string", "minLength": 1 },
"user_id": { "type": "string" },
"custom": { "type": "object" },
"custom": {
"type": "object",
"minProperties": 1,
"additionalProperties": true,
"description": "Must contain at least one key."
},
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" },
"deleted_at": { "type": "string", "format": "date-time" }
},
"required": ["name", "id"]
}
}
49 changes: 35 additions & 14 deletions jsonschemas/feeds/comment.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,60 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "comment.schema.json",
"type": "object",
"description": "Comment entity for feeds import.",
"required": ["id", "object_type", "object_id", "user_id", "text"],
"properties": {
"id": { "type": "string" },
"object_type": { "type": "string", "enum": ["activity"] },
"object_id": { "type": "string" },
"user_id": { "type": "string" },
"parent_id": { "type": "string" },
"text": { "type": "string" },
"id": { "type": "string", "minLength": 1 },
"object_type": {
"type": "string",
"enum": ["activity"],
"description": "Currently only 'activity' is supported for imported comments."
},
"object_id": { "type": "string", "minLength": 1 },
"user_id": { "type": "string", "minLength": 1 },
"parent_id": {
"type": ["string", "null"],
"description": "ID of the parent comment when this is a reply."
},
"text": { "type": "string", "minLength": 1 },
"status": {
"type": "string",
"enum": ["active", "deleted", "removed", "hidden"]
"enum": ["active", "deleted", "removed", "hidden"],
"default": "active"
},
"attachments": {
"type": "array",
"items": {
"type": "object",
"properties": {
"type": { "type": "string" },
"image_url": { "type": "string" },
"thumb_url": { "type": "string" },
"asset_url": { "type": "string" },
"image_url": {
"type": "string",
"format": "uri",
"pattern": "^https://"
},
"thumb_url": {
"type": "string",
"format": "uri",
"pattern": "^https://"
},
"asset_url": {
"type": "string",
"format": "uri",
"pattern": "^https://"
},
"migrate_resources": { "type": "boolean" },
"custom": { "type": "object" }
"custom": { "type": "object", "additionalProperties": true }
}
}
},
"mentioned_user_ids": {
"type": "array",
"items": { "type": "string" }
},
"custom": { "type": "object" },
"custom": { "type": "object", "additionalProperties": true },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" },
"deleted_at": { "type": "string", "format": "date-time" }
},
"required": ["id", "object_type", "object_id", "user_id", "text"]
}
}
25 changes: 17 additions & 8 deletions jsonschemas/feeds/feed.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,32 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "feed.schema.json",
"type": "object",
"description": "Feed entity for feeds import.",
"required": ["group_id", "id", "fid", "created_by_id"],
"properties": {
"group_id": { "type": "string" },
"id": { "type": "string" },
"fid": { "type": "string" },
"group_id": { "type": "string", "minLength": 1 },
"id": { "type": "string", "minLength": 1 },
"fid": {
"type": "string",
"minLength": 1,
"description": "Fully-qualified feed id, typically '{group_id}:{id}'."
},
"name": { "type": "string" },
"description": { "type": "string" },
"custom": { "type": "object" },
"custom": { "type": "object", "additionalProperties": true },
"filter_tags": {
"type": "array",
"items": { "type": "string" }
},
"visibility": { "type": "string" },
"created_by_id": { "type": "string" },
"visibility": {
"type": "string",
"enum": ["public", "visible", "followers", "members", "private"],
"description": "Defaults to 'visible' when empty."
},
"created_by_id": { "type": "string", "minLength": 1 },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" },
"deleted_at": { "type": "string", "format": "date-time" },
"last_watched_at": { "type": "string", "format": "date-time" }
},
"required": ["group_id", "id", "fid", "created_by_id"]
}
}
23 changes: 12 additions & 11 deletions jsonschemas/feeds/feed_group.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,28 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "feed_group.schema.json",
"type": "object",
"description": "FeedGroup entity for feeds import.",
"required": ["group_id"],
"properties": {
"id": { "type": "integer" },
"group_id": { "type": "string" },
"group_id": { "type": "string", "minLength": 1 },
"app_pk": { "type": "integer" },
"default_view_id": { "type": "string" },
"default_visibility": { "type": "string" },
"default_visibility": {
"type": "string",
"enum": ["", "public", "visible", "followers", "members", "private"],
"description": "Default feed visibility for feeds in this group. Falls back to the global default when empty."
},
"last_feed_get_at": { "type": ["string", "null"], "format": "date-time" },
"notification": { "type": "object", "additionalProperties": true },
"stories": { "type": "object", "additionalProperties": true },
"activity_processors": {
"type": "array"
},
"activity_selectors": {
"type": "array"
},
"activity_processors": { "type": "array" },
"activity_selectors": { "type": "array" },
"ranking": { "type": "object", "additionalProperties": true },
"aggregation": { "type": "object", "additionalProperties": true },
"aggregation_version": { "type": "integer" },
"push_notification": { "type": "object", "additionalProperties": true },
"created_at": { "type": "string", "format": "date-time" },
"custom": { "type": "object" }
},
"required": ["group_id", "activity_selectors"]
"custom": { "type": "object", "additionalProperties": true }
}
}
17 changes: 17 additions & 0 deletions jsonschemas/feeds/feed_view.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "feed_view.schema.json",
"type": "object",
"description": "FeedView entity for feeds import.",
"required": ["view_id"],
"properties": {
"view_id": { "type": "string", "minLength": 1 },
"app_pk": { "type": "integer" },
"activity_selectors": { "type": "array" },
"ranking": { "type": "object", "additionalProperties": true },
"aggregation": { "type": "object", "additionalProperties": true },
"aggregation_version": { "type": "integer" },
"last_feed_get_at": { "type": ["string", "null"], "format": "date-time" },
"created_at": { "type": "string", "format": "date-time" }
}
}
32 changes: 22 additions & 10 deletions jsonschemas/feeds/follow.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,37 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "follow.schema.json",
"type": "object",
"description": "Follow entity for feeds import. 'source_fid' and 'target_fid' must differ (enforced at runtime).",
"required": ["source_fid", "target_fid"],
"properties": {
"source_fid": { "type": "string" },
"target_fid": { "type": "string" },
"source_fid": { "type": "string", "minLength": 1 },
"target_fid": { "type": "string", "minLength": 1 },
"status": {
"type": "string",
"enum": ["accepted", "pending", "rejected"]
"enum": ["accepted", "pending", "rejected"],
"default": "accepted"
},
"push_preference": {
"type": "string",
"enum": ["all", "none"]
"enum": ["all", "none"],
"default": "none"
},
"custom": { "type": "object" },
"custom": { "type": "object", "additionalProperties": true },
"request_accepted_at": { "type": "string", "format": "date-time" },
"request_rejected_at": { "type": "string", "format": "date-time" },
"created_at": { "type": "string", "format": "date-time" },
"updated_at": { "type": "string", "format": "date-time" },
"source_created_by_id": { "type": "string" },
"target_created_by_id": { "type": "string" },
"follower_role": { "type": "string" }
},
"required": ["source", "target"]
"source_created_by_id": {
"type": "string",
"description": "User ID of the creator of the source feed."
},
"target_created_by_id": {
"type": "string",
"description": "User ID of the creator of the target feed."
},
"follower_role": {
"type": "string",
"description": "Role assigned to the follower. Defaults to the 'feed_follower' role when empty."
}
}
}
Loading
Loading