diff --git a/src/docs/docs.go b/src/docs/docs.go index 0f8cdaf..fd787a9 100644 --- a/src/docs/docs.go +++ b/src/docs/docs.go @@ -694,6 +694,84 @@ var doc = `{ } } }, + "/v1/reactions/{number}": { + "post": { + "description": "React to a message", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Reactions" + ], + "summary": "Send a reaction.", + "parameters": [ + { + "description": "Reaction", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/api.Reaction" + } + } + ], + "responses": { + "204": { + "description": "No Content", + "schema": { + "type": "string" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/api.Error" + } + } + } + }, + "delete": { + "description": "Remove a reaction", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Reactions" + ], + "summary": "Remove a reaction.", + "parameters": [ + { + "description": "Reaction", + "name": "data", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/api.Reaction" + } + } + ], + "responses": { + "204": { + "description": "No Content", + "schema": { + "type": "string" + } + }, + "400": { + "description": "Bad Request", + "schema": { + "$ref": "#/definitions/api.Error" + } + } + } + } + }, "/v1/receive/{number}": { "get": { "description": "Receives Signal Messages from the Signal Network. If you are running the docker container in normal/native mode, this is a GET endpoint. In json-rpc mode this is a websocket endpoint.", @@ -1091,6 +1169,23 @@ var doc = `{ } } }, + "api.Reaction": { + "type": "object", + "properties": { + "reaction": { + "type": "string" + }, + "recipient": { + "type": "string" + }, + "target_author": { + "type": "string" + }, + "timestamp": { + "type": "integer" + } + } + }, "api.RegisterNumberRequest": { "type": "object", "properties": { @@ -1295,6 +1390,10 @@ var doc = `{ { "description": "List and Trust Identities.", "name": "Identities" + }, + { + "description": "React to messages.", + "name": "Reactions" } ] }` diff --git a/src/docs/swagger.json b/src/docs/swagger.json index 61f34a2..7e0ce5c 100644 --- a/src/docs/swagger.json +++ b/src/docs/swagger.json @@ -681,7 +681,7 @@ }, "/v1/reactions/{number}": { "post": { - "description": "React to a message.", + "description": "React to a message", "consumes": [ "application/json" ], @@ -694,7 +694,7 @@ "summary": "Send a reaction.", "parameters": [ { - "description": "Reactions", + "description": "Reaction", "name": "data", "in": "body", "required": true, @@ -719,7 +719,7 @@ } }, "delete": { - "description": "Delete a reaction.", + "description": "Remove a reaction", "consumes": [ "application/json" ], @@ -729,10 +729,10 @@ "tags": [ "Reactions" ], - "summary": "Delete a reaction.", + "summary": "Remove a reaction.", "parameters": [ { - "description": "Reactions", + "description": "Reaction", "name": "data", "in": "body", "required": true, @@ -757,23 +757,6 @@ } } }, - "api.Reaction": { - "type": "object", - "properties": { - "recipient": { - "type": "string" - }, - "reaction": { - "type": "string" - }, - "target_author": { - "type": "string" - }, - "timestamp": { - "type": "integer" - } - } - }, "/v1/receive/{number}": { "get": { "description": "Receives Signal Messages from the Signal Network. If you are running the docker container in normal/native mode, this is a GET endpoint. In json-rpc mode this is a websocket endpoint.", @@ -1171,6 +1154,23 @@ } } }, + "api.Reaction": { + "type": "object", + "properties": { + "reaction": { + "type": "string" + }, + "recipient": { + "type": "string" + }, + "target_author": { + "type": "string" + }, + "timestamp": { + "type": "integer" + } + } + }, "api.RegisterNumberRequest": { "type": "object", "properties": { diff --git a/src/docs/swagger.yaml b/src/docs/swagger.yaml index aa00a0a..5125e8f 100644 --- a/src/docs/swagger.yaml +++ b/src/docs/swagger.yaml @@ -1,9 +1,9 @@ -"basePath: / +basePath: / definitions: api.Configuration: properties: logging: - $ref: "#/definitions/api.LoggingConfiguration" + $ref: '#/definitions/api.LoggingConfiguration' type: object type: object api.CreateGroupRequest: @@ -12,9 +12,9 @@ definitions: type: string group_link: enum: - - disabled - - enabled - - enabled-with-approval + - disabled + - enabled + - enabled-with-approval type: string members: items: @@ -23,7 +23,7 @@ definitions: name: type: string permissions: - $ref: "#/definitions/api.GroupPermissions" + $ref: '#/definitions/api.GroupPermissions' type: object type: object api.CreateGroupResponse: @@ -40,13 +40,13 @@ definitions: properties: add_members: enum: - - only-admins - - every-member + - only-admins + - every-member type: string edit_group: enum: - - only-admins - - every-member + - only-admins + - every-member type: string type: object api.LoggingConfiguration: @@ -56,10 +56,10 @@ definitions: type: object api.Reaction: properties: - recipient: - type: string reaction: type: string + recipient: + type: string target_author: type: string timestamp: @@ -190,20 +190,20 @@ paths: get: description: Returns the supported API versions and the internal build nr produces: - - application/json + - application/json responses: "200": description: OK schema: - $ref: "#/definitions/client.About" + $ref: '#/definitions/client.About' summary: Lists general information about the API tags: - - General + - General /v1/attachments: get: description: List all downloaded attachments produces: - - application/json + - application/json responses: "200": description: OK @@ -214,21 +214,21 @@ paths: "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: List all attachments. tags: - - Attachments + - Attachments /v1/attachments/{attachment}: delete: description: Remove the attachment with the given id from filesystem. parameters: - - description: Attachment ID - in: path - name: attachment - required: true - type: string + - description: Attachment ID + in: path + name: attachment + required: true + type: string produces: - - application/json + - application/json responses: "204": description: No Content @@ -237,20 +237,20 @@ paths: "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Remove attachment. tags: - - Attachments + - Attachments get: description: Serve the attachment with the given id parameters: - - description: Attachment ID - in: path - name: attachment - required: true - type: string + - description: Attachment ID + in: path + name: attachment + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -259,42 +259,42 @@ paths: "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Serve Attachment. tags: - - Attachments + - Attachments /v1/configuration: get: consumes: - - application/json + - application/json description: List the REST API configuration. produces: - - application/json + - application/json responses: "200": description: OK schema: - $ref: "#/definitions/api.Configuration" + $ref: '#/definitions/api.Configuration' "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: List the REST API configuration. tags: - - General + - General post: consumes: - - application/json + - application/json description: Set the REST API configuration. parameters: - - description: Configuration - in: body - name: data - required: true - schema: - $ref: "#/definitions/api.Configuration" + - description: Configuration + in: body + name: data + required: true + schema: + $ref: '#/definitions/api.Configuration' produces: - - application/json + - application/json responses: "204": description: OK @@ -303,85 +303,85 @@ paths: "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Set the REST API configuration. tags: - - General + - General /v1/groups/{number}: get: consumes: - - application/json + - application/json description: List all Signal Groups. parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string + - description: Registered Phone Number + in: path + name: number + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK schema: items: - $ref: "#/definitions/client.GroupEntry" + $ref: '#/definitions/client.GroupEntry' type: array "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: List all Signal Groups. tags: - - Groups + - Groups post: consumes: - - application/json + - application/json description: Create a new Signal Group with the specified members. parameters: - - description: Input Data - in: body - name: data - required: true - schema: - $ref: "#/definitions/api.CreateGroupRequest" - - description: Registered Phone Number - in: path - name: number - required: true - type: string + - description: Input Data + in: body + name: data + required: true + schema: + $ref: '#/definitions/api.CreateGroupRequest' + - description: Registered Phone Number + in: path + name: number + required: true + type: string produces: - - application/json + - application/json responses: "201": description: Created schema: - $ref: "#/definitions/api.CreateGroupResponse" + $ref: '#/definitions/api.CreateGroupResponse' "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Create a new Signal Group. tags: - - Groups + - Groups /v1/groups/{number}/{groupid}: delete: consumes: - - application/json + - application/json description: Delete the specified Signal Group. parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string - - description: Group Id - in: path - name: groupid - required: true - type: string + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Group Id + in: path + name: groupid + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK @@ -390,57 +390,57 @@ paths: "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Delete a Signal Group. tags: - - Groups + - Groups get: consumes: - - application/json + - application/json description: List a specific Signal Group. parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string - - description: Group ID - in: path - name: groupid - required: true - type: string + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Group ID + in: path + name: groupid + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK schema: - $ref: "#/definitions/client.GroupEntry" + $ref: '#/definitions/client.GroupEntry' "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: List a Signal Group. tags: - - Groups + - Groups /v1/groups/{number}/{groupid}/block: post: consumes: - - application/json + - application/json description: Block the specified Signal Group. parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string - - description: Group ID - in: path - name: groupid - required: true - type: string + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Group ID + in: path + name: groupid + required: true + type: string produces: - - application/json + - application/json responses: "204": description: No Content @@ -449,28 +449,28 @@ paths: "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Block a Signal Group. tags: - - Groups + - Groups /v1/groups/{number}/{groupid}/join: post: consumes: - - application/json + - application/json description: Join the specified Signal Group. parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string - - description: Group ID - in: path - name: groupid - required: true - type: string + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Group ID + in: path + name: groupid + required: true + type: string produces: - - application/json + - application/json responses: "204": description: No Content @@ -479,28 +479,28 @@ paths: "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Join a Signal Group. tags: - - Groups + - Groups /v1/groups/{number}/{groupid}/quit: post: consumes: - - application/json + - application/json description: Quit the specified Signal Group. parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string - - description: Group ID - in: path - name: groupid - required: true - type: string + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Group ID + in: path + name: groupid + required: true + type: string produces: - - application/json + - application/json responses: "204": description: No Content @@ -509,15 +509,15 @@ paths: "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Quit a Signal Group. tags: - - Groups + - Groups /v1/health: get: description: Internally used by the docker container to perform the health check. produces: - - application/json + - application/json responses: "204": description: No Content @@ -525,50 +525,50 @@ paths: type: string summary: API Health Check tags: - - General + - General /v1/identities/{number}: get: description: List all identities for the given number. parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string + - description: Registered Phone Number + in: path + name: number + required: true + type: string produces: - - application/json + - application/json responses: "200": description: OK schema: items: - $ref: "#/definitions/client.IdentityEntry" + $ref: '#/definitions/client.IdentityEntry' type: array summary: List Identities tags: - - Identities + - Identities /v1/identities/{number}/trust/{numberToTrust}: put: description: Trust an identity. parameters: - - description: Input Data - in: body - name: data - required: true - schema: - $ref: "#/definitions/api.TrustIdentityRequest" - - description: Registered Phone Number - in: path - name: number - required: true - type: string - - description: Number To Trust - in: path - name: numberToTrust - required: true - type: string + - description: Input Data + in: body + name: data + required: true + schema: + $ref: '#/definitions/api.TrustIdentityRequest' + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Number To Trust + in: path + name: numberToTrust + required: true + type: string produces: - - application/json + - application/json responses: "204": description: No Content @@ -576,24 +576,24 @@ paths: type: string summary: Trust Identity tags: - - Identities + - Identities /v1/profiles/{number}: put: description: Set your name and optional an avatar. parameters: - - description: Profile Data - in: body - name: data - required: true - schema: - $ref: "#/definitions/api.UpdateProfileRequest" - - description: Registered Phone Number - in: path - name: number - required: true - type: string + - description: Profile Data + in: body + name: data + required: true + schema: + $ref: '#/definitions/api.UpdateProfileRequest' + - description: Registered Phone Number + in: path + name: number + required: true + type: string produces: - - application/json + - application/json responses: "204": description: No Content @@ -602,21 +602,21 @@ paths: "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Update Profile. tags: - - Profiles + - Profiles /v1/qrcodelink: get: description: Link device and generate QR code parameters: - - description: Device Name - in: query - name: device_name - required: true - type: string + - description: Device Name + in: query + name: device_name + required: true + type: string produces: - - application/json + - application/json responses: "200": description: Image @@ -625,17 +625,42 @@ paths: "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Link device and generate QR code. tags: - - Devices + - Devices /v1/reactions/{number}: + delete: + consumes: + - application/json + description: Remove a reaction + parameters: + - description: Reaction + in: body + name: data + required: true + schema: + $ref: '#/definitions/api.Reaction' + produces: + - application/json + responses: + "204": + description: No Content + schema: + type: string + "400": + description: Bad Request + schema: + $ref: '#/definitions/api.Error' + summary: Remove a reaction. + tags: + - Reactions post: consumes: - application/json - description: React to a message. + description: React to a message parameters: - - description: Reactions + - description: Reaction in: body name: data required: true @@ -655,17 +680,143 @@ paths: summary: Send a reaction. tags: - Reactions - delete: + /v1/receive/{number}: + get: consumes: - application/json - description: Delete a reaction. + description: Receives Signal Messages from the Signal Network. If you are running the docker container in normal/native mode, this is a GET endpoint. In json-rpc mode this is a websocket endpoint. parameters: - - description: Reactions + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: 'Receive timeout in seconds (default: 1)' + in: query + name: timeout + type: string + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + type: string + type: array + "400": + description: Bad Request + schema: + $ref: '#/definitions/api.Error' + summary: Receive Signal Messages. + tags: + - Messages + /v1/register/{number}: + post: + consumes: + - application/json + description: Register a phone number with the signal network. + parameters: + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Additional Settings + in: body + name: data + schema: + $ref: '#/definitions/api.RegisterNumberRequest' + produces: + - application/json + responses: + "201": {} + "400": + description: Bad Request + schema: + $ref: '#/definitions/api.Error' + summary: Register a phone number. + tags: + - Devices + /v1/register/{number}/verify/{token}: + post: + consumes: + - application/json + description: Verify a registered phone number with the signal network. + parameters: + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Additional Settings + in: body + name: data + schema: + $ref: '#/definitions/api.VerifyNumberSettings' + - description: Verification Code + in: path + name: token + required: true + type: string + produces: + - application/json + responses: + "201": + description: OK + schema: + type: string + "400": + description: Bad Request + schema: + $ref: '#/definitions/api.Error' + summary: Verify a registered phone number. + tags: + - Devices + /v1/send: + post: + consumes: + - application/json + deprecated: true + description: Send a signal message + parameters: + - description: Input Data in: body name: data required: true schema: - $ref: '#/definitions/api.Reaction' + $ref: '#/definitions/api.SendMessageV1' + produces: + - application/json + responses: + "201": + description: OK + schema: + type: string + "400": + description: Bad Request + schema: + $ref: '#/definitions/api.Error' + summary: Send a signal message. + tags: + - Messages + /v1/typing-indicator/{number}: + delete: + consumes: + - application/json + description: Hide Typing Indicator. + parameters: + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Type + in: body + name: data + required: true + schema: + $ref: '#/definitions/api.TypingIndicatorRequest' produces: - application/json responses: @@ -677,178 +828,27 @@ paths: description: Bad Request schema: $ref: '#/definitions/api.Error' - summary: Delete a reaction. - tags: - - Reactions - /v1/receive/{number}: - get: - consumes: - - application/json - description: Receives Signal Messages from the Signal Network. If you are running the docker container in normal/native mode, this is a GET endpoint. In json-rpc mode this is a websocket endpoint. - parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string - - description: "Receive timeout in seconds (default: 1)" - in: query - name: timeout - type: string - produces: - - application/json - responses: - "200": - description: OK - schema: - items: - type: string - type: array - "400": - description: Bad Request - schema: - $ref: "#/definitions/api.Error" - summary: Receive Signal Messages. - tags: - - Messages - /v1/register/{number}: - post: - consumes: - - application/json - description: Register a phone number with the signal network. - parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string - - description: Additional Settings - in: body - name: data - schema: - $ref: "#/definitions/api.RegisterNumberRequest" - produces: - - application/json - responses: - "201": {} - "400": - description: Bad Request - schema: - $ref: "#/definitions/api.Error" - summary: Register a phone number. - tags: - - Devices - /v1/register/{number}/verify/{token}: - post: - consumes: - - application/json - description: Verify a registered phone number with the signal network. - parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string - - description: Additional Settings - in: body - name: data - schema: - $ref: "#/definitions/api.VerifyNumberSettings" - - description: Verification Code - in: path - name: token - required: true - type: string - produces: - - application/json - responses: - "201": - description: OK - schema: - type: string - "400": - description: Bad Request - schema: - $ref: "#/definitions/api.Error" - summary: Verify a registered phone number. - tags: - - Devices - /v1/send: - post: - consumes: - - application/json - deprecated: true - description: Send a signal message - parameters: - - description: Input Data - in: body - name: data - required: true - schema: - $ref: "#/definitions/api.SendMessageV1" - produces: - - application/json - responses: - "201": - description: OK - schema: - type: string - "400": - description: Bad Request - schema: - $ref: "#/definitions/api.Error" - summary: Send a signal message. - tags: - - Messages - /v1/typing-indicator/{number}: - delete: - consumes: - - application/json - description: Hide Typing Indicator. - parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string - - description: Type - in: body - name: data - required: true - schema: - $ref: "#/definitions/api.TypingIndicatorRequest" - produces: - - application/json - responses: - "204": - description: No Content - schema: - type: string - "400": - description: Bad Request - schema: - $ref: "#/definitions/api.Error" summary: Hide Typing Indicator. tags: - - Messages + - Messages put: consumes: - - application/json + - application/json description: Show Typing Indicator. parameters: - - description: Registered Phone Number - in: path - name: number - required: true - type: string - - description: Type - in: body - name: data - required: true - schema: - $ref: "#/definitions/api.TypingIndicatorRequest" + - description: Registered Phone Number + in: path + name: number + required: true + type: string + - description: Type + in: body + name: data + required: true + schema: + $ref: '#/definitions/api.TypingIndicatorRequest' produces: - - application/json + - application/json responses: "204": description: No Content @@ -857,52 +857,51 @@ paths: "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Show Typing Indicator. tags: - - Messages + - Messages /v2/send: post: consumes: - - application/json + - application/json description: Send a signal message parameters: - - description: Input Data - in: body - name: data - required: true - schema: - $ref: "#/definitions/api.SendMessageV2" + - description: Input Data + in: body + name: data + required: true + schema: + $ref: '#/definitions/api.SendMessageV2' produces: - - application/json + - application/json responses: "201": description: Created schema: - $ref: "#/definitions/api.SendMessageResponse" + $ref: '#/definitions/api.SendMessageResponse' "400": description: Bad Request schema: - $ref: "#/definitions/api.Error" + $ref: '#/definitions/api.Error' summary: Send a signal message. tags: - - Messages + - Messages swagger: "2.0" tags: - - description: Some general endpoints. - name: General - - description: Register and link Devices. - name: Devices - - description: Create, List and Delete Signal Groups. - name: Groups - - description: Send and Receive Signal Messages. - name: Messages - - description: List and Delete Attachments. - name: Attachments - - description: Update Profile. - name: Profiles - - description: List and Trust Identities. - name: Identities - - description: React to messages. - name: Reactions -" \ No newline at end of file +- description: Some general endpoints. + name: General +- description: Register and link Devices. + name: Devices +- description: Create, List and Delete Signal Groups. + name: Groups +- description: Send and Receive Signal Messages. + name: Messages +- description: List and Delete Attachments. + name: Attachments +- description: Update Profile. + name: Profiles +- description: List and Trust Identities. + name: Identities +- description: React to messages. + name: Reactions