Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from moondayapp/master
Add interfaces for the Feed and the Client
- Loading branch information
Showing
14 changed files
with
298 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
<?php | ||
|
||
namespace GetStream\Stream; | ||
|
||
interface BaseFeedInterface | ||
{ | ||
/** | ||
* @param string $feed_slug | ||
* | ||
* @return bool | ||
*/ | ||
public function validFeedSlug($feed_slug); | ||
|
||
/** | ||
* @param string $user_id | ||
* | ||
* @return bool | ||
*/ | ||
public function validUserId($user_id); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getReadonlyToken(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getToken(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getId(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getSlug(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getUserId(); | ||
|
||
/** | ||
* @param array $to | ||
* | ||
* @return array | ||
*/ | ||
public function signToField($to); | ||
|
||
/** | ||
* @param array $activity | ||
* @return mixed | ||
* | ||
* @throws StreamFeedException | ||
*/ | ||
public function addActivity($activity); | ||
|
||
/** | ||
* @param array $activities | ||
* @return mixed | ||
* | ||
* @throws StreamFeedException | ||
*/ | ||
public function addActivities($activities); | ||
|
||
/** | ||
* @param int $activity_id | ||
* @param bool $foreign_id | ||
* @return mixed | ||
* | ||
* @throws StreamFeedException | ||
*/ | ||
public function removeActivity($activity_id, $foreign_id = false); | ||
|
||
/** | ||
* @param int $offset | ||
* @param int $limit | ||
* @param array $options | ||
* @return mixed | ||
* | ||
* @throws StreamFeedException | ||
*/ | ||
public function getActivities($offset = 0, $limit = 20, $options = [], $enrich = false, $reactions = null); | ||
|
||
/** | ||
* @param string $targetFeedSlug | ||
* @param string $targetUserId | ||
* @param int $activityCopyLimit | ||
* | ||
* @return mixed | ||
* | ||
* @throws StreamFeedException | ||
*/ | ||
public function follow($targetFeedSlug, $targetUserId, $activityCopyLimit = 300); | ||
|
||
/** | ||
* @param int $offset | ||
* @param int $limit | ||
* @return mixed | ||
* | ||
* @throws StreamFeedException | ||
*/ | ||
public function followers($offset = 0, $limit = 25); | ||
|
||
/** | ||
* @param int $offset | ||
* @param int $limit | ||
* @param array $filter | ||
* @return mixed | ||
* | ||
* @throws StreamFeedException | ||
*/ | ||
public function following($offset = 0, $limit = 25, $filter = []); | ||
|
||
/** | ||
* @param string $targetFeedSlug | ||
* @param string $targetUserId | ||
* @param bool $keepHistory | ||
* | ||
* @return mixed | ||
* | ||
* @throws StreamFeedException | ||
*/ | ||
public function unfollow($targetFeedSlug, $targetUserId, $keepHistory = false); | ||
|
||
/** | ||
* @param string $foreign_id | ||
* @param string $time | ||
* @param array $new_targets | ||
* @param array $added_targets | ||
* @param array $removed_targets | ||
* @return mixed | ||
* | ||
* @throws StreamFeedException | ||
*/ | ||
public function updateActivityToTargets($foreign_id, $time, $new_targets = [], $added_targets = [], $removed_targets = []); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<?php | ||
|
||
namespace GetStream\Stream; | ||
|
||
interface ClientInterface | ||
{ | ||
/** | ||
* @param string $protocol | ||
*/ | ||
public function setProtocol($protocol); | ||
|
||
/** | ||
* @param string $location | ||
*/ | ||
public function setLocation($location); | ||
|
||
/** | ||
* @param string $user_id | ||
* @param array $extra_data | ||
* @return string | ||
*/ | ||
public function createUserSessionToken($user_id, array $extra_data = null); | ||
|
||
/** | ||
* @param string $user_id | ||
* @param array $extra_data | ||
* @return string | ||
*/ | ||
public function createUserToken($user_id, array $extra_data = null); | ||
|
||
/** | ||
* @param BaseFeedInterface $feed | ||
* @param string $resource | ||
* @param string $action | ||
* @return string | ||
*/ | ||
public function createFeedJWTToken($feed, $resource, $action); | ||
|
||
/** | ||
* @param string $feed_slug | ||
* @param string $user_id | ||
* @param string|null $token | ||
* @return FeedInterface | ||
*/ | ||
public function feed($feed_slug, $user_id, $token = null); | ||
|
||
/** | ||
* @return Batcher | ||
*/ | ||
public function batcher(); | ||
|
||
/** | ||
* @return Personalization | ||
*/ | ||
public function personalization(); | ||
|
||
/** | ||
* @return Collections | ||
*/ | ||
public function collections(); | ||
|
||
/** | ||
* @return Reactions | ||
*/ | ||
public function reactions(); | ||
|
||
/** | ||
* @return Users | ||
*/ | ||
public function users(); | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getBaseUrl(); | ||
|
||
/** | ||
* @param string $uri | ||
* @return string | ||
*/ | ||
public function buildRequestUrl($uri); | ||
|
||
public function getActivities($ids = null, $foreign_id_times = null); | ||
|
||
public function batchPartialActivityUpdate($data); | ||
|
||
public function doPartialActivityUpdate($id = null, $foreign_id = null, $time = null, $set = null, $unset = null); | ||
|
||
public function updateActivities($activities); | ||
|
||
public function updateActivity($activity); | ||
|
||
/** | ||
* Creates a redirect url for tracking the given events in the context of | ||
* getstream.io/personalization | ||
* @param string $targetUrl | ||
* @param array $events | ||
* @return string | ||
*/ | ||
public function createRedirectUrl($targetUrl, $events); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.