diff --git a/src/api/api.go b/src/api/api.go index 1b6ceba..ee91748 100644 --- a/src/api/api.go +++ b/src/api/api.go @@ -96,7 +96,7 @@ func NewApi(signalClient *client.SignalClient) *Api { // @Tags General // @Description Returns the supported API versions and the internal build nr // @Produce json -// @Success 200 {object} About +// @Success 200 {object} client.About // @Router /v1/about [get] func (a *Api) About(c *gin.Context) { c.JSON(200, a.signalClient.About()) @@ -342,7 +342,7 @@ func (a *Api) CreateGroup(c *gin.Context) { // @Description List all Signal Groups. // @Accept json // @Produce json -// @Success 200 {object} []GroupEntry +// @Success 200 {object} []client.GroupEntry // @Failure 400 {object} Error // @Param number path string true "Registered Phone Number" // @Router /v1/groups/{number} [get] @@ -363,7 +363,7 @@ func (a *Api) GetGroups(c *gin.Context) { // @Description List a specific Signal Group. // @Accept json // @Produce json -// @Success 200 {object} GroupEntry +// @Success 200 {object} client.GroupEntry // @Failure 400 {object} Error // @Param number path string true "Registered Phone Number" // @Param groupid path string true "Group ID" @@ -588,7 +588,7 @@ func (a *Api) Health(c *gin.Context) { // @Tags Identities // @Description List all identities for the given number. // @Produce json -// @Success 200 {object} []IdentityEntry +// @Success 200 {object} []client.IdentityEntry // @Param number path string true "Registered Phone Number" // @Router /v1/identities/{number} [get] func (a *Api) ListIdentities(c *gin.Context) { diff --git a/src/docs/docs.go b/src/docs/docs.go index 4793a65..ec0f7ab 100644 --- a/src/docs/docs.go +++ b/src/docs/docs.go @@ -39,7 +39,7 @@ var doc = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/api.About" + "$ref": "#/definitions/client.About" } } } @@ -237,7 +237,7 @@ var doc = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/api.GroupEntry" + "$ref": "#/definitions/client.GroupEntry" } } }, @@ -328,7 +328,7 @@ var doc = `{ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/api.GroupEntry" + "$ref": "#/definitions/client.GroupEntry" } }, "400": { @@ -563,7 +563,7 @@ var doc = `{ "schema": { "type": "array", "items": { - "$ref": "#/definitions/api.IdentityEntry" + "$ref": "#/definitions/client.IdentityEntry" } } } @@ -918,20 +918,6 @@ var doc = `{ } }, "definitions": { - "api.About": { - "type": "object", - "properties": { - "build": { - "type": "integer" - }, - "versions": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, "api.Configuration": { "type": "object", "properties": { @@ -986,44 +972,6 @@ var doc = `{ } } }, - "api.GroupEntry": { - "type": "object", - "properties": { - "blocked": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "internal_id": { - "type": "string" - }, - "invite_link": { - "type": "string" - }, - "members": { - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "type": "string" - }, - "pending_invites": { - "type": "array", - "items": { - "type": "string" - } - }, - "pending_requests": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, "api.GroupPermissions": { "type": "object", "properties": { @@ -1043,26 +991,6 @@ var doc = `{ } } }, - "api.IdentityEntry": { - "type": "object", - "properties": { - "added": { - "type": "string" - }, - "fingerprint": { - "type": "string" - }, - "number": { - "type": "string" - }, - "safety_number": { - "type": "string" - }, - "status": { - "type": "string" - } - } - }, "api.LoggingConfiguration": { "type": "object", "properties": { @@ -1162,6 +1090,78 @@ var doc = `{ "type": "string" } } + }, + "client.About": { + "type": "object", + "properties": { + "build": { + "type": "integer" + }, + "versions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "client.GroupEntry": { + "type": "object", + "properties": { + "blocked": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "internal_id": { + "type": "string" + }, + "invite_link": { + "type": "string" + }, + "members": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "pending_invites": { + "type": "array", + "items": { + "type": "string" + } + }, + "pending_requests": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "client.IdentityEntry": { + "type": "object", + "properties": { + "added": { + "type": "string" + }, + "fingerprint": { + "type": "string" + }, + "number": { + "type": "string" + }, + "safety_number": { + "type": "string" + }, + "status": { + "type": "string" + } + } } }, "tags": [ diff --git a/src/docs/swagger.json b/src/docs/swagger.json index 28b735c..6ed4db9 100644 --- a/src/docs/swagger.json +++ b/src/docs/swagger.json @@ -24,7 +24,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/api.About" + "$ref": "#/definitions/client.About" } } } @@ -222,7 +222,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/api.GroupEntry" + "$ref": "#/definitions/client.GroupEntry" } } }, @@ -313,7 +313,7 @@ "200": { "description": "OK", "schema": { - "$ref": "#/definitions/api.GroupEntry" + "$ref": "#/definitions/client.GroupEntry" } }, "400": { @@ -548,7 +548,7 @@ "schema": { "type": "array", "items": { - "$ref": "#/definitions/api.IdentityEntry" + "$ref": "#/definitions/client.IdentityEntry" } } } @@ -903,20 +903,6 @@ } }, "definitions": { - "api.About": { - "type": "object", - "properties": { - "build": { - "type": "integer" - }, - "versions": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, "api.Configuration": { "type": "object", "properties": { @@ -971,44 +957,6 @@ } } }, - "api.GroupEntry": { - "type": "object", - "properties": { - "blocked": { - "type": "boolean" - }, - "id": { - "type": "string" - }, - "internal_id": { - "type": "string" - }, - "invite_link": { - "type": "string" - }, - "members": { - "type": "array", - "items": { - "type": "string" - } - }, - "name": { - "type": "string" - }, - "pending_invites": { - "type": "array", - "items": { - "type": "string" - } - }, - "pending_requests": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, "api.GroupPermissions": { "type": "object", "properties": { @@ -1028,26 +976,6 @@ } } }, - "api.IdentityEntry": { - "type": "object", - "properties": { - "added": { - "type": "string" - }, - "fingerprint": { - "type": "string" - }, - "number": { - "type": "string" - }, - "safety_number": { - "type": "string" - }, - "status": { - "type": "string" - } - } - }, "api.LoggingConfiguration": { "type": "object", "properties": { @@ -1147,6 +1075,78 @@ "type": "string" } } + }, + "client.About": { + "type": "object", + "properties": { + "build": { + "type": "integer" + }, + "versions": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "client.GroupEntry": { + "type": "object", + "properties": { + "blocked": { + "type": "boolean" + }, + "id": { + "type": "string" + }, + "internal_id": { + "type": "string" + }, + "invite_link": { + "type": "string" + }, + "members": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + }, + "pending_invites": { + "type": "array", + "items": { + "type": "string" + } + }, + "pending_requests": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "client.IdentityEntry": { + "type": "object", + "properties": { + "added": { + "type": "string" + }, + "fingerprint": { + "type": "string" + }, + "number": { + "type": "string" + }, + "safety_number": { + "type": "string" + }, + "status": { + "type": "string" + } + } } }, "tags": [ diff --git a/src/docs/swagger.yaml b/src/docs/swagger.yaml index f5fdc6a..8465dfd 100644 --- a/src/docs/swagger.yaml +++ b/src/docs/swagger.yaml @@ -1,14 +1,5 @@ basePath: / definitions: - api.About: - properties: - build: - type: integer - versions: - items: - type: string - type: array - type: object api.Configuration: properties: logging: @@ -45,31 +36,6 @@ definitions: error: type: string type: object - api.GroupEntry: - properties: - blocked: - type: boolean - id: - type: string - internal_id: - type: string - invite_link: - type: string - members: - items: - type: string - type: array - name: - type: string - pending_invites: - items: - type: string - type: array - pending_requests: - items: - type: string - type: array - type: object api.GroupPermissions: properties: add_members: @@ -83,19 +49,6 @@ definitions: - every-member type: string type: object - api.IdentityEntry: - properties: - added: - type: string - fingerprint: - type: string - number: - type: string - safety_number: - type: string - status: - type: string - type: object api.LoggingConfiguration: properties: Level: @@ -160,6 +113,53 @@ definitions: pin: type: string type: object + client.About: + properties: + build: + type: integer + versions: + items: + type: string + type: array + type: object + client.GroupEntry: + properties: + blocked: + type: boolean + id: + type: string + internal_id: + type: string + invite_link: + type: string + members: + items: + type: string + type: array + name: + type: string + pending_invites: + items: + type: string + type: array + pending_requests: + items: + type: string + type: array + type: object + client.IdentityEntry: + properties: + added: + type: string + fingerprint: + type: string + number: + type: string + safety_number: + type: string + status: + type: string + type: object host: 127.0.0.1:8080 info: contact: {} @@ -177,7 +177,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/api.About' + $ref: '#/definitions/client.About' summary: Lists general information about the API tags: - General @@ -307,7 +307,7 @@ paths: description: OK schema: items: - $ref: '#/definitions/api.GroupEntry' + $ref: '#/definitions/client.GroupEntry' type: array "400": description: Bad Request @@ -397,7 +397,7 @@ paths: "200": description: OK schema: - $ref: '#/definitions/api.GroupEntry' + $ref: '#/definitions/client.GroupEntry' "400": description: Bad Request schema: @@ -524,7 +524,7 @@ paths: description: OK schema: items: - $ref: '#/definitions/api.IdentityEntry' + $ref: '#/definitions/client.IdentityEntry' type: array summary: List Identities tags: