[//]: # ( README.md Fri 21 Jul 2023 12:24:22 MSK )

# WWW::Suffit

The Suffit core library

This library provides common functionality for all sub projects of the Suffit metasystem

## RU

������������ �������������������� WWW::Suffit

������������������ ���������� �������������������� [WWW::Suffit](https://metacpan.org/pod/WWW::Suffit), �� ���������� ������������ ���������������� ������������������������ �������� WWW::Suffit::* ���������� ������ [WWW::Suffit::Server](https://metacpan.org/pod/WWW::Suffit::Server) �� [WWW::Suffit::Client](https://metacpan.org/pod/WWW::Suffit::Client).
�������������������� ������������������ WWW::Suffit ������������������:

- ������������������ ���������������������� Mojolicious �������������������� �� ���������� Suffit;
- ������������������ �������������� �� ��������������, �������������������� ���� ������������������ Suffit API;
- ������������������������ ���� ������������������ �������������� ������������������������, �� ������ ���������� ���� CTK

�������������������� [WWW::Suffit](https://metacpan.org/pod/WWW::Suffit) ������������������ �������������������� �� ������������������ �������������� [Mojolicious](https://metacpan.org/pod/Mojolicious) 9.35

���������������� **Suffit API** ������ ���������������� ���������������� ������������ ���������������������� ���������� ���������������� �� ���������������� ������������ HTTP, �������������� ���������������������� ���� �������������������������� JSON �� ���������������� ���������� ������������������������ ������������ �� RESTful ������������������������ ������������ �������������� �������������� �� ��������������. ���� ���������������� ������������������������ Suffit API ���������� ���������������� ���������������������������������� �� ������������ ������������������������ ������������������������ OpenAPI. ���� �������� ������������������ ���������� ���������� ������������������ OpenAPI ������������������������ Suffit API ������������ 1.00

������������ ������������ ���������������������� ���������� ���������������� �� ���������������� ���� ������������������������ ������������������ **Suffit API**

**Request JSON:**

```json
{
  "base_url": "https://localhost:8695",
  "code": "E0000",
  "datetime": "2023-07-27T16:26:39Z",
  "message": "Ok",
  "remote_addr": "127.0.0.1",
  "requestid": "3a8cbe4f",
  "status": true,
  "time": 1682764944,
  "version": "1.00"
}
```

**Response JSON (Ok):**

```json
{
  "code": "E0000",
  "message": "Ok",
  "status": true
}
```

**Response JSON (Error):**

```json
{
  "code": "E0001",
  "message": "Oops",
  "status": false
}
```

### WWW::Suffit::Const

������������ �������������������� ������������������ ������������������ Suffit API, ������������ ���������� �� �������� ������������ �������������������� �������������� PurePerl ���������������� ������������������ ���������������� [FHS](https://www.pathname.com/fhs/pub/fhs-2.3.html), ������������������������ ���������������� ���������������������������� ���� ������������������ [Installation Directory Variables](http://www.gnu.org/software/autoconf/manual/html_node/Installation-Directory-Variables.html). ����������������, ������������������ *SHAREDSTATEDIR* ���������������� ���������������������� ���������������� `/var/lib`

### WWW::Suffit::Util

������������ ���������������� ������������������ �������������� ���������������������� ��������������, ���������������� �������������������������������� ���� ������������ [CTK::Util](https://metacpan.org/pod/CTK::Util). ������ ������������������ ������������ �������� ������������, ������ �������������� ���������� ���������������������� �������������� ������ �������������� �� ���������� ��������������, ������ [Mojo::Util](https://metacpan.org/pod/Mojo::Util). ���� ���������������� ����������������-������������ �������������� ���������� ���������������� ������������������: `dformat`, `fbytes`, `fduration`, `human2bytes`, `parse_time_offset`, `parse_expire`. ������������ �������������� ���������� ���������� ���� ����������������, ���� �������� �� �������� ������������ ���� ������������������ ���������� �������������������� ��������������

### WWW::Suffit::RefUtil

�������� ������������ �������������������� �� �������� ���������� ������������������ �������������� [Data::Util::PurePerl](https://metacpan.org/pod/Data::Util::PurePerl), [Params::Classify](https://metacpan.org/pod/Params::Classify), [Ref::Util](https://metacpan.org/pod/Ref::Util) �� [CTK::TFVals](https://metacpan.org/pod/CTK::TFVals) ���� ���������������������������� ���� ������ ������������ ���������� ������������ �� ���������� ������������������������. �������������� ���������� ���������������������� �������������� �������������������� XS ��������������, ���������� ������ �� ���������������� ���������� ���������� ������������ ���������������������� �������������� ���� ������������ Perl (PurePerl) �������������� �������������������������������������� �� ������������ �������������� ������������������������. ������������������ [Mojolicious](https://metacpan.org/pod/Mojolicious) �������������� �� ������������������ �������� ���������������� �� ������������������ ������������������ �� ������ ���������� ������������ �� ������������������ ��������������������. ���������� ��������������, ������ ���� ������ �������� ��������������������

### WWW::Suffit::API

������ ������������������ �������������������� ���������������������� �� ���������� �������������������������������� ���������������������� ���������������� �� ��������������. ������������ WWW::Suffit::API ���������������� �������������������� �������������� �� ������������������������ ���������� ������������������������. �� �������������������� �������� ������������ ���������� ���������������������� ������������ ���������������������� �� ���� ��������������������. ���� �������������� ������������ ������ ������������ "����������������"

### WWW::Suffit::Client

������ �������� �������������������� ������������, ������������������ ������ ������������������ �������������� ���������������������� ������������ - [WWW::Suffit::UserAgent](https://metacpan.org/pod/WWW::Suffit::UserAgent). [WWW::Suffit::Client](https://metacpan.org/pod/WWW::Suffit::Client) ������������������ ���������������������� �������������� �� ������������������, ���������������������� ���� ������������������ Suffit API. ���� �������������� ���������������������� 2 ������������������ - V1 �� NoAPI. V1 ������������ ���������������� ������������ Suffit API ������������ 1.xx (`authn`, `authz`, `pubkey`); NoAPI ������������ ���������������� ������������ ���� �������������������� Suffit API ����������������, ����������������: `manifest`, `download`, `upload` �� `remove`

### WWW::Suffit::Server

�������� �������������������� ������������ ������������������ ������������������ �������������� �� ����������������������, ����������������, ServerInfo. ������������ ���������� ������������ ������������������ ������������������ �������������� [Mojolicious](https://metacpan.org/pod/Mojolicious)

### WWW::Suffit::UserAgent

�������������������� ������������-�������������� [Mojo::UserAgent](https://metacpan.org/pod/Mojo::UserAgent). �������� ������������ ���������������� �� ������������������ ���������� �� ������������ ������������������ ���������������� ���� ������������ �������������� ������������ ������������. [WWW::Suffit::UserAgent](https://metacpan.org/pod/WWW::Suffit::UserAgent) ������������������ ������������ ���������������� �������������� �� ������������ ���������������� ������������������������ ������������������ Suffit API, ������������ ���������� ������������ ������������������ ���������� ���������������� ���������������������� API �������������� - `check`