Add settings service to messaging
This commit is contained in:
@@ -1245,5 +1245,91 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Settings",
|
||||
"path": "/settings",
|
||||
"entrypoint": "settings",
|
||||
"authentication": [],
|
||||
"struct": [{
|
||||
"imports": [
|
||||
"sqlxTypes github.com/jmoiron/sqlx/types"
|
||||
]
|
||||
}],
|
||||
"apis": [{
|
||||
"name": "list",
|
||||
"method": "GET",
|
||||
"title": "List settings",
|
||||
"path": "/",
|
||||
"parameters": {
|
||||
"get": [
|
||||
{
|
||||
"name": "prefix",
|
||||
"type": "string",
|
||||
"title": "Key prefix"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "update",
|
||||
"method": "PATCH",
|
||||
"title": "Update settings",
|
||||
"path": "/",
|
||||
"parameters": {
|
||||
"post": [{
|
||||
"name": "values",
|
||||
"type": "sqlxTypes.JSONText",
|
||||
"title": "Array of new settings: `[{ name: ..., value: ... }]`. Omit value to remove setting",
|
||||
"required": true
|
||||
}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "get",
|
||||
"method": "GET",
|
||||
"title": "Get a value for a key",
|
||||
"path": "/{key}",
|
||||
"parameters": {
|
||||
"path": [{
|
||||
"name": "key",
|
||||
"type": "string",
|
||||
"title": "Setting key",
|
||||
"required": true
|
||||
}],
|
||||
"get": [{
|
||||
"name": "ownerID",
|
||||
"type": "uint64",
|
||||
"title": "Owner ID"
|
||||
}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "set",
|
||||
"method": "PUT",
|
||||
"title": "Set a value for a key",
|
||||
"path": "/{key}",
|
||||
"parameters": {
|
||||
"path": [{
|
||||
"name": "key",
|
||||
"type": "string",
|
||||
"title": "Setting key",
|
||||
"required": true
|
||||
}],
|
||||
"post": [{
|
||||
"name": "ownerID",
|
||||
"type": "uint64",
|
||||
"title": "Owner"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"type": "sqlxTypes.JSONText",
|
||||
"required": true,
|
||||
"title": "Setting value"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
100
api/messaging/spec/settings.json
Normal file
100
api/messaging/spec/settings.json
Normal file
@@ -0,0 +1,100 @@
|
||||
{
|
||||
"Title": "Settings",
|
||||
"Interface": "Settings",
|
||||
"Struct": [
|
||||
{
|
||||
"imports": [
|
||||
"sqlxTypes github.com/jmoiron/sqlx/types"
|
||||
]
|
||||
}
|
||||
],
|
||||
"Parameters": null,
|
||||
"Protocol": "",
|
||||
"Authentication": [],
|
||||
"Path": "/settings",
|
||||
"APIs": [
|
||||
{
|
||||
"Name": "list",
|
||||
"Method": "GET",
|
||||
"Title": "List settings",
|
||||
"Path": "/",
|
||||
"Parameters": {
|
||||
"get": [
|
||||
{
|
||||
"name": "prefix",
|
||||
"title": "Key prefix",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "update",
|
||||
"Method": "PATCH",
|
||||
"Title": "Update settings",
|
||||
"Path": "/",
|
||||
"Parameters": {
|
||||
"post": [
|
||||
{
|
||||
"name": "values",
|
||||
"required": true,
|
||||
"title": "Array of new settings: `[{ name: ..., value: ... }]`. Omit value to remove setting",
|
||||
"type": "sqlxTypes.JSONText"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "get",
|
||||
"Method": "GET",
|
||||
"Title": "Get a value for a key",
|
||||
"Path": "/{key}",
|
||||
"Parameters": {
|
||||
"get": [
|
||||
{
|
||||
"name": "ownerID",
|
||||
"title": "Owner ID",
|
||||
"type": "uint64"
|
||||
}
|
||||
],
|
||||
"path": [
|
||||
{
|
||||
"name": "key",
|
||||
"required": true,
|
||||
"title": "Setting key",
|
||||
"type": "string"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"Name": "set",
|
||||
"Method": "PUT",
|
||||
"Title": "Set a value for a key",
|
||||
"Path": "/{key}",
|
||||
"Parameters": {
|
||||
"path": [
|
||||
{
|
||||
"name": "key",
|
||||
"required": true,
|
||||
"title": "Setting key",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"post": [
|
||||
{
|
||||
"name": "ownerID",
|
||||
"title": "Owner",
|
||||
"type": "uint64"
|
||||
},
|
||||
{
|
||||
"name": "value",
|
||||
"required": true,
|
||||
"title": "Setting value",
|
||||
"type": "sqlxTypes.JSONText"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user