Skip to content

Synchronise a collection of things (e.g photos, bookmarks) from one host to another.

Notifications You must be signed in to change notification settings

rgrannell1/common-storage

Repository files navigation

Common-Storage

Common-storage is a personal-data-server in which bookmarks, events, tasks, and other data can be added.

API Endpoints

  • feed: an overview of the topics on the current data-server

Administration

  • user: create & manage users, and grant them permissions by assigning roles
  • role: create & manage roles, which restrict access to endpoints and topics

Data Storage

  • topic: create & manage topics, which logically groups related data & constrains its members to matching JSON Schema
  • content: append & retrieve "content" (json entries) to a topic

Data Synchronisation

  • subscription: create & manage subscriptions, which sync content from a remote common-storage server's topic to a local topic

API Details

feed

An overview of the topics on the current data-server

GET /feed

Returns a description provided by the server, and a list of topics & associated statistics

Response

{
	description,
	title,
	version,
	topics: [{
		topic: {
			name,
			description,
			created
		},
		stats: {
			count,
			lastUpdated
		}
	}]
}

user

Create & manage users, and grant them permissions by assigning roles

GET /user/:name

Parameters

  • name: the account user-name
POST /user/:name

Parameters

  • name: the account user-name

Body

{
  "role": "my_user_role",
  "password": "this-is-the-user-password"
}

role

Create & manage roles, which restrict access to endpoints and topics

GET /role/:name

Get details about & permissions associated with a role

Parameters

  • name: the role name
POST /role/:name

Post a named permission-set (a role) to the server

Parameters

  • name: the role name

Body

{
  "permissions": [
    {
      "routes": ["GET /content"],
      "topics": ["notes"]
    }
  ]
}

topic

Create & manage topics, which logically groups related data & constrains its members to matching JSON Schema

GET /topic/:name

Get details about a topic, like the description and creation-date

Parameters

Body

POST /topic/:name

Add a named, validated container for data to the server

Parameters

Body

DELETE /topic/:name

Delete a topic and all associated data from the server

Parameters

Body

content

Append & retrieve "content" (json entries) to a topic

GET /content/:name

Retrieve an array of user-submitted content from the server, from a specified start-id. By sending the content-type application/x-ndjson, retrieve an unbounded JSON stream of content instead

Parameters

Body

POST /content/:name

Post user-content to a topic

Parameters

Body

Append & retrieve "content" (json entries) to a topic

subscription

Create & manage subscriptions, which sync content from a remote common-storage server's topic to a local topic

GET /subscription/:topic

Get information about a subscription.

Parameters

  • topic: the topic to which the subscriptions stores content
POST /subscription/:topic

Create a subscription to a remote server.

Parameters

  • topic: the topic to which the subscriptions stores content

Body

{
  "source": "https://remote-server/content/notes",
  "topic": "subscription.notes",
  "serviceAccount": "remote_server_read_notes",
  "frequency": 300
}
DELETE /subscription/:topic

Delete a subscription.

Parameters

  • topic: the topic to which the subscriptions stores content

About

Synchronise a collection of things (e.g photos, bookmarks) from one host to another.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages