Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/Contracts/DefinitionContract.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Atproto\Contracts;

use Atproto\Contracts\Resources\ObjectContract;

interface DefinitionContract extends LexiconContract, ObjectContract
{
}
12 changes: 3 additions & 9 deletions src/Contracts/Resources/ResponseContract.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,9 @@

namespace Atproto\Contracts\Resources;

use Atproto\API\App\Bsky\Actor\GetProfile;
use Atproto\API\Com\Atrproto\Repo\CreateRecord;
use Atproto\API\Com\Atrproto\Repo\UploadBlob;
use Atproto\Contracts\Stringable;
use Atproto\Exceptions\Resource\BadAssetCallException;

/**
* @see GetProfile
* @see CreateRecord
* @see UploadBlob
*/
interface ResponseContract extends Stringable, \JsonSerializable
{
/**
Expand All @@ -30,5 +22,7 @@ public function get($offset);
public function exist(string $name): bool;

public function __toString(): string;
public function jsonSerialize(): array;

#[\ReturnTypeWillChange]
public function jsonSerialize();
}
37 changes: 37 additions & 0 deletions src/Lexicons/App/Bsky/Actor/Defs/KnownFollowers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace Atproto\Lexicons\App\Bsky\Actor\Defs;

use Atproto\Contracts\DefinitionContract;
use Atproto\FieldTypes\FieldType;
use Atproto\Responses\Objects\BaseObject;
use Atproto\Traits\Castable;

/**
* @method integer count
* @method list<ProfileViewBasic> followers
*/
class KnownFollowers implements DefinitionContract
{
use Castable;
use BaseObject;

protected function casts(): array
{
return [
'followers' => FieldType::array(FieldType::object(ProfileViewBasic::class))
->maxLength(5)
->minLength(0)
];
}

public function __construct($value)
{
$this->content = $value;
}

public static function nsid(): string
{
return 'app.bsky.actor.defs#knownFollowers';
}
}
37 changes: 37 additions & 0 deletions src/Lexicons/App/Bsky/Actor/Defs/ProfileAssociated.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace Atproto\Lexicons\App\Bsky\Actor\Defs;

use Atproto\Contracts\DefinitionContract;
use Atproto\Responses\Objects\BaseObject;
use Atproto\Traits\Castable;

/**
* @method int lists
* @method int feedgens
* @method int starterPack
* @method boolean labeler
* @method ProfileAssociatedChat chat
*/
class ProfileAssociated implements DefinitionContract
{
use Castable;
use BaseObject;

protected function casts(): array
{
return [
'chat' => ProfileAssociatedChat::class,
];
}

public function __construct($value)
{
$this->content = $value;
}

public static function nsid(): string
{
return 'app.bsky.actor.defs#profileAssociated';
}
}
24 changes: 24 additions & 0 deletions src/Lexicons/App/Bsky/Actor/Defs/ProfileAssociatedChat.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Atproto\Lexicons\App\Bsky\Actor\Defs;

use Atproto\Contracts\DefinitionContract;
use Atproto\Responses\Objects\BaseObject;

/**
* @method string allowIncoming
*/
class ProfileAssociatedChat implements DefinitionContract
{
use BaseObject;

public function __construct($value)
{
$this->content = $value;
}

public static function nsid(): string
{
return 'app.bsky.actor.defs#profileAssociatedChat';
}
}
49 changes: 49 additions & 0 deletions src/Lexicons/App/Bsky/Actor/Defs/ProfileView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?php

namespace Atproto\Lexicons\App\Bsky\Actor\Defs;

use Atproto\Contracts\DefinitionContract;
use Atproto\Lexicons\Com\Atproto\Label\Defs\Label;
use Atproto\Responses\Objects\BaseObject;
use Atproto\Responses\Objects\DatetimeObject;
use Atproto\Traits\Castable;
use Carbon\Carbon;

/**
* @method string did
* @method string handle
* @method string displayName
* @method string description
* @method string avatar
* @method ProfileAssociated associated
* @method Carbon indexedAt
* @method Carbon createdAt
* @method ViewerState viewer
* @method Label labels
*/
class ProfileView implements DefinitionContract
{
use Castable;
use BaseObject;

protected function casts(): array
{
return [
'associated' => ProfileAssociated::class,
'indexedAt' => DatetimeObject::class,
'createdAt' => DatetimeObject::class,
'viewer' => ViewerState::class,
'labels' => Label::class,
];
}

public function __construct($value)
{
$this->content = $value;
}

public static function nsid(): string
{
return 'app.bsky.actor.defs#profileView';
}
}
46 changes: 46 additions & 0 deletions src/Lexicons/App/Bsky/Actor/Defs/ProfileViewBasic.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<?php

namespace Atproto\Lexicons\App\Bsky\Actor\Defs;

use Atproto\Contracts\DefinitionContract;
use Atproto\Lexicons\Com\Atproto\Label\Defs\Label;
use Atproto\Responses\Objects\BaseObject;
use Atproto\Responses\Objects\DatetimeObject;
use Atproto\Traits\Castable;
use Carbon\Carbon;

/**
* @method string did
* @method string handle
* @method string displayName
* @method string avatar
* @method ProfileAssociated associated
* @method ViewerState viewer
* @method Label labels
* @method Carbon createdAt
*/
class ProfileViewBasic implements DefinitionContract
{
use Castable;
use BaseObject;

protected function casts(): array
{
return [
'associated' => ProfileAssociated::class,
'viewer' => ViewerState::class,
'labels' => Label::class,
'createdAt' => DatetimeObject::class,
];
}

public function __construct($value)
{
$this->content = $value;
}

public static function nsid(): string
{
return 'app.bsky.actor.defs#profileViewBasic';
}
}
43 changes: 43 additions & 0 deletions src/Lexicons/App/Bsky/Actor/Defs/ViewerState.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

namespace Atproto\Lexicons\App\Bsky\Actor\Defs;

use Atproto\Contracts\DefinitionContract;
use Atproto\Lexicons\App\Bsky\Graph\Defs\ListViewBasic;
use Atproto\Responses\Objects\BaseObject;
use Atproto\Traits\Castable;

/**
* @method boolean muted
* @method ListViewBasic mutedByList
* @method boolean blockedBy
* @method string blocking
* @method ListViewBasic blockingByList
* @method string following
* @method string followedBy
* @method KnownFollowers knownFollowers
*/
class ViewerState implements DefinitionContract
{
use Castable;
use BaseObject;

protected function casts(): array
{
return [
'mutedByList' => ListViewBasic::class,
'blockingByList' => ListViewBasic::class,
'knownFollowers' => KnownFollowers::class,
];
}

public function __construct($value)
{
$this->content = $value;
}

public static function nsid(): string
{
return 'app.bsky.actor.defs#viewerState';
}
}
Loading