yesser-todo-api 4.0.0

A wrapper for yesser-todo-server written in Rust
Documentation
# yesser-todo-cli

a CLI app for managing your tasks

# Installation

## Cargo

If you have Cargo installed (on any platform), you can install with:

```bash
cargo install yesser-todo-cli
```

## Windows

On Windows, you can use the MSI installer in the releases page.
You can also use the Scoop from the yesser-studios bucket:

```pwsh
scoop bucket add yesser-studios https://github.com/yesser-studios/scoop-bucket
scoop install yesser-todo-cli
```

## macOS

You can use the yesser-studios Homebrew tap:

```bash
brew tap yesser-studios/tap
brew install yesser-todo-cli
```

## Linux

On Fedora 41-43 or Rawhide, you can use the yesser-studios COPR:

```bash
sudo dnf copr enable yesseruser/yesser-studios
sudo dnf install yesser-todo-cli
```

On other distributions, you will need to use cargo or build the project from source.

# Server

## Usage guide:

Run the `yesser-todo-server` crate. This will open port 6982 and listen for HTTP traffic.

## Endpoints

- `GET /tasks` returns a JSON containing an array of `Task` objects, such as: `[{name: "example", done: true}]`
- `POST /add` accepts a body JSON representation of a string, such as: `"example"`.
  This string will be used as the name for a new task. Returns a JSON of the generated `Task` object.
- `DELETE /remove` accepts a body JSON representation of an integer, such as: `5`.
  The task with the index of the given integer will be deleted. The index can be queried with `GET /index` (see below)
- `POST /done` accepts a body JSON representation of an integer, such as: `5`.
  The task with the given index will be marked as done. Returns a JSON of the modified `Task` object.
- `POST /undone` accepts a body JSON representation of an integer, such as: `5`.
  The task with the given index will be marked as undone. Returns a JSON of the modified `Task` object.
- `DELETE /clear` will delete all tasks.
- `DELETE /cleardone` will delete all tasks marked as done.
- `GET /index` accepts a body JSON representation of a string.
  It will return the index at which the given string first appears.

# Publishing (for maintainers)

## Crates.io

_Note: Make sure you're logged in with `cargo login`_

Run `cargo install cargo-release` to install the cargo-publish tool,
then run `cargo release <BUMP>` to bump the version and publish. This will automatically create a git commit and tag.

## Homebrew

First, create a GitHub release to make a tag for Homebrew to download.
Then, download the source code as a `.tar.gz` file, generate a sha256 hash, and add the hash and link to the formula.
Next, on both an ARM64 macOS machine run `brew install --build-bottle --bottle-arch=arm64_sonoma yesser-todo-cli`.
On a x64 Linux machine run `brew install --build-bottle --bottle-arch=x86_64_linux yesser-todo-cli`.
On both machines, run `brew bottle yesser-todo-cli` and upload the file to GitHub releases.
Generate a sha256 hash for the file and replace the corresponding field in the formula.
Make sure to change the `root_url` as well. Also, change the version in the test's assertion.

## Windows build

cargo-wix uses WiX v3, which is not available anymore. We will not be publishing .msi packages until cargo-wix updates or we find a different CI-compatible .msi packager.
.zip bundles are built automatically by CI on releases.

## Fedora COPR build

1. On a Fedora machine with rpm build tools and rust2rpm installed, run the update.sh script located at https://github.com/yesser-studios/rpms/tree/main/yesser-todo-cli.
2. Commit and push the changes. COPR should build the new commit automatically.