From 593edff9b5b57d72537c110f643123a5ff3e85bd Mon Sep 17 00:00:00 2001 From: Tit Petric Date: Fri, 6 Jul 2018 09:31:40 +0000 Subject: [PATCH] spec update --- sam/docs/src/spec.json | 76 ++++++++++++++++++++--------- sam/docs/src/spec/channel.json | 25 ++++++---- sam/docs/src/spec/message.json | 74 +++++++++++++++------------- sam/docs/src/spec/organisation.json | 17 ++++--- sam/docs/src/spec/team.json | 41 +++++++++------- sam/docs/src/spec/user.json | 27 +++++----- sam/docs/src/spec/websocket.json | 19 +++++--- 7 files changed, 170 insertions(+), 109 deletions(-) diff --git a/sam/docs/src/spec.json b/sam/docs/src/spec.json index 1942667df..bce9ddb68 100644 --- a/sam/docs/src/spec.json +++ b/sam/docs/src/spec.json @@ -6,8 +6,13 @@ "entrypoint": "organisation", "authentication": ["Client ID", "Session ID"], "struct": [ - { "name": "ID", "type": "uint64" }, - { "name": "Name", "type": "string" } + { + "name": "Organisation", + "fields": [ + { "name": "ID", "type": "uint64" }, + { "name": "Name", "type": "string" } + ] + } ], "apis": [ { @@ -70,10 +75,15 @@ "entrypoint": "team", "authentication": ["Client ID", "Session ID"], "struct": [ - { "type": "uint64", "name": "ID" }, - { "type": "string", "name": "Name" }, - { "type": "[]uint64", "name": "MemberIDs", "tag": "json:\"-\"", "complex": true }, - { "type": "[]User", "name": "Members", "tag": "json:\",omitempty\"", "complex": true } + { + "name": "Team", + "fields": [ + { "type": "uint64", "name": "ID" }, + { "type": "string", "name": "Name" }, + { "type": "[]uint64", "name": "MemberIDs", "tag": "json:\"-\"", "complex": true }, + { "type": "[]User", "name": "Members", "tag": "json:\",omitempty\"", "complex": true } + ] + } ], "apis": [ { @@ -159,9 +169,14 @@ "entrypoint": "channel", "authentication": ["Client ID", "Session ID"], "struct": [ - { "type": "uint64", "name": "ID" }, - { "type": "string", "name": "Name" }, - { "type": "string", "name": "Topic" } + { + "name": "Channel", + "fields": [ + { "type": "uint64", "name": "ID" }, + { "type": "string", "name": "Name" }, + { "type": "string", "name": "Topic" } + ] + } ], "apis": [ { @@ -234,15 +249,20 @@ "entrypoint": "message", "authentication": ["Client ID", "Session ID"], "struct": [ - { "name": "Service", "type": "string" }, - { "name": "Channel", "type": "string" }, - { "name": "UserName", "type": "string" }, - { "name": "UserID", "type": "uint64" }, - { "name": "User", "type": "*User" }, - { "name": "UserAvatar", "type": "string" }, - { "name": "Message", "type": "string" }, - { "name": "MessageID", "type": "string" }, - { "name": "Type", "type": "MessageType" } + { + "name": "Message", + "fields": [ + { "name": "Service", "type": "string" }, + { "name": "Channel", "type": "string" }, + { "name": "UserName", "type": "string" }, + { "name": "UserID", "type": "uint64" }, + { "name": "User", "type": "*User", "complex": true }, + { "name": "UserAvatar", "type": "string" }, + { "name": "Message", "type": "string" }, + { "name": "MessageID", "type": "string" }, + { "name": "Type", "type": "MessageType" } + ] + } ], "apis": [ { @@ -333,9 +353,14 @@ "entrypoint": "user", "authentication": ["Client ID", "Session ID"], "struct": [ - { "type": "uint64", "name": "ID" }, - { "type": "string", "name": "Username" }, - { "type": "string", "name": "Password", "tag": "json:\"-\"" } + { + "name": "User", + "fields": [ + { "type": "uint64", "name": "ID" }, + { "type": "string", "name": "Username" }, + { "type": "string", "name": "Password", "tag": "json:\"-\"" } + ] + } ], "apis": [ { @@ -368,8 +393,13 @@ "protocol": "WebSockets", "authentication": ["Client ID", "Session ID"], "struct": [ - { "type": "uint64", "name": "UserID" }, - { "type": "User", "name": "User", "complex": true } + { + "name": "WebSocket", + "fields": [ + { "type": "uint64", "name": "UserID" }, + { "type": "User", "name": "User", "complex": true } + ] + } ], "apis": [ { diff --git a/sam/docs/src/spec/channel.json b/sam/docs/src/spec/channel.json index 3b0f17682..7f4b85e95 100644 --- a/sam/docs/src/spec/channel.json +++ b/sam/docs/src/spec/channel.json @@ -5,16 +5,21 @@ "Interface": "Channel", "Struct": [ { - "name": "ID", - "type": "uint64" - }, - { - "name": "Name", - "type": "string" - }, - { - "name": "Topic", - "type": "string" + "fields": [ + { + "name": "ID", + "type": "uint64" + }, + { + "name": "Name", + "type": "string" + }, + { + "name": "Topic", + "type": "string" + } + ], + "name": "Channel" } ], "Protocol": "", diff --git a/sam/docs/src/spec/message.json b/sam/docs/src/spec/message.json index 4331ff44f..bb6b928aa 100644 --- a/sam/docs/src/spec/message.json +++ b/sam/docs/src/spec/message.json @@ -4,40 +4,46 @@ "Interface": "Message", "Struct": [ { - "name": "Service", - "type": "string" - }, - { - "name": "Channel", - "type": "string" - }, - { - "name": "UserName", - "type": "string" - }, - { - "name": "UserID", - "type": "uint64" - }, - { - "name": "User", - "type": "*User" - }, - { - "name": "UserAvatar", - "type": "string" - }, - { - "name": "Message", - "type": "string" - }, - { - "name": "MessageID", - "type": "string" - }, - { - "name": "Type", - "type": "MessageType" + "fields": [ + { + "name": "Service", + "type": "string" + }, + { + "name": "Channel", + "type": "string" + }, + { + "name": "UserName", + "type": "string" + }, + { + "name": "UserID", + "type": "uint64" + }, + { + "complex": true, + "name": "User", + "type": "*User" + }, + { + "name": "UserAvatar", + "type": "string" + }, + { + "name": "Message", + "type": "string" + }, + { + "name": "MessageID", + "type": "string" + }, + { + "name": "Type", + "type": "MessageType" + } + ], + "name": "Message" } ], "Protocol": "", diff --git a/sam/docs/src/spec/organisation.json b/sam/docs/src/spec/organisation.json index 19be0ef99..07a8b811b 100644 --- a/sam/docs/src/spec/organisation.json +++ b/sam/docs/src/spec/organisation.json @@ -5,12 +5,17 @@ "Interface": "Organisation", "Struct": [ { - "name": "ID", - "type": "uint64" - }, - { - "name": "Name", - "type": "string" + "fields": [ + { + "name": "ID", + "type": "uint64" + }, + { + "name": "Name", + "type": "string" + } + ], + "name": "Organisation" } ], "Protocol": "", diff --git a/sam/docs/src/spec/team.json b/sam/docs/src/spec/team.json index 023fd6e9e..0fb8bdae7 100644 --- a/sam/docs/src/spec/team.json +++ b/sam/docs/src/spec/team.json @@ -5,24 +5,29 @@ "Interface": "Team", "Struct": [ { - "name": "ID", - "type": "uint64" - }, - { - "name": "Name", - "type": "string" - }, - { - "complex": true, - "name": "MemberIDs", - "tag": "json:\"-\"", - "type": "[]uint64" - }, - { - "complex": true, - "name": "Members", - "tag": "json:\",omitempty\"", - "type": "[]User" + "fields": [ + { + "name": "ID", + "type": "uint64" + }, + { + "name": "Name", + "type": "string" + }, + { + "complex": true, + "name": "MemberIDs", + "tag": "json:\"-\"", + "type": "[]uint64" + }, + { + "complex": true, + "name": "Members", + "tag": "json:\",omitempty\"", + "type": "[]User" + } + ], + "name": "Team" } ], "Protocol": "", diff --git a/sam/docs/src/spec/user.json b/sam/docs/src/spec/user.json index f3c0ae91a..55a584a12 100644 --- a/sam/docs/src/spec/user.json +++ b/sam/docs/src/spec/user.json @@ -4,17 +4,22 @@ "Interface": "User", "Struct": [ { - "name": "ID", - "type": "uint64" - }, - { - "name": "Username", - "type": "string" - }, - { - "name": "Password", - "tag": "json:\"-\"", - "type": "string" + "fields": [ + { + "name": "ID", + "type": "uint64" + }, + { + "name": "Username", + "type": "string" + }, + { + "name": "Password", + "tag": "json:\"-\"", + "type": "string" + } + ], + "name": "User" } ], "Protocol": "", diff --git a/sam/docs/src/spec/websocket.json b/sam/docs/src/spec/websocket.json index bc3d1c68b..9cedf5aa0 100644 --- a/sam/docs/src/spec/websocket.json +++ b/sam/docs/src/spec/websocket.json @@ -4,13 +4,18 @@ "Interface": "Websocket", "Struct": [ { - "name": "UserID", - "type": "uint64" - }, - { - "complex": true, - "name": "User", - "type": "User" + "fields": [ + { + "name": "UserID", + "type": "uint64" + }, + { + "complex": true, + "name": "User", + "type": "User" + } + ], + "name": "WebSocket" } ], "Protocol": "WebSockets",