From bf8a6bbdcea36be5442e0ed5a76a544c9a3dfe54 Mon Sep 17 00:00:00 2001 From: kogeletey Date: Tue, 20 Aug 2024 18:19:43 +0300 Subject: [PATCH] chore: rename of example --- README.md | 41 +++++++++++-------- example/.well-known/codeberg.org/wacli.json | 26 ------------ .../.well-known/git.0ut0f.space/wacli.json | 40 ++++++++++++++++++ 3 files changed, 63 insertions(+), 44 deletions(-) delete mode 100644 example/.well-known/codeberg.org/wacli.json create mode 100644 example/.well-known/git.0ut0f.space/wacli.json diff --git a/README.md b/README.md index 1e1ac4e..3efdacd 100644 --- a/README.md +++ b/README.md @@ -37,13 +37,13 @@ On your website you will need to use `.well-know/wacli.json` file: "contentType": "application/json", "aliases": [{ "alias": "" | ["short_hand","long_hand"], - "type": "path" | "method", + "type": "path" | "method" | "bin", "description": "description of cli command" - "path": "" + "content": "" }], "auth": { - "sheme": "basic" | "bearer" | "oauth2" - "token": "" // - bearer + "scheme": "basic" | "bearer" | "oauth2" + "tokenName": "" // - bearer // oauth2 "flows": { "implict": { @@ -60,50 +60,55 @@ On your website you will need to use `.well-know/wacli.json` file: ```json { - "api": "https://codeberg.org/api/v1", + "api": "https://git.0ut0f.space/swagger.v1.json", "settings": { "aliases": [ { - "alias": "i", + "alias": "issues", "type": "path", - "path": "/repos/{owner}/{repo}/issues" + "content": "/repos/{owner}/{repo}/issues" }, { - "alias": "create", + "alias": ["c","create"], "type": "method", - "method": "POST" + "content": "POST" }, { "alias": "tea", "type": "bin", - "bin": "tea" + "content": "tea" } ] }, "bin": { - "linux": [{"x86": "https://dl.gitea.com/tea/main/tea-main-linux-amd64.xz"}] + "linux": [{"x86": "https://dl.gitea.com/tea/main/tea-main-linux-amd64.xz"}], + "windows": [{"x86": "https://dl.gitea.com/tea/main/tea-main-windows-amd64.xz"}], + "darwin": [ + {"arm64": "https://dl.gitea.com/tea/main/tea-main-darwin-arm64"}, + {"x86": "https://dl.gitea.com/tea/main/tea-main-darwin-amd64.xz"} + ] } } ``` -Next REST API - `https://codeberg.org/api/v1/repos/{owner}/{repo}/issues` method is transform command: +Next REST API - `https://git.0ut0f.space/api/v1/repos/{owner}/{repo}/issues` method is transform command: By default - GET request: ```sh -wacli codeberg.org repos issues [owner] [repo] +wacli git.0ut0f.space repos issues [owner] [repo] ``` If you need a request other than GET, then add the command ```sh -wacli codeberg.org post|delete|put|path repos issues [owner] [repo] +wacli git.0ut0f.space post|delete|put|path repos issues [owner] [repo] ``` Such requests may require authorization, so you must log in separately: ```sh -wacli auth codeberg.org +wacli auth git.0ut0f.space ``` tokens are stored separately in the database. @@ -111,7 +116,7 @@ tokens are stored separately in the database. Methods can be overridden: ```sh -wacli codeberg.org create repos issues [owner] [repo] +wacli git.0ut0f.space create repos issues [owner] [repo] ``` By default, all request in clearnet and tor go via `https`, but i2p - `http`. @@ -119,7 +124,7 @@ By default, all request in clearnet and tor go via `https`, but i2p - `http`. But sometimes you need to specify a specific protocol ```sh -wacli bin "git+http://codeberg.org/" +wacli bin "git+http://git.0ut0f.space/" ``` Binaries is install of user directory `$HOME/.local/bin`, for root user - `/usr/local/bin`. @@ -127,7 +132,7 @@ Binaries is install of user directory `$HOME/.local/bin`, for root user - `/usr/ Perhaps not everyone will add tools to their sites, so for popular tools using directive: ```sh -wacli registry:codeberg repos issues +wacli registry:forgejo repos issues ``` You can also get help on all api methods using the command diff --git a/example/.well-known/codeberg.org/wacli.json b/example/.well-known/codeberg.org/wacli.json deleted file mode 100644 index a860f76..0000000 --- a/example/.well-known/codeberg.org/wacli.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "api": "https://codeberg.org/api/v1", - "settings": { - "aliases": [ - { - "alias": "i", - "type": "path", - "path": "/repos/{owner}/{repo}/issues" - }, - { - "alias": "create", - "type": "method", - "method": "POST" - }, - { - "alias": "tea", - "type": "bin", - "bin": "tea" - } - ] - }, - "bin": { - "linux": [{"x86": "https://dl.gitea.com/tea/main/tea-main-linux-amd64.xz"}] - } -} - diff --git a/example/.well-known/git.0ut0f.space/wacli.json b/example/.well-known/git.0ut0f.space/wacli.json new file mode 100644 index 0000000..03568a4 --- /dev/null +++ b/example/.well-known/git.0ut0f.space/wacli.json @@ -0,0 +1,40 @@ +{ + "api": "https://git.0ut0f.space/swagger.v1.json", + "settings": { + "auth": { + "scheme": "bearer", + "tokenName": "AuthorizationHeaderToken" + }, + "aliases": [ + { + "alias": "issues", + "type": "path", + "content": "/repos/{owner}/{repo}/issues" + }, + { + "alias": ["c","create"], + "type": "method", + "content": "POST" + }, + { + "alias": ["d","delete"], + "type": "method", + "content": "DELETE" + }, + { + "alias": "tea", + "type": "bin", + "content": "tea" + } + ] + }, + "bin": { + "linux": [{"x86": "https://dl.gitea.com/tea/main/tea-main-linux-amd64.xz"}], + "windows": [{"x86": "https://dl.gitea.com/tea/main/tea-main-windows-amd64.xz"}], + "darwin": [ + {"arm64": "https://dl.gitea.com/tea/main/tea-main-darwin-arm64"}, + {"x86": "https://dl.gitea.com/tea/main/tea-main-darwin-amd64.xz"} + ] + } +} +