mirror of
https://github.com/chenasraf/nextcloud-autocurrency.git
synced 2026-05-17 17:28:06 +00:00
631 lines
29 KiB
JSON
631 lines
29 KiB
JSON
{
|
|
"openapi": "3.0.3",
|
|
"info": {
|
|
"title": "autocurrency",
|
|
"version": "0.0.1",
|
|
"description": "Automatically fills the currency rates for your Cospend projects daily.",
|
|
"license": {
|
|
"name": "agpl"
|
|
}
|
|
},
|
|
"components": {
|
|
"securitySchemes": {
|
|
"basic_auth": {
|
|
"type": "http",
|
|
"scheme": "basic"
|
|
},
|
|
"bearer_auth": {
|
|
"type": "http",
|
|
"scheme": "bearer"
|
|
}
|
|
},
|
|
"schemas": {
|
|
"OCSMeta": {
|
|
"type": "object",
|
|
"required": [
|
|
"status",
|
|
"statuscode"
|
|
],
|
|
"properties": {
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"statuscode": {
|
|
"type": "integer"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"totalitems": {
|
|
"type": "string"
|
|
},
|
|
"itemsperpage": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"paths": {
|
|
"/ocs/v2.php/apps/autocurrency/api/user-settings": {
|
|
"get": {
|
|
"operationId": "api-get-user-settings",
|
|
"summary": "Get current user settings",
|
|
"tags": [
|
|
"api"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearer_auth": []
|
|
},
|
|
{
|
|
"basic_auth": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "OCS-APIRequest",
|
|
"in": "header",
|
|
"description": "Required to be true for the API request to pass",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": true
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Data returned",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {
|
|
"type": "object",
|
|
"required": [
|
|
"supported_currencies"
|
|
],
|
|
"properties": {
|
|
"supported_currencies": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": [
|
|
"code",
|
|
"symbol",
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"code": {
|
|
"type": "string"
|
|
},
|
|
"symbol": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Current user is not logged in",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/ocs/v2.php/apps/autocurrency/api/crypto-currencies": {
|
|
"get": {
|
|
"operationId": "api-get-crypto-currencies",
|
|
"summary": "Get crypto currencies with pagination and search",
|
|
"tags": [
|
|
"api"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearer_auth": []
|
|
},
|
|
{
|
|
"basic_auth": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "search",
|
|
"in": "query",
|
|
"description": "Search query to filter by code or name",
|
|
"schema": {
|
|
"type": "string",
|
|
"nullable": true,
|
|
"default": null
|
|
}
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"in": "query",
|
|
"description": "Max results per page",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"default": 50,
|
|
"minimum": 1,
|
|
"maximum": 200
|
|
}
|
|
},
|
|
{
|
|
"name": "offset",
|
|
"in": "query",
|
|
"description": "Offset for pagination",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"default": 0
|
|
}
|
|
},
|
|
{
|
|
"name": "OCS-APIRequest",
|
|
"in": "header",
|
|
"description": "Required to be true for the API request to pass",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": true
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Data returned",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {
|
|
"type": "object",
|
|
"required": [
|
|
"currencies",
|
|
"total"
|
|
],
|
|
"properties": {
|
|
"currencies": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": [
|
|
"code",
|
|
"symbol",
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"code": {
|
|
"type": "string"
|
|
},
|
|
"symbol": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"total": {
|
|
"type": "integer",
|
|
"format": "int64"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Current user is not logged in",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/ocs/v2.php/apps/autocurrency/api/projects": {
|
|
"get": {
|
|
"operationId": "api-get-projects",
|
|
"summary": "List Cospend projects owned by calling user",
|
|
"tags": [
|
|
"api"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearer_auth": []
|
|
},
|
|
{
|
|
"basic_auth": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "OCS-APIRequest",
|
|
"in": "header",
|
|
"description": "Required to be true for the API request to pass",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": true
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Data returned",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {
|
|
"type": "object",
|
|
"required": [
|
|
"projects"
|
|
],
|
|
"properties": {
|
|
"projects": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": [
|
|
"id",
|
|
"name",
|
|
"currencyName"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"currencyName": {
|
|
"type": "string",
|
|
"nullable": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Current user is not logged in",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/ocs/v2.php/apps/autocurrency/api/history": {
|
|
"get": {
|
|
"operationId": "api-get-history",
|
|
"summary": "Get rate history for a project (uses the project's base currency)",
|
|
"tags": [
|
|
"api"
|
|
],
|
|
"security": [
|
|
{
|
|
"bearer_auth": []
|
|
},
|
|
{
|
|
"basic_auth": []
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "projectId",
|
|
"in": "query",
|
|
"description": "Project ID (required)",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
{
|
|
"name": "currency",
|
|
"in": "query",
|
|
"description": "Quoted currency code to filter (e.g. \"eur\")",
|
|
"schema": {
|
|
"type": "string",
|
|
"nullable": true,
|
|
"default": null
|
|
}
|
|
},
|
|
{
|
|
"name": "from",
|
|
"in": "query",
|
|
"description": "ISO-8601 datetime (inclusive)",
|
|
"schema": {
|
|
"type": "string",
|
|
"nullable": true,
|
|
"default": null
|
|
}
|
|
},
|
|
{
|
|
"name": "to",
|
|
"in": "query",
|
|
"description": "ISO-8601 datetime (inclusive)",
|
|
"schema": {
|
|
"type": "string",
|
|
"nullable": true,
|
|
"default": null
|
|
}
|
|
},
|
|
{
|
|
"name": "limit",
|
|
"in": "query",
|
|
"description": "Max rows to return (optional)",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"nullable": true,
|
|
"default": null,
|
|
"minimum": 1,
|
|
"maximum": 1000
|
|
}
|
|
},
|
|
{
|
|
"name": "offset",
|
|
"in": "query",
|
|
"description": "Offset for pagination (optional)",
|
|
"schema": {
|
|
"type": "integer",
|
|
"format": "int64",
|
|
"nullable": true,
|
|
"default": null
|
|
}
|
|
},
|
|
{
|
|
"name": "OCS-APIRequest",
|
|
"in": "header",
|
|
"description": "Required to be true for the API request to pass",
|
|
"required": true,
|
|
"schema": {
|
|
"type": "boolean",
|
|
"default": true
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Data returned",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {
|
|
"type": "object",
|
|
"required": [
|
|
"projectId",
|
|
"baseCurrency",
|
|
"points"
|
|
],
|
|
"properties": {
|
|
"projectId": {
|
|
"type": "string"
|
|
},
|
|
"baseCurrency": {
|
|
"type": "string"
|
|
},
|
|
"points": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"required": [
|
|
"fetchedAt",
|
|
"rate",
|
|
"currencyName",
|
|
"source"
|
|
],
|
|
"properties": {
|
|
"fetchedAt": {
|
|
"type": "string"
|
|
},
|
|
"rate": {
|
|
"type": "string"
|
|
},
|
|
"currencyName": {
|
|
"type": "string"
|
|
},
|
|
"source": {
|
|
"type": "string",
|
|
"nullable": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Current user is not logged in",
|
|
"content": {
|
|
"application/json": {
|
|
"schema": {
|
|
"type": "object",
|
|
"required": [
|
|
"ocs"
|
|
],
|
|
"properties": {
|
|
"ocs": {
|
|
"type": "object",
|
|
"required": [
|
|
"meta",
|
|
"data"
|
|
],
|
|
"properties": {
|
|
"meta": {
|
|
"$ref": "#/components/schemas/OCSMeta"
|
|
},
|
|
"data": {}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"tags": []
|
|
}
|