Skip to content

Commit

Permalink
[web-server-plugin][ws-server-plugin] Updating documentation (#250)
Browse files Browse the repository at this point in the history
* Updating documentation

* Fix after upgraded library
  • Loading branch information
akadlec authored Feb 27, 2024
1 parent cc4c92d commit 0dd2cf6
Show file tree
Hide file tree
Showing 19 changed files with 167 additions and 1,058 deletions.
915 changes: 10 additions & 905 deletions .editorconfig

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
use Doctrine\Common;
use Doctrine\ORM;
use FastyBird\Module\Devices\Entities;
use FastyBird\Module\Devices\Exceptions;
use IPub\DoctrineOrmQuery;
use Ramsey\Uuid;
use function in_array;

/**
* Find channel controls entities query
Expand Down Expand Up @@ -72,17 +70,13 @@ public function byChannelId(Uuid\UuidInterface $channelId): void
};
}

/**
* @throws Exceptions\InvalidArgument
*/
public function sortBy(string $sortBy, string $sortDir = Common\Collections\Criteria::ASC): void
public function sortBy(
string $sortBy,
Common\Collections\Order $sortDir = Common\Collections\Order::Ascending,
): void
{
if (!in_array($sortDir, [Common\Collections\Criteria::ASC, Common\Collections\Criteria::DESC], true)) {
throw new Exceptions\InvalidArgument('Provided sortDir value is not valid.');
}

$this->filter[] = static function (ORM\QueryBuilder $qb) use ($sortBy, $sortDir): void {
$qb->addOrderBy($sortBy, $sortDir);
$qb->addOrderBy($sortBy, $sortDir->value);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
use Doctrine\Common;
use Doctrine\ORM;
use FastyBird\Module\Devices\Entities;
use FastyBird\Module\Devices\Exceptions;
use IPub\DoctrineOrmQuery;
use Ramsey\Uuid;
use function in_array;

/**
* Find channel properties entities query
Expand Down Expand Up @@ -116,17 +114,13 @@ public function queryable(bool $state): void
};
}

/**
* @throws Exceptions\InvalidArgument
*/
public function sortBy(string $sortBy, string $sortDir = Common\Collections\Criteria::ASC): void
public function sortBy(
string $sortBy,
Common\Collections\Order $sortDir = Common\Collections\Order::Ascending,
): void
{
if (!in_array($sortDir, [Common\Collections\Criteria::ASC, Common\Collections\Criteria::DESC], true)) {
throw new Exceptions\InvalidArgument('Provided sortDir value is not valid.');
}

$this->filter[] = static function (ORM\QueryBuilder $qb) use ($sortBy, $sortDir): void {
$qb->addOrderBy($sortBy, $sortDir);
$qb->addOrderBy($sortBy, $sortDir->value);
};
}

Expand Down
16 changes: 5 additions & 11 deletions src/FastyBird/Module/Devices/src/Queries/Entities/FindChannels.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
use Doctrine\Common;
use Doctrine\ORM;
use FastyBird\Module\Devices\Entities;
use FastyBird\Module\Devices\Exceptions;
use IPub\DoctrineOrmQuery;
use Ramsey\Uuid;
use function in_array;

/**
* Find device channels entities query
Expand Down Expand Up @@ -113,17 +111,13 @@ public function withSettableProperties(): void
};
}

/**
* @throws Exceptions\InvalidArgument
*/
public function sortBy(string $sortBy, string $sortDir = Common\Collections\Criteria::ASC): void
public function sortBy(
string $sortBy,
Common\Collections\Order $sortDir = Common\Collections\Order::Ascending,
): void
{
if (!in_array($sortDir, [Common\Collections\Criteria::ASC, Common\Collections\Criteria::DESC], true)) {
throw new Exceptions\InvalidArgument('Provided sortDir value is not valid.');
}

$this->filter[] = static function (ORM\QueryBuilder $qb) use ($sortBy, $sortDir): void {
$qb->addOrderBy($sortBy, $sortDir);
$qb->addOrderBy($sortBy, $sortDir->value);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
use Doctrine\Common;
use Doctrine\ORM;
use FastyBird\Module\Devices\Entities;
use FastyBird\Module\Devices\Exceptions;
use IPub\DoctrineOrmQuery;
use Ramsey\Uuid;
use function in_array;

/**
* Find connector properties entities query
Expand Down Expand Up @@ -72,17 +70,13 @@ public function byConnectorId(Uuid\UuidInterface $connectorId): void
};
}

/**
* @throws Exceptions\InvalidArgument
*/
public function sortBy(string $sortBy, string $sortDir = Common\Collections\Criteria::ASC): void
public function sortBy(
string $sortBy,
Common\Collections\Order $sortDir = Common\Collections\Order::Ascending,
): void
{
if (!in_array($sortDir, [Common\Collections\Criteria::ASC, Common\Collections\Criteria::DESC], true)) {
throw new Exceptions\InvalidArgument('Provided sortDir value is not valid.');
}

$this->filter[] = static function (ORM\QueryBuilder $qb) use ($sortBy, $sortDir): void {
$qb->addOrderBy($sortBy, $sortDir);
$qb->addOrderBy($sortBy, $sortDir->value);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
use Doctrine\Common;
use Doctrine\ORM;
use FastyBird\Module\Devices\Entities;
use FastyBird\Module\Devices\Exceptions;
use IPub\DoctrineOrmQuery;
use Ramsey\Uuid;
use function in_array;

/**
* Find connector properties entities query
Expand Down Expand Up @@ -101,17 +99,13 @@ public function queryable(bool $state): void
};
}

/**
* @throws Exceptions\InvalidArgument
*/
public function sortBy(string $sortBy, string $sortDir = Common\Collections\Criteria::ASC): void
public function sortBy(
string $sortBy,
Common\Collections\Order $sortDir = Common\Collections\Order::Ascending,
): void
{
if (!in_array($sortDir, [Common\Collections\Criteria::ASC, Common\Collections\Criteria::DESC], true)) {
throw new Exceptions\InvalidArgument('Provided sortDir value is not valid.');
}

$this->filter[] = static function (ORM\QueryBuilder $qb) use ($sortBy, $sortDir): void {
$qb->addOrderBy($sortBy, $sortDir);
$qb->addOrderBy($sortBy, $sortDir->value);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
use Doctrine\Common;
use Doctrine\ORM;
use FastyBird\Module\Devices\Entities;
use FastyBird\Module\Devices\Exceptions;
use IPub\DoctrineOrmQuery;
use Ramsey\Uuid;
use function in_array;

/**
* Find connectors entities query
Expand Down Expand Up @@ -57,17 +55,13 @@ public function byIdentifier(string $identifier): void
};
}

/**
* @throws Exceptions\InvalidArgument
*/
public function sortBy(string $sortBy, string $sortDir = Common\Collections\Criteria::ASC): void
public function sortBy(
string $sortBy,
Common\Collections\Order $sortDir = Common\Collections\Order::Ascending,
): void
{
if (!in_array($sortDir, [Common\Collections\Criteria::ASC, Common\Collections\Criteria::DESC], true)) {
throw new Exceptions\InvalidArgument('Provided sortDir value is not valid.');
}

$this->filter[] = static function (ORM\QueryBuilder $qb) use ($sortBy, $sortDir): void {
$qb->addOrderBy($sortBy, $sortDir);
$qb->addOrderBy($sortBy, $sortDir->value);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
use Doctrine\Common;
use Doctrine\ORM;
use FastyBird\Module\Devices\Entities;
use FastyBird\Module\Devices\Exceptions;
use IPub\DoctrineOrmQuery;
use Ramsey\Uuid;
use function in_array;

/**
* Find device controls entities query
Expand Down Expand Up @@ -72,17 +70,13 @@ public function byDeviceId(Uuid\UuidInterface $deviceId): void
};
}

/**
* @throws Exceptions\InvalidArgument
*/
public function sortBy(string $sortBy, string $sortDir = Common\Collections\Criteria::ASC): void
public function sortBy(
string $sortBy,
Common\Collections\Order $sortDir = Common\Collections\Order::Ascending,
): void
{
if (!in_array($sortDir, [Common\Collections\Criteria::ASC, Common\Collections\Criteria::DESC], true)) {
throw new Exceptions\InvalidArgument('Provided sortDir value is not valid.');
}

$this->filter[] = static function (ORM\QueryBuilder $qb) use ($sortBy, $sortDir): void {
$qb->addOrderBy($sortBy, $sortDir);
$qb->addOrderBy($sortBy, $sortDir->value);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
use Doctrine\Common;
use Doctrine\ORM;
use FastyBird\Module\Devices\Entities;
use FastyBird\Module\Devices\Exceptions;
use IPub\DoctrineOrmQuery;
use Ramsey\Uuid;
use function in_array;

/**
* Find device properties entities query
Expand Down Expand Up @@ -116,17 +114,13 @@ public function queryable(bool $state): void
};
}

/**
* @throws Exceptions\InvalidArgument
*/
public function sortBy(string $sortBy, string $sortDir = Common\Collections\Criteria::ASC): void
public function sortBy(
string $sortBy,
Common\Collections\Order $sortDir = Common\Collections\Order::Ascending,
): void
{
if (!in_array($sortDir, [Common\Collections\Criteria::ASC, Common\Collections\Criteria::DESC], true)) {
throw new Exceptions\InvalidArgument('Provided sortDir value is not valid.');
}

$this->filter[] = static function (ORM\QueryBuilder $qb) use ($sortBy, $sortDir): void {
$qb->addOrderBy($sortBy, $sortDir);
$qb->addOrderBy($sortBy, $sortDir->value);
};
}

Expand Down
16 changes: 5 additions & 11 deletions src/FastyBird/Module/Devices/src/Queries/Entities/FindDevices.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
use Doctrine\Common;
use Doctrine\ORM;
use FastyBird\Module\Devices\Entities;
use FastyBird\Module\Devices\Exceptions;
use IPub\DoctrineOrmQuery;
use Ramsey\Uuid;
use function in_array;

/**
* Find devices entities query
Expand Down Expand Up @@ -144,17 +142,13 @@ public function withChannels(): void
};
}

/**
* @throws Exceptions\InvalidArgument
*/
public function sortBy(string $sortBy, string $sortDir = Common\Collections\Criteria::ASC): void
public function sortBy(
string $sortBy,
Common\Collections\Order $sortDir = Common\Collections\Order::Ascending,
): void
{
if (!in_array($sortDir, [Common\Collections\Criteria::ASC, Common\Collections\Criteria::DESC], true)) {
throw new Exceptions\InvalidArgument('Provided sortDir value is not valid.');
}

$this->filter[] = static function (ORM\QueryBuilder $qb) use ($sortBy, $sortDir): void {
$qb->addOrderBy($sortBy, $sortDir);
$qb->addOrderBy($sortBy, $sortDir->value);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
use Doctrine\Common;
use Doctrine\ORM;
use FastyBird\Module\Triggers\Entities;
use FastyBird\Module\Triggers\Exceptions;
use IPub\DoctrineOrmQuery;
use Ramsey\Uuid;
use function in_array;

/**
* Find trigger properties entities query
Expand Down Expand Up @@ -71,17 +69,13 @@ public function forTrigger(Entities\Triggers\Trigger $trigger): void
};
}

/**
* @throws Exceptions\InvalidArgument
*/
public function sortBy(string $sortBy, string $sortDir = Common\Collections\Criteria::ASC): void
public function sortBy(
string $sortBy,
Common\Collections\Order $sortDir = Common\Collections\Order::Ascending,
): void
{
if (!in_array($sortDir, [Common\Collections\Criteria::ASC, Common\Collections\Criteria::DESC], true)) {
throw new Exceptions\InvalidArgument('Provided sortDir value is not valid.');
}

$this->filter[] = static function (ORM\QueryBuilder $qb) use ($sortBy, $sortDir): void {
$qb->addOrderBy($sortBy, $sortDir);
$qb->addOrderBy($sortBy, $sortDir->value);
};
}

Expand Down
22 changes: 22 additions & 0 deletions src/FastyBird/Plugin/WebServer/.github/workflows/wiki.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "wiki"

on:
push:
branches:
- "main"

jobs:
deploy:
name: "Deploy docs to wiki"
runs-on: "ubuntu-latest"

steps:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Deploy to Wiki"
uses: "SwiftDocOrg/github-wiki-publish-action@v1"
with:
path: "docs"
env:
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
5 changes: 2 additions & 3 deletions src/FastyBird/Plugin/WebServer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ composer require fastybird/web-server-plugin

## Documentation

Learn how to build and handle http api requests
in [documentation](https://github.com/FastyBird/web-server-plugin/blob/main/docs/index.md).
:book: Learn how to build and handle http api requests in [documentation](https://github.com/FastyBird/web-server-plugin/wiki).

# FastyBird

Expand All @@ -54,7 +53,7 @@ FastyBird is an Open Source IOT solution built from decoupled components with po

## Documentation

Documentation is available on [docs.fastybird.com](https://docs.fastybird.com).
:book: Documentation is available on [docs.fastybird.com](https://docs.fastybird.com).

## Contributing

Expand Down
Loading

0 comments on commit 0dd2cf6

Please sign in to comment.