compat methods

This commit is contained in:
2022-11-20 01:28:32 +01:00
parent b56c021356
commit 728b12107f
10 changed files with 609 additions and 262 deletions

View File

@@ -983,6 +983,7 @@
"get": {
"summary": "Acknowledge that a message was received",
"operationId": "compat-ack",
"deprecated": true,
"parameters": [
{
"type": "string",
@@ -1010,13 +1011,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.Ack.response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
"$ref": "#/definitions/ginresp.compatAPIError"
}
}
}
@@ -1026,17 +1021,12 @@
"get": {
"summary": "Get a whole (potentially truncated) message",
"operationId": "compat-expand",
"deprecated": true,
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.Expand.response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
"$ref": "#/definitions/ginresp.compatAPIError"
}
}
}
@@ -1046,6 +1036,7 @@
"get": {
"summary": "Get information about the current user",
"operationId": "compat-info",
"deprecated": true,
"parameters": [
{
"type": "string",
@@ -1066,13 +1057,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.Info.response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
"$ref": "#/definitions/ginresp.compatAPIError"
}
}
}
@@ -1082,6 +1067,7 @@
"get": {
"summary": "Register a new account",
"operationId": "compat-register",
"deprecated": true,
"parameters": [
{
"type": "string",
@@ -1113,13 +1099,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.Register.response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
"$ref": "#/definitions/ginresp.compatAPIError"
}
}
}
@@ -1129,6 +1109,7 @@
"get": {
"summary": "Return all not-acknowledged messages",
"operationId": "compat-requery",
"deprecated": true,
"parameters": [
{
"type": "string",
@@ -1149,13 +1130,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.Requery.response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
"$ref": "#/definitions/ginresp.compatAPIError"
}
}
}
@@ -1165,6 +1140,7 @@
"get": {
"summary": "Set the fcm-token (android)",
"operationId": "compat-update",
"deprecated": true,
"parameters": [
{
"type": "string",
@@ -1192,13 +1168,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.Update.response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
"$ref": "#/definitions/ginresp.compatAPIError"
}
}
}
@@ -1208,6 +1178,7 @@
"get": {
"summary": "Upgrade a free account to a paid account",
"operationId": "compat-upgrade",
"deprecated": true,
"parameters": [
{
"type": "string",
@@ -1246,13 +1217,7 @@
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/handler.Upgrade.response"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/ginresp.apiError"
"$ref": "#/definitions/ginresp.compatAPIError"
}
}
}
@@ -1495,6 +1460,20 @@
}
}
},
"ginresp.compatAPIError": {
"type": "object",
"properties": {
"errid": {
"type": "integer"
},
"message": {
"type": "string"
},
"success": {
"type": "boolean"
}
}
},
"handler.Ack.response": {
"type": "object",
"properties": {
@@ -1508,7 +1487,7 @@
"type": "integer"
},
"success": {
"type": "string"
"type": "boolean"
}
}
},
@@ -1584,13 +1563,13 @@
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.ShortCompatMessage"
"$ref": "#/definitions/models.CompatMessage"
},
"message": {
"type": "string"
},
"success": {
"type": "string"
"type": "boolean"
}
}
},
@@ -1609,25 +1588,25 @@
"type": "boolean"
},
"is_pro": {
"type": "string"
"type": "integer"
},
"message": {
"type": "string"
},
"quota": {
"type": "string"
"type": "integer"
},
"quota_max": {
"type": "string"
"type": "integer"
},
"success": {
"type": "string"
"type": "boolean"
},
"unack_count": {
"type": "integer"
},
"user_id": {
"type": "string"
"type": "integer"
},
"user_key": {
"type": "string"
@@ -1731,7 +1710,7 @@
"type": "boolean"
},
"user_id": {
"type": "string"
"type": "integer"
},
"user_key": {
"type": "string"
@@ -1754,7 +1733,7 @@
"type": "string"
},
"success": {
"type": "string"
"type": "boolean"
}
}
},
@@ -1829,22 +1808,22 @@
"type": "object",
"properties": {
"is_pro": {
"type": "string"
"type": "integer"
},
"message": {
"type": "string"
},
"quota": {
"type": "string"
"type": "integer"
},
"quota_max": {
"type": "string"
"type": "integer"
},
"success": {
"type": "string"
"type": "boolean"
},
"user_id": {
"type": "string"
"type": "integer"
},
"user_key": {
"type": "string"
@@ -1865,14 +1844,23 @@
"handler.Upgrade.response": {
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/models.ShortCompatMessage"
"is_pro": {
"type": "boolean"
},
"message": {
"type": "string"
},
"quota": {
"type": "integer"
},
"quota_max": {
"type": "integer"
},
"success": {
"type": "string"
"type": "boolean"
},
"user_id": {
"type": "integer"
}
}
},
@@ -1978,7 +1966,7 @@
"type": "integer"
},
"scn_msg_id": {
"type": "string"
"type": "integer"
},
"timestamp": {
"type": "integer"
@@ -1986,6 +1974,9 @@
"title": {
"type": "string"
},
"trimmed": {
"type": "boolean"
},
"usr_msg_id": {
"type": "string"
}
@@ -2029,32 +2020,6 @@
}
}
},
"models.ShortCompatMessage": {
"type": "object",
"properties": {
"body": {
"type": "string"
},
"priority": {
"type": "integer"
},
"scn_msg_id": {
"type": "string"
},
"timestamp": {
"type": "integer"
},
"title": {
"type": "string"
},
"trimmed": {
"type": "boolean"
},
"usr_msg_id": {
"type": "string"
}
}
},
"models.SubscriptionJSON": {
"type": "object",
"properties": {

View File

@@ -12,6 +12,15 @@ definitions:
success:
type: boolean
type: object
ginresp.compatAPIError:
properties:
errid:
type: integer
message:
type: string
success:
type: boolean
type: object
handler.Ack.response:
properties:
message:
@@ -21,7 +30,7 @@ definitions:
prev_ack:
type: integer
success:
type: string
type: boolean
type: object
handler.AddClient.body:
properties:
@@ -70,11 +79,11 @@ definitions:
handler.Expand.response:
properties:
data:
$ref: '#/definitions/models.ShortCompatMessage'
$ref: '#/definitions/models.CompatMessage'
message:
type: string
success:
type: string
type: boolean
type: object
handler.Health.response:
properties:
@@ -86,19 +95,19 @@ definitions:
fcm_token_set:
type: boolean
is_pro:
type: string
type: integer
message:
type: string
quota:
type: string
type: integer
quota_max:
type: string
type: integer
success:
type: string
type: boolean
unack_count:
type: integer
user_id:
type: string
type: integer
user_key:
type: string
type: object
@@ -165,7 +174,7 @@ definitions:
success:
type: boolean
user_id:
type: string
type: integer
user_key:
type: string
type: object
@@ -180,7 +189,7 @@ definitions:
message:
type: string
success:
type: string
type: boolean
type: object
handler.SendMessage.body:
properties:
@@ -229,17 +238,17 @@ definitions:
handler.Update.response:
properties:
is_pro:
type: string
type: integer
message:
type: string
quota:
type: string
type: integer
quota_max:
type: string
type: integer
success:
type: string
type: boolean
user_id:
type: string
type: integer
user_key:
type: string
type: object
@@ -252,12 +261,18 @@ definitions:
type: object
handler.Upgrade.response:
properties:
data:
$ref: '#/definitions/models.ShortCompatMessage'
is_pro:
type: boolean
message:
type: string
quota:
type: integer
quota_max:
type: integer
success:
type: string
type: boolean
user_id:
type: integer
type: object
handler.pingResponse:
properties:
@@ -326,11 +341,13 @@ definitions:
priority:
type: integer
scn_msg_id:
type: string
type: integer
timestamp:
type: integer
title:
type: string
trimmed:
type: boolean
usr_msg_id:
type: string
type: object
@@ -359,23 +376,6 @@ definitions:
usr_message_id:
type: string
type: object
models.ShortCompatMessage:
properties:
body:
type: string
priority:
type: integer
scn_msg_id:
type: string
timestamp:
type: integer
title:
type: string
trimmed:
type: boolean
usr_msg_id:
type: string
type: object
models.SubscriptionJSON:
properties:
channel_id:
@@ -1076,6 +1076,7 @@ paths:
summary: Update a subscription (e.g. confirm)
/api/ack.php:
get:
deprecated: true
operationId: compat-ack
parameters:
- description: the user_id
@@ -1097,27 +1098,21 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Ack.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
$ref: '#/definitions/ginresp.compatAPIError'
summary: Acknowledge that a message was received
/api/expand.php:
get:
deprecated: true
operationId: compat-expand
responses:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Expand.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
$ref: '#/definitions/ginresp.compatAPIError'
summary: Get a whole (potentially truncated) message
/api/info.php:
get:
deprecated: true
operationId: compat-info
parameters:
- description: the user_id
@@ -1134,14 +1129,11 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Info.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
$ref: '#/definitions/ginresp.compatAPIError'
summary: Get information about the current user
/api/register.php:
get:
deprecated: true
operationId: compat-register
parameters:
- description: the (android) fcm token
@@ -1166,14 +1158,11 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Register.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
$ref: '#/definitions/ginresp.compatAPIError'
summary: Register a new account
/api/requery.php:
get:
deprecated: true
operationId: compat-requery
parameters:
- description: the user_id
@@ -1190,14 +1179,11 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Requery.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
$ref: '#/definitions/ginresp.compatAPIError'
summary: Return all not-acknowledged messages
/api/update.php:
get:
deprecated: true
operationId: compat-update
parameters:
- description: the user_id
@@ -1219,14 +1205,11 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Update.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
$ref: '#/definitions/ginresp.compatAPIError'
summary: Set the fcm-token (android)
/api/upgrade.php:
get:
deprecated: true
operationId: compat-upgrade
parameters:
- description: the user_id
@@ -1256,11 +1239,7 @@ paths:
"200":
description: OK
schema:
$ref: '#/definitions/handler.Upgrade.response'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/ginresp.apiError'
$ref: '#/definitions/ginresp.compatAPIError'
summary: Upgrade a free account to a paid account
/db-test:
get: