Laravel AT Protocol Client (alpha & unstable)
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add Scope enum with transition scope constants and granular scope helpers

+69
+69
src/Enums/Scope.php
··· 1 + <?php 2 + 3 + namespace SocialDept\AtpClient\Enums; 4 + 5 + enum Scope: string 6 + { 7 + // Transition scopes (current) 8 + case Atproto = 'atproto'; 9 + case TransitionGeneric = 'transition:generic'; 10 + case TransitionEmail = 'transition:email'; 11 + case TransitionChat = 'transition:chat.bsky'; 12 + 13 + /** 14 + * Build a repo scope string for record operations. 15 + * 16 + * @param string $collection The collection NSID (e.g., 'app.bsky.feed.post') 17 + * @param string|null $action The action (create, update, delete) 18 + */ 19 + public static function repo(string $collection, ?string $action = null): string 20 + { 21 + $scope = "repo:{$collection}"; 22 + 23 + if ($action !== null) { 24 + $scope .= "?action={$action}"; 25 + } 26 + 27 + return $scope; 28 + } 29 + 30 + /** 31 + * Build an RPC scope string for endpoint access. 32 + * 33 + * @param string $lxm The lexicon method ID (e.g., 'app.bsky.feed.getTimeline') 34 + */ 35 + public static function rpc(string $lxm): string 36 + { 37 + return "rpc:{$lxm}"; 38 + } 39 + 40 + /** 41 + * Build a blob scope string for uploads. 42 + * 43 + * @param string|null $mimeType The mime type pattern (e.g., 'image/*', '*\/*') 44 + */ 45 + public static function blob(?string $mimeType = null): string 46 + { 47 + return 'blob:'.($mimeType ?? '*/*'); 48 + } 49 + 50 + /** 51 + * Build an account scope string. 52 + * 53 + * @param string $attr The account attribute (e.g., 'email', 'status') 54 + */ 55 + public static function account(string $attr): string 56 + { 57 + return "account:{$attr}"; 58 + } 59 + 60 + /** 61 + * Build an identity scope string. 62 + * 63 + * @param string $attr The identity attribute (e.g., 'handle') 64 + */ 65 + public static function identity(string $attr): string 66 + { 67 + return "identity:{$attr}"; 68 + } 69 + }