Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Post Type Changes #183

Closed
titanous opened this issue Mar 15, 2013 · 10 comments
Closed

Post Type Changes #183

titanous opened this issue Mar 15, 2013 · 10 comments
Labels
Milestone

Comments

@titanous
Copy link
Member

Type URI Fragment

Type URIs now require a fragment, which can be used to uniquely identify a subtype while still referencing the same post type.

Post type URIs with a blank fragment must include the trailing octothorpe:

https://tent.io/types/status/v0#

The fragment may be used to indicate a subtype such as a status reply:

https://tent.io/types/status/v0#reply

It can also be used to embed a reference to another type. For example, this is the type for a repost of a status post:

https://tent.io/types/repost/v0#https://tent.io/types/status/v0

Repost Type

https://tent.io/types/repost/v0

Reposts of public posts should include the type of the post being reposted in the type fragment and the type field in content. The version field may be used in the post content to specify a specific version of a post. The id field has been renamed to post for consistency.

Example

{
  // ...
  "type": "https://tent.io/types/repost/v0#https://tent.io/types/photo/v0",
  "content": {
    "entity": "https://jonathan.tent.is",
    "post": "4815162342",
    "type": "https://tent.io/types/photo/v0#",
    "version": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
  }
}

Profile Type

The profile type has been removed.

Follower Type

The follower type has been removed.

Following Type

The following type has been removed.

Delete Type

https://tent.io/types/delete/v0#

The content now contains a single posts array of objects. The objects contain the members post and optionally version. If version is set, it indicates that the specified version should be deleted, not every version of the post.

Photo Type

https://tent.io/types/photo/v0#

The albums and tags members have been removed. A new member, location has been added containing a GeoJSON Point.

The following variables need to be named and normalized values specified as part of the exif object member.

  • ISO
  • focal length
  • exposure compensation
  • exposure mode
  • aperture
  • shutter speed
  • flash
  • white balance
  • metering pattern
  • camera manufacturer
  • camera model
  • resolution
  • dimensions
  • timestamp
  • colorspace
  • orientation

Essay Type

https://tent.io/types/essay/v0#

The tags member has been removed.

Credentials Type

https://tent.io/types/credentials/v0#

The mac_key_id is the id of the post.

{
  "mac_key": "feb5bb691c6469f3d1f6e7a3be001651",
  "mac_algorithm": "hmac-sha-256"
}

The Pragma: no-cache and Cache-Control: no-store headers must be set when serving this post type.

Cursor Type

https://tent.io/types/cursor/v0

One cursor post is created per tracked post type. The fragment of the type URI is used to indicate the type being tracked.

Example: https://tent.io/types/cursor/v0#https://tent.io/types/status/v0

{
  "post": "hsk4is",
  "entity": "https://example.com",
  "version": "ef537f25c895bfa782526529a9b63d97aa631564d5d789c2b765448c8635fb6c"
}

Tag Type

https://tent.io/types/tag/v0#

Tags have two fields, name and description. To tag a post, simply mention the desired tag in the post.

@seanmonstar
Copy link

Repost type has the fragment to a status, but its content points to a photo.

Separately, will all existing posts get retrofitted with the new types, or to access posts before 0.3, we'll need to query for both the old and the new types?

@titanous
Copy link
Member Author

@seanmonstar fixed.

We're sorting out what long-term strategies for post upgrades. In the short-term we're still in alpha, so things are changing fast and shouldn't be confused with what will happen when we go from 1.0 to 1.1. We'll probably do some type of post db retrofit to the new types when we convert the servers to v0.3.

@simensen
Copy link
Contributor

The Repost Type has the following URI:

https://tent.io/types/delete/v0#

I imagine this is a typo?

@titanous
Copy link
Member Author

@simensen fixed, thanks.

@simensen
Copy link
Contributor

Does an application have to subscribe to all of the fragments it accepts? For example, would you subscribe to "https://tent.io/types/repost/v0" and then get everything that might be a repost type, or would you have to also say you specifically allow reposts of "https://tent.io/types/photo/v0" as well?

@titanous
Copy link
Member Author

@simensen Not specifying a fragment acts as a wildcard. Specific fragments may also be specified.

@titanous
Copy link
Member Author

titanous commented Apr 5, 2013

Changed delete posts to be an array of objects, to allow deletion of multiple posts or versions (for example deleting an entire album of photos).

@titanous
Copy link
Member Author

Post type details have been specified in the docs. Please open new issues or pull requests to discuss further.

@jeena
Copy link

jeena commented Jul 22, 2013

I can use https://tent.io/types/cursor/v0#https://tent.io/types/status/v0 for the position in my timeline but how would I use it for posts I was mentioned in, which is like a different timeline?

@jvatic
Copy link
Member

jvatic commented Jul 22, 2013

@jeena Any URI is a valid fragment for the cursor type.

We are using https://tent.io/types/cursor/v0#https://tent.io/rels/status-replies and https://tent.io/types/cursor/v0#https://tent.io/rels/status-reposts in tent-status for replies (status posts with the reply fragment mentioning a status post of yours) and reposts respectively.

You may use any URI you own as the fragment (e.g. https://tent.example.com/rels/mentions for all posts mentioning you, provided you own example.com) or use one of our URIs provided the usage is identical (we don't have any official list of these currently but feel free to look over the tent-status implementation for now: unread_count.js.coffee and it's subclasses).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants