added search endpoint

* check whether one or more phone numbers are registered with
  the signal service.

see #50
This commit is contained in:
Bernhard B
2022-01-02 14:52:45 +01:00
parent 18dcc49ff4
commit 43747af9d4
6 changed files with 270 additions and 0 deletions

View File

@@ -913,6 +913,48 @@ var doc = `{
}
}
},
"/v1/search": {
"get": {
"description": "Check if one or more phone numbers are registered with the Signal Service.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Search"
],
"summary": "Check if one or more phone numbers are registered with the Signal Service.",
"parameters": [
{
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi",
"description": "Numbers to check",
"name": "numbers",
"in": "query",
"required": true
}
],
"responses": {
"204": {
"description": "No Content",
"schema": {
"$ref": "#/definitions/api.SearchResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/v1/send": {
"post": {
"description": "Send a signal message",
@@ -1197,6 +1239,17 @@ var doc = `{
}
}
},
"api.SearchResponse": {
"type": "object",
"properties": {
"number": {
"type": "string"
},
"registered": {
"type": "boolean"
}
}
},
"api.SendMessageResponse": {
"type": "object",
"properties": {
@@ -1295,6 +1348,9 @@ var doc = `{
"mode": {
"type": "string"
},
"version": {
"type": "string"
},
"versions": {
"type": "array",
"items": {
@@ -1394,6 +1450,10 @@ var doc = `{
{
"description": "React to messages.",
"name": "Reactions"
},
{
"description": "Search the Signal Service.",
"name": "Search"
}
]
}`

View File

@@ -898,6 +898,48 @@
}
}
},
"/v1/search": {
"get": {
"description": "Check if one or more phone numbers are registered with the Signal Service.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Search"
],
"summary": "Check if one or more phone numbers are registered with the Signal Service.",
"parameters": [
{
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi",
"description": "Numbers to check",
"name": "numbers",
"in": "query",
"required": true
}
],
"responses": {
"204": {
"description": "No Content",
"schema": {
"$ref": "#/definitions/api.SearchResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/api.Error"
}
}
}
}
},
"/v1/send": {
"post": {
"description": "Send a signal message",
@@ -1182,6 +1224,17 @@
}
}
},
"api.SearchResponse": {
"type": "object",
"properties": {
"number": {
"type": "string"
},
"registered": {
"type": "boolean"
}
}
},
"api.SendMessageResponse": {
"type": "object",
"properties": {
@@ -1280,6 +1333,9 @@
"mode": {
"type": "string"
},
"version": {
"type": "string"
},
"versions": {
"type": "array",
"items": {
@@ -1379,6 +1435,10 @@
{
"description": "React to messages.",
"name": "Reactions"
},
{
"description": "Search the Signal Service.",
"name": "Search"
}
]
}

View File

@@ -72,6 +72,13 @@ definitions:
use_voice:
type: boolean
type: object
api.SearchResponse:
properties:
number:
type: string
registered:
type: boolean
type: object
api.SendMessageResponse:
properties:
timestamp:
@@ -135,6 +142,8 @@ definitions:
type: integer
mode:
type: string
version:
type: string
versions:
items:
type: string
@@ -773,6 +782,34 @@ paths:
summary: Verify a registered phone number.
tags:
- Devices
/v1/search:
get:
consumes:
- application/json
description: Check if one or more phone numbers are registered with the Signal Service.
parameters:
- collectionFormat: multi
description: Numbers to check
in: query
items:
type: string
name: numbers
required: true
type: array
produces:
- application/json
responses:
"204":
description: No Content
schema:
$ref: '#/definitions/api.SearchResponse'
"400":
description: Bad Request
schema:
$ref: '#/definitions/api.Error'
summary: Check if one or more phone numbers are registered with the Signal Service.
tags:
- Search
/v1/send:
post:
consumes:
@@ -905,3 +942,5 @@ tags:
name: Identities
- description: React to messages.
name: Reactions
- description: Search the Signal Service.
name: Search