2018-12-01 12:57:02 +00:00
|
|
|
<?php
|
|
|
|
|
|
2020-09-10 19:59:26 +00:00
|
|
|
namespace BeyondCode\LaravelWebSockets\Contracts;
|
|
|
|
|
|
|
|
|
|
use BeyondCode\LaravelWebSockets\Apps\App;
|
2022-10-06 11:46:54 +00:00
|
|
|
use React\Promise\PromiseInterface;
|
2018-12-01 12:57:02 +00:00
|
|
|
|
2020-08-13 11:51:18 +00:00
|
|
|
interface AppManager
|
2018-12-01 12:57:02 +00:00
|
|
|
{
|
2020-08-18 17:21:44 +00:00
|
|
|
/**
|
2020-08-18 17:21:22 +00:00
|
|
|
* Get all apps.
|
|
|
|
|
*
|
2022-10-06 11:46:54 +00:00
|
|
|
* @return PromiseInterface
|
2020-08-18 17:21:22 +00:00
|
|
|
*/
|
2022-10-06 11:46:54 +00:00
|
|
|
public function all(): PromiseInterface;
|
2018-12-01 12:57:02 +00:00
|
|
|
|
2020-08-18 17:21:22 +00:00
|
|
|
/**
|
|
|
|
|
* Get app by id.
|
|
|
|
|
*
|
2020-09-04 13:23:24 +00:00
|
|
|
* @param string|int $appId
|
2022-10-06 11:46:54 +00:00
|
|
|
* @return PromiseInterface
|
2020-08-18 17:21:22 +00:00
|
|
|
*/
|
2022-10-06 11:46:54 +00:00
|
|
|
public function findById($appId): PromiseInterface;
|
2018-12-01 12:57:02 +00:00
|
|
|
|
2020-08-18 17:21:22 +00:00
|
|
|
/**
|
|
|
|
|
* Get app by app key.
|
|
|
|
|
*
|
2020-09-04 01:10:50 +00:00
|
|
|
* @param string $appKey
|
2022-10-06 11:46:54 +00:00
|
|
|
* @return PromiseInterface
|
2020-08-18 17:21:22 +00:00
|
|
|
*/
|
2022-10-06 11:46:54 +00:00
|
|
|
public function findByKey($appKey): PromiseInterface;
|
2018-12-04 09:15:37 +00:00
|
|
|
|
2020-08-18 17:21:22 +00:00
|
|
|
/**
|
|
|
|
|
* Get app by secret.
|
|
|
|
|
*
|
2020-09-04 01:10:50 +00:00
|
|
|
* @param string $appSecret
|
2022-10-06 11:46:54 +00:00
|
|
|
* @return PromiseInterface
|
2020-08-18 17:21:22 +00:00
|
|
|
*/
|
2022-10-06 11:46:54 +00:00
|
|
|
public function findBySecret($appSecret): PromiseInterface;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Create a new app.
|
|
|
|
|
*
|
|
|
|
|
* @param $appData
|
|
|
|
|
* @return PromiseInterface
|
|
|
|
|
*/
|
|
|
|
|
public function createApp($appData): PromiseInterface;
|
2018-12-04 21:22:33 +00:00
|
|
|
}
|