# 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](https://webside.gitbook.io/webside/api/code/packages/get)                    | Retrieve all packages                      |                 `names`                 | -       |
|   GET  | [/packages/{name}](https://webside.gitbook.io/webside/api/code/packages/get-1)           | Retrieve a given package                   |                    -                    | -       |
|   GET  | [/packages/{name}/classes](https://webside.gitbook.io/webside/api/code/broken-reference) | Retrieve actual classes of a given package | `extended`, `tree`, `names`, `category` | -       |
|   GET  | [/packages/{name}/methods](https://webside.gitbook.io/webside/api/code/broken-reference) | Retrieve actual methods of a given package |                    -                    | -       |
