Build Reactive Signals for Bluesky's AT Protocol Firehose in Laravel

Compare changes

Choose any two refs to compare.

-2
.github/workflows/code-style.yml
··· 1 name: Code Style 2 3 on: 4 - push: 5 - branches: [ main, dev ] 6 pull_request: 7 branches: [ main, dev ] 8
··· 1 name: Code Style 2 3 on: 4 pull_request: 5 branches: [ main, dev ] 6
-2
.github/workflows/tests.yml
··· 1 name: Tests 2 3 on: 4 - push: 5 - branches: [ main, dev ] 6 pull_request: 7 branches: [ main, dev ] 8
··· 1 name: Tests 2 3 on: 4 pull_request: 5 branches: [ main, dev ] 6
+1
.gitignore
··· 1 .DS_Store 2 .phpunit.result.cache 3 .php-cs-fixer.cache 4 composer.lock
··· 1 .DS_Store 2 + .phpunit.cache 3 .phpunit.result.cache 4 .php-cs-fixer.cache 5 composer.lock
+2 -2
README.md
··· 33 ## Quick Example 34 35 ```php 36 - use SocialDept\Signals\Events\SignalEvent; 37 - use SocialDept\Signals\Signals\Signal; 38 39 class NewPostSignal extends Signal 40 {
··· 33 ## Quick Example 34 35 ```php 36 + use SocialDept\AtpSignals\Events\SignalEvent; 37 + use SocialDept\AtpSignals\Signals\Signal; 38 39 class NewPostSignal extends Signal 40 {
+4 -4
composer.json
··· 19 }, 20 "autoload": { 21 "psr-4": { 22 - "SocialDept\\Signals\\": "src/" 23 } 24 }, 25 "autoload-dev": { 26 "psr-4": { 27 - "SocialDept\\Signals\\Tests\\": "tests/" 28 } 29 }, 30 "extra": { 31 "laravel": { 32 "providers": [ 33 - "SocialDept\\Signals\\SignalServiceProvider" 34 ], 35 "aliases": { 36 - "Signal": "SocialDept\\Signals\\Facades\\Signal" 37 } 38 } 39 }
··· 19 }, 20 "autoload": { 21 "psr-4": { 22 + "SocialDept\\AtpSignals\\": "src/" 23 } 24 }, 25 "autoload-dev": { 26 "psr-4": { 27 + "SocialDept\\AtpSignals\\Tests\\": "tests/" 28 } 29 }, 30 "extra": { 31 "laravel": { 32 "providers": [ 33 + "SocialDept\\AtpSignals\\SignalServiceProvider" 34 ], 35 "aliases": { 36 + "Signal": "SocialDept\\AtpSignals\\Facades\\Signal" 37 } 38 } 39 }
+2 -2
docs/configuration.md
··· 539 Change configuration at runtime: 540 541 ```php 542 - use SocialDept\Signals\Facades\Signal; 543 544 // Override mode 545 config(['signal.mode' => 'firehose']); ··· 578 Or via Facade: 579 580 ```php 581 - use SocialDept\Signals\Facades\Signal; 582 583 $mode = Signal::getMode(); 584 ```
··· 539 Change configuration at runtime: 540 541 ```php 542 + use SocialDept\AtpSignals\Facades\Signal; 543 544 // Override mode 545 config(['signal.mode' => 'firehose']); ··· 578 Or via Facade: 579 580 ```php 581 + use SocialDept\AtpSignals\Facades\Signal; 582 583 $mode = Signal::getMode(); 584 ```
+29 -29
docs/examples.md
··· 12 namespace App\Signals; 13 14 use App\Models\EngagementMetric; 15 - use SocialDept\Signals\Enums\SignalCommitOperation; 16 - use SocialDept\Signals\Events\SignalEvent; 17 - use SocialDept\Signals\Signals\Signal; 18 use Illuminate\Support\Facades\DB; 19 20 class EngagementTrackerSignal extends Signal ··· 78 79 use App\Models\FlaggedPost; 80 use App\Services\ModerationService; 81 - use SocialDept\Signals\Enums\SignalCommitOperation; 82 - use SocialDept\Signals\Events\SignalEvent; 83 - use SocialDept\Signals\Signals\Signal; 84 85 class ModerationSignal extends Signal 86 { ··· 158 159 use App\Models\Activity; 160 use App\Models\User; 161 - use SocialDept\Signals\Enums\SignalCommitOperation; 162 - use SocialDept\Signals\Events\SignalEvent; 163 - use SocialDept\Signals\Signals\Signal; 164 165 class ActivityFeedSignal extends Signal 166 { ··· 243 244 use App\Models\User; 245 use App\Notifications\MentionedInPost; 246 - use SocialDept\Signals\Enums\SignalCommitOperation; 247 - use SocialDept\Signals\Events\SignalEvent; 248 - use SocialDept\Signals\Signals\Signal; 249 250 class MentionNotificationSignal extends Signal 251 { ··· 314 use App\Models\Follow; 315 use App\Models\User; 316 use App\Notifications\NewFollower; 317 - use SocialDept\Signals\Enums\SignalCommitOperation; 318 - use SocialDept\Signals\Events\SignalEvent; 319 - use SocialDept\Signals\Signals\Signal; 320 321 class FollowTrackerSignal extends Signal 322 { ··· 393 394 use App\Models\Post; 395 use Laravel\Scout\Searchable; 396 - use SocialDept\Signals\Enums\SignalCommitOperation; 397 - use SocialDept\Signals\Events\SignalEvent; 398 - use SocialDept\Signals\Signals\Signal; 399 400 class SearchIndexerSignal extends Signal 401 { ··· 477 478 use App\Models\TrendingTopic; 479 use Illuminate\Support\Facades\Cache; 480 - use SocialDept\Signals\Enums\SignalCommitOperation; 481 - use SocialDept\Signals\Events\SignalEvent; 482 - use SocialDept\Signals\Signals\Signal; 483 484 class TrendDetectionSignal extends Signal 485 { ··· 553 namespace App\Signals; 554 555 use App\Models\Publication; 556 - use SocialDept\Signals\Enums\SignalCommitOperation; 557 - use SocialDept\Signals\Events\SignalEvent; 558 - use SocialDept\Signals\Signals\Signal; 559 560 class PublicationIndexerSignal extends Signal 561 { ··· 633 634 use App\Services\ExternalAPIService; 635 use Illuminate\Support\Facades\RateLimiter; 636 - use SocialDept\Signals\Events\SignalEvent; 637 - use SocialDept\Signals\Signals\Signal; 638 639 class APIIntegrationSignal extends Signal 640 { ··· 695 namespace App\Signals; 696 697 use App\Models\UserMetrics; 698 - use SocialDept\Signals\Enums\SignalCommitOperation; 699 - use SocialDept\Signals\Events\SignalEvent; 700 - use SocialDept\Signals\Signals\Signal; 701 702 class UserMetricsSignal extends Signal 703 {
··· 12 namespace App\Signals; 13 14 use App\Models\EngagementMetric; 15 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 16 + use SocialDept\AtpSignals\Events\SignalEvent; 17 + use SocialDept\AtpSignals\Signals\Signal; 18 use Illuminate\Support\Facades\DB; 19 20 class EngagementTrackerSignal extends Signal ··· 78 79 use App\Models\FlaggedPost; 80 use App\Services\ModerationService; 81 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 82 + use SocialDept\AtpSignals\Events\SignalEvent; 83 + use SocialDept\AtpSignals\Signals\Signal; 84 85 class ModerationSignal extends Signal 86 { ··· 158 159 use App\Models\Activity; 160 use App\Models\User; 161 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 162 + use SocialDept\AtpSignals\Events\SignalEvent; 163 + use SocialDept\AtpSignals\Signals\Signal; 164 165 class ActivityFeedSignal extends Signal 166 { ··· 243 244 use App\Models\User; 245 use App\Notifications\MentionedInPost; 246 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 247 + use SocialDept\AtpSignals\Events\SignalEvent; 248 + use SocialDept\AtpSignals\Signals\Signal; 249 250 class MentionNotificationSignal extends Signal 251 { ··· 314 use App\Models\Follow; 315 use App\Models\User; 316 use App\Notifications\NewFollower; 317 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 318 + use SocialDept\AtpSignals\Events\SignalEvent; 319 + use SocialDept\AtpSignals\Signals\Signal; 320 321 class FollowTrackerSignal extends Signal 322 { ··· 393 394 use App\Models\Post; 395 use Laravel\Scout\Searchable; 396 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 397 + use SocialDept\AtpSignals\Events\SignalEvent; 398 + use SocialDept\AtpSignals\Signals\Signal; 399 400 class SearchIndexerSignal extends Signal 401 { ··· 477 478 use App\Models\TrendingTopic; 479 use Illuminate\Support\Facades\Cache; 480 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 481 + use SocialDept\AtpSignals\Events\SignalEvent; 482 + use SocialDept\AtpSignals\Signals\Signal; 483 484 class TrendDetectionSignal extends Signal 485 { ··· 553 namespace App\Signals; 554 555 use App\Models\Publication; 556 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 557 + use SocialDept\AtpSignals\Events\SignalEvent; 558 + use SocialDept\AtpSignals\Signals\Signal; 559 560 class PublicationIndexerSignal extends Signal 561 { ··· 633 634 use App\Services\ExternalAPIService; 635 use Illuminate\Support\Facades\RateLimiter; 636 + use SocialDept\AtpSignals\Events\SignalEvent; 637 + use SocialDept\AtpSignals\Signals\Signal; 638 639 class APIIntegrationSignal extends Signal 640 { ··· 695 namespace App\Signals; 696 697 use App\Models\UserMetrics; 698 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 699 + use SocialDept\AtpSignals\Events\SignalEvent; 700 + use SocialDept\AtpSignals\Signals\Signal; 701 702 class UserMetricsSignal extends Signal 703 {
+2 -2
docs/filtering.md
··· 30 ### Available Event Types 31 32 ```php 33 - use SocialDept\Signals\Enums\SignalEventType; 34 35 public function eventTypes(): array 36 { ··· 210 ### Available Operations 211 212 ```php 213 - use SocialDept\Signals\Enums\SignalCommitOperation; 214 215 public function operations(): ?array 216 {
··· 30 ### Available Event Types 31 32 ```php 33 + use SocialDept\AtpSignals\Enums\SignalEventType; 34 35 public function eventTypes(): array 36 { ··· 210 ### Available Operations 211 212 ```php 213 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 214 215 public function operations(): ?array 216 {
+2 -2
docs/modes.md
··· 318 ### Option 2: Runtime Configuration 319 320 ```php 321 - use SocialDept\Signals\Facades\Signal; 322 323 // Set mode dynamically 324 config(['signal.mode' => 'jetstream']); ··· 467 Or via Facade: 468 469 ```php 470 - use SocialDept\Signals\Facades\Signal; 471 472 $mode = Signal::getMode(); 473 ```
··· 318 ### Option 2: Runtime Configuration 319 320 ```php 321 + use SocialDept\AtpSignals\Facades\Signal; 322 323 // Set mode dynamically 324 config(['signal.mode' => 'jetstream']); ··· 467 Or via Facade: 468 469 ```php 470 + use SocialDept\AtpSignals\Facades\Signal; 471 472 $mode = Signal::getMode(); 473 ```
+6 -6
docs/quickstart.md
··· 33 34 namespace App\Signals; 35 36 - use SocialDept\Signals\Events\SignalEvent; 37 - use SocialDept\Signals\Signals\Signal; 38 use Illuminate\Support\Facades\Log; 39 40 class NewPostSignal extends Signal ··· 154 Track specific operations only: 155 156 ```php 157 - use SocialDept\Signals\Enums\SignalCommitOperation; 158 159 public function operations(): ?array 160 { ··· 242 namespace App\Signals; 243 244 use App\Models\EngagementMetric; 245 - use SocialDept\Signals\Enums\SignalCommitOperation; 246 - use SocialDept\Signals\Events\SignalEvent; 247 - use SocialDept\Signals\Signals\Signal; 248 249 class EngagementTrackerSignal extends Signal 250 {
··· 33 34 namespace App\Signals; 35 36 + use SocialDept\AtpSignals\Events\SignalEvent; 37 + use SocialDept\AtpSignals\Signals\Signal; 38 use Illuminate\Support\Facades\Log; 39 40 class NewPostSignal extends Signal ··· 154 Track specific operations only: 155 156 ```php 157 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 158 159 public function operations(): ?array 160 { ··· 242 namespace App\Signals; 243 244 use App\Models\EngagementMetric; 245 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 246 + use SocialDept\AtpSignals\Events\SignalEvent; 247 + use SocialDept\AtpSignals\Signals\Signal; 248 249 class EngagementTrackerSignal extends Signal 250 {
+6 -6
docs/signals.md
··· 21 22 namespace App\Signals; 23 24 - use SocialDept\Signals\Events\SignalEvent; 25 - use SocialDept\Signals\Signals\Signal; 26 27 class MySignal extends Signal 28 { ··· 83 84 namespace App\Signals; 85 86 - use SocialDept\Signals\Events\SignalEvent; 87 - use SocialDept\Signals\Signals\Signal; 88 89 class ManualSignal extends Signal 90 { ··· 111 Repository commits represent changes to user data: 112 113 ```php 114 - use SocialDept\Signals\Enums\SignalEventType; 115 116 public function eventTypes(): array 117 { ··· 339 ### Operation Checking (Commit Events) 340 341 ```php 342 - use SocialDept\Signals\Enums\SignalCommitOperation; 343 344 public function handle(SignalEvent $event): void 345 {
··· 21 22 namespace App\Signals; 23 24 + use SocialDept\AtpSignals\Events\SignalEvent; 25 + use SocialDept\AtpSignals\Signals\Signal; 26 27 class MySignal extends Signal 28 { ··· 83 84 namespace App\Signals; 85 86 + use SocialDept\AtpSignals\Events\SignalEvent; 87 + use SocialDept\AtpSignals\Signals\Signal; 88 89 class ManualSignal extends Signal 90 { ··· 111 Repository commits represent changes to user data: 112 113 ```php 114 + use SocialDept\AtpSignals\Enums\SignalEventType; 115 116 public function eventTypes(): array 117 { ··· 339 ### Operation Checking (Commit Events) 340 341 ```php 342 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 343 344 public function handle(SignalEvent $event): void 345 {
+4 -4
docs/testing.md
··· 64 namespace Tests\Unit\Signals; 65 66 use App\Signals\NewPostSignal; 67 - use SocialDept\Signals\Events\CommitEvent; 68 - use SocialDept\Signals\Events\SignalEvent; 69 use Tests\TestCase; 70 71 class NewPostSignalTest extends TestCase ··· 186 use App\Models\Post; 187 use App\Signals\StorePostSignal; 188 use Illuminate\Foundation\Testing\RefreshDatabase; 189 - use SocialDept\Signals\Events\CommitEvent; 190 - use SocialDept\Signals\Events\SignalEvent; 191 use Tests\TestCase; 192 193 class StorePostSignalTest extends TestCase
··· 64 namespace Tests\Unit\Signals; 65 66 use App\Signals\NewPostSignal; 67 + use SocialDept\AtpSignals\Events\CommitEvent; 68 + use SocialDept\AtpSignals\Events\SignalEvent; 69 use Tests\TestCase; 70 71 class NewPostSignalTest extends TestCase ··· 186 use App\Models\Post; 187 use App\Signals\StorePostSignal; 188 use Illuminate\Foundation\Testing\RefreshDatabase; 189 + use SocialDept\AtpSignals\Events\CommitEvent; 190 + use SocialDept\AtpSignals\Events\SignalEvent; 191 use Tests\TestCase; 192 193 class StorePostSignalTest extends TestCase
+1 -1
src/Binary/Reader.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\Binary; 6 7 use RuntimeException; 8
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\Binary; 6 7 use RuntimeException; 8
+1 -1
src/Binary/Varint.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\Binary; 6 7 use RuntimeException; 8
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\Binary; 6 7 use RuntimeException; 8
+3 -3
src/CAR/BlockReader.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\CAR; 6 7 use Generator; 8 - use SocialDept\Signals\Binary\Reader; 9 - use SocialDept\Signals\Core\CID; 10 11 /** 12 * CAR (Content Addressable aRchive) block reader.
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\CAR; 6 7 use Generator; 8 + use SocialDept\AtpSignals\Binary\Reader; 9 + use SocialDept\AtpSignals\Core\CID; 10 11 /** 12 * CAR (Content Addressable aRchive) block reader.
+3 -3
src/CAR/RecordExtractor.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\CAR; 6 7 use Generator; 8 - use SocialDept\Signals\Core\CBOR; 9 - use SocialDept\Signals\Core\CID; 10 11 /** 12 * Extract records from AT Protocol MST (Merkle Search Tree) blocks.
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\CAR; 6 7 use Generator; 8 + use SocialDept\AtpSignals\Core\CBOR; 9 + use SocialDept\AtpSignals\Core\CID; 10 11 /** 12 * Extract records from AT Protocol MST (Merkle Search Tree) blocks.
+3 -3
src/CBOR/Decoder.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\CBOR; 6 7 use RuntimeException; 8 - use SocialDept\Signals\Binary\Reader; 9 - use SocialDept\Signals\Core\CID; 10 11 /** 12 * CBOR (Concise Binary Object Representation) decoder.
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\CBOR; 6 7 use RuntimeException; 8 + use SocialDept\AtpSignals\Binary\Reader; 9 + use SocialDept\AtpSignals\Core\CID; 10 11 /** 12 * CBOR (Concise Binary Object Representation) decoder.
+4 -4
src/Commands/ConsumeCommand.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Commands; 4 5 use BackedEnum; 6 use Exception; 7 use Illuminate\Console\Command; 8 - use SocialDept\Signals\Services\FirehoseConsumer; 9 - use SocialDept\Signals\Services\JetstreamConsumer; 10 - use SocialDept\Signals\Services\SignalRegistry; 11 12 class ConsumeCommand extends Command 13 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Commands; 4 5 use BackedEnum; 6 use Exception; 7 use Illuminate\Console\Command; 8 + use SocialDept\AtpSignals\Services\FirehoseConsumer; 9 + use SocialDept\AtpSignals\Services\JetstreamConsumer; 10 + use SocialDept\AtpSignals\Services\SignalRegistry; 11 12 class ConsumeCommand extends Command 13 {
+1 -1
src/Commands/InstallCommand.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Commands; 4 5 use Illuminate\Console\Command; 6
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Commands; 4 5 use Illuminate\Console\Command; 6
+2 -2
src/Commands/ListSignalsCommand.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Commands; 4 5 use Illuminate\Console\Command; 6 use Illuminate\Support\Collection; 7 - use SocialDept\Signals\Services\SignalRegistry; 8 9 class ListSignalsCommand extends Command 10 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Commands; 4 5 use Illuminate\Console\Command; 6 use Illuminate\Support\Collection; 7 + use SocialDept\AtpSignals\Services\SignalRegistry; 8 9 class ListSignalsCommand extends Command 10 {
+1 -1
src/Commands/MakeSignalCommand.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Commands; 4 5 use Illuminate\Console\GeneratorCommand; 6 use Symfony\Component\Console\Input\InputOption;
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Commands; 4 5 use Illuminate\Console\GeneratorCommand; 6 use Symfony\Component\Console\Input\InputOption;
+3 -3
src/Commands/TestSignalCommand.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Commands; 4 5 use Illuminate\Console\Command; 6 use InvalidArgumentException; 7 - use SocialDept\Signals\Events\CommitEvent; 8 - use SocialDept\Signals\Events\SignalEvent; 9 10 class TestSignalCommand extends Command 11 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Commands; 4 5 use Illuminate\Console\Command; 6 use InvalidArgumentException; 7 + use SocialDept\AtpSignals\Events\CommitEvent; 8 + use SocialDept\AtpSignals\Events\SignalEvent; 9 10 class TestSignalCommand extends Command 11 {
+1 -1
src/Contracts/CursorStore.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Contracts; 4 5 interface CursorStore 6 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Contracts; 4 5 interface CursorStore 6 {
+1 -1
src/Contracts/EventContract.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Contracts; 4 5 interface EventContract 6 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Contracts; 4 5 interface EventContract 6 {
+2 -2
src/Core/CAR.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\Core; 6 7 - use SocialDept\Signals\CAR\BlockReader; 8 9 /** 10 * CAR (Content Addressable aRchive) facade.
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\Core; 6 7 + use SocialDept\AtpSignals\CAR\BlockReader; 8 9 /** 10 * CAR (Content Addressable aRchive) facade.
+2 -2
src/Core/CBOR.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\Core; 6 7 - use SocialDept\Signals\CBOR\Decoder; 8 9 /** 10 * CBOR facade for simple decoding operations.
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\Core; 6 7 + use SocialDept\AtpSignals\CBOR\Decoder; 8 9 /** 10 * CBOR facade for simple decoding operations.
+3 -3
src/Core/CID.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\Core; 6 7 use RuntimeException; 8 - use SocialDept\Signals\Binary\Reader; 9 - use SocialDept\Signals\Binary\Varint; 10 11 /** 12 * Content Identifier (CID) parser for IPLD.
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\Core; 6 7 use RuntimeException; 8 + use SocialDept\AtpSignals\Binary\Reader; 9 + use SocialDept\AtpSignals\Binary\Varint; 10 11 /** 12 * Content Identifier (CID) parser for IPLD.
+1 -1
src/Enums/SignalCommitOperation.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Enums; 4 5 enum SignalCommitOperation: string 6 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Enums; 4 5 enum SignalCommitOperation: string 6 {
+1 -1
src/Enums/SignalEventType.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Enums; 4 5 enum SignalEventType: string 6 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Enums; 4 5 enum SignalEventType: string 6 {
+2 -2
src/Events/AccountEvent.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Events; 4 5 - use SocialDept\Signals\Contracts\EventContract; 6 7 class AccountEvent implements EventContract 8 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Events; 4 5 + use SocialDept\AtpSignals\Contracts\EventContract; 6 7 class AccountEvent implements EventContract 8 {
+3 -3
src/Events/CommitEvent.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Events; 4 5 - use SocialDept\Signals\Contracts\EventContract; 6 - use SocialDept\Signals\Enums\SignalCommitOperation; 7 8 class CommitEvent implements EventContract 9 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Events; 4 5 + use SocialDept\AtpSignals\Contracts\EventContract; 6 + use SocialDept\AtpSignals\Enums\SignalCommitOperation; 7 8 class CommitEvent implements EventContract 9 {
+2 -2
src/Events/IdentityEvent.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Events; 4 5 - use SocialDept\Signals\Contracts\EventContract; 6 7 class IdentityEvent implements EventContract 8 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Events; 4 5 + use SocialDept\AtpSignals\Contracts\EventContract; 6 7 class IdentityEvent implements EventContract 8 {
+3 -3
src/Events/SignalEvent.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Events; 4 5 - use SocialDept\Signals\Contracts\EventContract; 6 7 class SignalEvent implements EventContract 8 { ··· 41 return $this->commit?->record; 42 } 43 44 - public function getOperation(): ?\SocialDept\Signals\Enums\SignalCommitOperation 45 { 46 return $this->commit?->operation; 47 }
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Events; 4 5 + use SocialDept\AtpSignals\Contracts\EventContract; 6 7 class SignalEvent implements EventContract 8 { ··· 41 return $this->commit?->record; 42 } 43 44 + public function getOperation(): ?\SocialDept\AtpSignals\Enums\SignalCommitOperation 45 { 46 return $this->commit?->operation; 47 }
+1 -1
src/Exceptions/ConnectionException.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Exceptions; 4 5 class ConnectionException extends \Exception 6 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Exceptions; 4 5 class ConnectionException extends \Exception 6 {
+1 -1
src/Exceptions/SignalException.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Exceptions; 4 5 class SignalException extends \Exception 6 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Exceptions; 4 5 class SignalException extends \Exception 6 {
+3 -3
src/Facades/Signal.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Facades; 4 5 use Illuminate\Support\Facades\Facade; 6 - use SocialDept\Signals\Services\SignalManager; 7 8 /** 9 * @method static void start(?int $cursor = null) 10 * @method static void stop() 11 * @method static string getMode() 12 * 13 - * @see \SocialDept\Signals\Services\SignalManager 14 */ 15 class Signal extends Facade 16 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Facades; 4 5 use Illuminate\Support\Facades\Facade; 6 + use SocialDept\AtpSignals\Services\SignalManager; 7 8 /** 9 * @method static void start(?int $cursor = null) 10 * @method static void stop() 11 * @method static string getMode() 12 * 13 + * @see \SocialDept\AtpSignals\Services\SignalManager 14 */ 15 class Signal extends Facade 16 {
+3 -3
src/Jobs/ProcessSignalJob.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Jobs; 4 5 use Illuminate\Bus\Queueable; 6 use Illuminate\Contracts\Queue\ShouldQueue; 7 use Illuminate\Foundation\Bus\Dispatchable; 8 use Illuminate\Queue\InteractsWithQueue; 9 use Illuminate\Queue\SerializesModels; 10 - use SocialDept\Signals\Events\SignalEvent; 11 - use SocialDept\Signals\Signals\Signal; 12 13 class ProcessSignalJob implements ShouldQueue 14 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Jobs; 4 5 use Illuminate\Bus\Queueable; 6 use Illuminate\Contracts\Queue\ShouldQueue; 7 use Illuminate\Foundation\Bus\Dispatchable; 8 use Illuminate\Queue\InteractsWithQueue; 9 use Illuminate\Queue\SerializesModels; 10 + use SocialDept\AtpSignals\Events\SignalEvent; 11 + use SocialDept\AtpSignals\Signals\Signal; 12 13 class ProcessSignalJob implements ShouldQueue 14 {
+3 -3
src/Services/EventDispatcher.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Services; 4 5 use Illuminate\Support\Facades\Log; 6 use Illuminate\Support\Facades\Queue; 7 - use SocialDept\Signals\Events\SignalEvent; 8 - use SocialDept\Signals\Jobs\ProcessSignalJob; 9 10 class EventDispatcher 11 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Services; 4 5 use Illuminate\Support\Facades\Log; 6 use Illuminate\Support\Facades\Queue; 7 + use SocialDept\AtpSignals\Events\SignalEvent; 8 + use SocialDept\AtpSignals\Jobs\ProcessSignalJob; 9 10 class EventDispatcher 11 {
+11 -11
src/Services/FirehoseConsumer.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Services; 4 5 use Illuminate\Support\Arr; 6 use Illuminate\Support\Facades\Log; 7 - use SocialDept\Signals\Contracts\CursorStore; 8 - use SocialDept\Signals\Core\CAR; 9 - use SocialDept\Signals\Core\CBOR; 10 - use SocialDept\Signals\Core\CID; 11 - use SocialDept\Signals\Events\AccountEvent; 12 - use SocialDept\Signals\Events\CommitEvent; 13 - use SocialDept\Signals\Events\IdentityEvent; 14 - use SocialDept\Signals\Events\SignalEvent; 15 - use SocialDept\Signals\Exceptions\ConnectionException; 16 - use SocialDept\Signals\Support\WebSocketConnection; 17 18 class FirehoseConsumer 19 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Services; 4 5 use Illuminate\Support\Arr; 6 use Illuminate\Support\Facades\Log; 7 + use SocialDept\AtpSignals\Contracts\CursorStore; 8 + use SocialDept\AtpSignals\Core\CAR; 9 + use SocialDept\AtpSignals\Core\CBOR; 10 + use SocialDept\AtpSignals\Core\CID; 11 + use SocialDept\AtpSignals\Events\AccountEvent; 12 + use SocialDept\AtpSignals\Events\CommitEvent; 13 + use SocialDept\AtpSignals\Events\IdentityEvent; 14 + use SocialDept\AtpSignals\Events\SignalEvent; 15 + use SocialDept\AtpSignals\Exceptions\ConnectionException; 16 + use SocialDept\AtpSignals\Support\WebSocketConnection; 17 18 class FirehoseConsumer 19 {
+5 -5
src/Services/JetstreamConsumer.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Services; 4 5 use Illuminate\Support\Facades\Log; 6 - use SocialDept\Signals\Contracts\CursorStore; 7 - use SocialDept\Signals\Events\SignalEvent; 8 - use SocialDept\Signals\Exceptions\ConnectionException; 9 - use SocialDept\Signals\Support\WebSocketConnection; 10 11 class JetstreamConsumer 12 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Services; 4 5 use Illuminate\Support\Facades\Log; 6 + use SocialDept\AtpSignals\Contracts\CursorStore; 7 + use SocialDept\AtpSignals\Events\SignalEvent; 8 + use SocialDept\AtpSignals\Exceptions\ConnectionException; 9 + use SocialDept\AtpSignals\Support\WebSocketConnection; 10 11 class JetstreamConsumer 12 {
+1 -1
src/Services/SignalManager.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Services; 4 5 use InvalidArgumentException; 6
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Services; 4 5 use InvalidArgumentException; 6
+2 -2
src/Services/SignalRegistry.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Services; 4 5 use Illuminate\Support\Collection; 6 use Illuminate\Support\Facades\File; 7 use InvalidArgumentException; 8 - use SocialDept\Signals\Signals\Signal; 9 10 class SignalRegistry 11 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Services; 4 5 use Illuminate\Support\Collection; 6 use Illuminate\Support\Facades\File; 7 use InvalidArgumentException; 8 + use SocialDept\AtpSignals\Signals\Signal; 9 10 class SignalRegistry 11 {
+15 -15
src/SignalServiceProvider.php
··· 1 <?php 2 3 - namespace SocialDept\Signals; 4 5 use Illuminate\Support\ServiceProvider; 6 - use SocialDept\Signals\Commands\ConsumeCommand; 7 - use SocialDept\Signals\Commands\InstallCommand; 8 - use SocialDept\Signals\Commands\ListSignalsCommand; 9 - use SocialDept\Signals\Commands\MakeSignalCommand; 10 - use SocialDept\Signals\Commands\TestSignalCommand; 11 - use SocialDept\Signals\Contracts\CursorStore; 12 - use SocialDept\Signals\Services\EventDispatcher; 13 - use SocialDept\Signals\Services\FirehoseConsumer; 14 - use SocialDept\Signals\Services\JetstreamConsumer; 15 - use SocialDept\Signals\Services\SignalManager; 16 - use SocialDept\Signals\Services\SignalRegistry; 17 - use SocialDept\Signals\Storage\DatabaseCursorStore; 18 - use SocialDept\Signals\Storage\FileCursorStore; 19 - use SocialDept\Signals\Storage\RedisCursorStore; 20 21 class SignalServiceProvider extends ServiceProvider 22 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals; 4 5 use Illuminate\Support\ServiceProvider; 6 + use SocialDept\AtpSignals\Commands\ConsumeCommand; 7 + use SocialDept\AtpSignals\Commands\InstallCommand; 8 + use SocialDept\AtpSignals\Commands\ListSignalsCommand; 9 + use SocialDept\AtpSignals\Commands\MakeSignalCommand; 10 + use SocialDept\AtpSignals\Commands\TestSignalCommand; 11 + use SocialDept\AtpSignals\Contracts\CursorStore; 12 + use SocialDept\AtpSignals\Services\EventDispatcher; 13 + use SocialDept\AtpSignals\Services\FirehoseConsumer; 14 + use SocialDept\AtpSignals\Services\JetstreamConsumer; 15 + use SocialDept\AtpSignals\Services\SignalManager; 16 + use SocialDept\AtpSignals\Services\SignalRegistry; 17 + use SocialDept\AtpSignals\Storage\DatabaseCursorStore; 18 + use SocialDept\AtpSignals\Storage\FileCursorStore; 19 + use SocialDept\AtpSignals\Storage\RedisCursorStore; 20 21 class SignalServiceProvider extends ServiceProvider 22 {
+4 -4
src/Signals/Signal.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Signals; 4 5 - use SocialDept\Signals\Events\SignalEvent; 6 7 abstract class Signal 8 { 9 /** 10 * Define which event types to listen for. 11 * 12 - * @return array<string|\SocialDept\Signals\Enums\SignalEventType> 13 */ 14 abstract public function eventTypes(): array; 15 ··· 42 * - [SignalCommitOperation::Delete] - Only handle deletes 43 * - null - Handle all operations (default) 44 * 45 - * @return array<string|\SocialDept\Signals\Enums\SignalCommitOperation>|null 46 */ 47 public function operations(): ?array 48 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Signals; 4 5 + use SocialDept\AtpSignals\Events\SignalEvent; 6 7 abstract class Signal 8 { 9 /** 10 * Define which event types to listen for. 11 * 12 + * @return array<string|\SocialDept\AtpSignals\Enums\SignalEventType> 13 */ 14 abstract public function eventTypes(): array; 15 ··· 42 * - [SignalCommitOperation::Delete] - Only handle deletes 43 * - null - Handle all operations (default) 44 * 45 + * @return array<string|\SocialDept\AtpSignals\Enums\SignalCommitOperation>|null 46 */ 47 public function operations(): ?array 48 {
+2 -2
src/Storage/DatabaseCursorStore.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Storage; 4 5 use Illuminate\Database\Query\Builder; 6 use Illuminate\Support\Facades\DB; 7 - use SocialDept\Signals\Contracts\CursorStore; 8 9 class DatabaseCursorStore implements CursorStore 10 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Storage; 4 5 use Illuminate\Database\Query\Builder; 6 use Illuminate\Support\Facades\DB; 7 + use SocialDept\AtpSignals\Contracts\CursorStore; 8 9 class DatabaseCursorStore implements CursorStore 10 {
+2 -2
src/Storage/FileCursorStore.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Storage; 4 5 use Illuminate\Support\Facades\File; 6 - use SocialDept\Signals\Contracts\CursorStore; 7 8 class FileCursorStore implements CursorStore 9 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Storage; 4 5 use Illuminate\Support\Facades\File; 6 + use SocialDept\AtpSignals\Contracts\CursorStore; 7 8 class FileCursorStore implements CursorStore 9 {
+2 -2
src/Storage/RedisCursorStore.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Storage; 4 5 use Illuminate\Support\Facades\Redis; 6 - use SocialDept\Signals\Contracts\CursorStore; 7 8 class RedisCursorStore implements CursorStore 9 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Storage; 4 5 use Illuminate\Support\Facades\Redis; 6 + use SocialDept\AtpSignals\Contracts\CursorStore; 7 8 class RedisCursorStore implements CursorStore 9 {
+1 -1
src/Support/WebSocketConnection.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Support; 4 5 use Ratchet\Client\Connector; 6 use Ratchet\Client\WebSocket;
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Support; 4 5 use Ratchet\Client\Connector; 6 use Ratchet\Client\WebSocket;
+2 -2
stubs/signal.stub
··· 2 3 namespace {{ namespace }}; 4 5 - use SocialDept\Signals\Events\SignalEvent; 6 - use SocialDept\Signals\Signals\Signal; 7 8 class {{ class }} extends Signal 9 {
··· 2 3 namespace {{ namespace }}; 4 5 + use SocialDept\AtpSignals\Events\SignalEvent; 6 + use SocialDept\AtpSignals\Signals\Signal; 7 8 class {{ class }} extends Signal 9 {
+4 -4
tests/Integration/FirehoseConsumerTest.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\Tests\Integration; 6 7 use Orchestra\Testbench\TestCase; 8 - use SocialDept\Signals\Core\CAR; 9 - use SocialDept\Signals\Core\CBOR; 10 - use SocialDept\Signals\Core\CID; 11 12 class FirehoseConsumerTest extends TestCase 13 {
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\Tests\Integration; 6 7 use Orchestra\Testbench\TestCase; 8 + use SocialDept\AtpSignals\Core\CAR; 9 + use SocialDept\AtpSignals\Core\CBOR; 10 + use SocialDept\AtpSignals\Core\CID; 11 12 class FirehoseConsumerTest extends TestCase 13 {
+3 -3
tests/Unit/CBORTest.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\Tests\Unit; 6 7 use PHPUnit\Framework\TestCase; 8 - use SocialDept\Signals\Core\CBOR; 9 - use SocialDept\Signals\Core\CID; 10 11 class CBORTest extends TestCase 12 {
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\Tests\Unit; 6 7 use PHPUnit\Framework\TestCase; 8 + use SocialDept\AtpSignals\Core\CBOR; 9 + use SocialDept\AtpSignals\Core\CID; 10 11 class CBORTest extends TestCase 12 {
+2 -2
tests/Unit/CIDTest.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\Tests\Unit; 6 7 use PHPUnit\Framework\TestCase; 8 - use SocialDept\Signals\Core\CID; 9 10 class CIDTest extends TestCase 11 {
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\Tests\Unit; 6 7 use PHPUnit\Framework\TestCase; 8 + use SocialDept\AtpSignals\Core\CID; 9 10 class CIDTest extends TestCase 11 {
+4 -4
tests/Unit/SignalRegistryTest.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Tests\Unit; 4 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Signals\Events\CommitEvent; 7 - use SocialDept\Signals\Events\SignalEvent; 8 - use SocialDept\Signals\Services\SignalRegistry; 9 10 class SignalRegistryTest extends TestCase 11 {
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Tests\Unit; 4 5 use Orchestra\Testbench\TestCase; 6 + use SocialDept\AtpSignals\Events\CommitEvent; 7 + use SocialDept\AtpSignals\Events\SignalEvent; 8 + use SocialDept\AtpSignals\Services\SignalRegistry; 9 10 class SignalRegistryTest extends TestCase 11 {
+5 -5
tests/Unit/SignalTest.php
··· 1 <?php 2 3 - namespace SocialDept\Signals\Tests\Unit; 4 5 use Orchestra\Testbench\TestCase; 6 - use SocialDept\Signals\Events\CommitEvent; 7 - use SocialDept\Signals\Events\SignalEvent; 8 - use SocialDept\Signals\Signals\Signal; 9 10 class SignalTest extends TestCase 11 { ··· 84 }; 85 86 // Create registry and register the signal 87 - $registry = new \SocialDept\Signals\Services\SignalRegistry(); 88 $registry->register($signalClass::class); 89 90 // Test that it matches app.bsky.feed.post
··· 1 <?php 2 3 + namespace SocialDept\AtpSignals\Tests\Unit; 4 5 use Orchestra\Testbench\TestCase; 6 + use SocialDept\AtpSignals\Events\CommitEvent; 7 + use SocialDept\AtpSignals\Events\SignalEvent; 8 + use SocialDept\AtpSignals\Signals\Signal; 9 10 class SignalTest extends TestCase 11 { ··· 84 }; 85 86 // Create registry and register the signal 87 + $registry = new \SocialDept\AtpSignals\Services\SignalRegistry(); 88 $registry->register($signalClass::class); 89 90 // Test that it matches app.bsky.feed.post
+2 -2
tests/Unit/VarintTest.php
··· 2 3 declare(strict_types=1); 4 5 - namespace SocialDept\Signals\Tests\Unit; 6 7 use PHPUnit\Framework\TestCase; 8 use RuntimeException; 9 - use SocialDept\Signals\Binary\Varint; 10 11 class VarintTest extends TestCase 12 {
··· 2 3 declare(strict_types=1); 4 5 + namespace SocialDept\AtpSignals\Tests\Unit; 6 7 use PHPUnit\Framework\TestCase; 8 use RuntimeException; 9 + use SocialDept\AtpSignals\Binary\Varint; 10 11 class VarintTest extends TestCase 12 {