> For the complete documentation index, see [llms.txt](https://webside.gitbook.io/webside/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://webside.gitbook.io/webside/api/code/packages.md).

# Packages

While not every Smalltalk call them *packages*, they all manage some sort of code bundles, essentially a named bunch of classes and methods, sometimes global definitions, an additional description, etc.\
There are some aspects however, that are specific to a given Smalltalk. For instance, there are *tags* in Pharo (class categories), an optional *packageVersion* in Dolphin, or even *children* in Bee, forming a *project hierarchy*.

For the sake of generality, Webside expects this package structure:

```json
{
	"name": "string",
	"description": "boolean",
	"classes": ["string"],
	"methods": {
		"[classname]": ["string"]
	}
}
```

Where

* `classes` is the names of the classes defined in the package, and
* `methods` is the list of extensions, grouped by class name.

## Endpoints

| Method | Path                                                            | Description                                |                Parameters               | Payload |
| :----: | --------------------------------------------------------------- | ------------------------------------------ | :-------------------------------------: | ------- |
|   GET  | [/packages](/webside/api/code/packages/get.md)                  | Retrieve all packages                      |                 `names`                 | -       |
|   GET  | [/packages/{name}](/webside/api/code/packages/get-1.md)         | Retrieve a given package                   |                    -                    | -       |
|   GET  | [/packages/{name}/classes](broken://pages/JjES9f2xmJrd1sK5y45E) | Retrieve actual classes of a given package | `extended`, `tree`, `names`, `category` | -       |
|   GET  | [/packages/{name}/methods](broken://pages/AjHS000FrWdcj2F4zqtN) | Retrieve actual methods of a given package |                    -                    | -       |
