|
85517
|
2933
|
1
|
2026-05-28T12:46:12.765465+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972372765_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.019946808,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","depth":4,"bounds":{"left":0.13630319,"top":0.14684756,"width":0.37300533,"height":0.85315245},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41589096,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2578250473464480529
|
-239707456976798810
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan...
|
85513
|
NULL
|
NULL
|
NULL
|
|
85516
|
2932
|
1
|
2026-05-28T12:46:10.701830+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972370701_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41
66
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01';
and id IN (32415, 32416);
# and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
SELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses
FROM text_relays
WHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')
GROUP BY email_provider_id;
SELECT id, status, telephony_provider_id, created_at
FROM activities
WHERE id IN (80028719, 80028846);
SELECT id, status, code, email_sent_at, created_at, updated_at
FROM text_relays
WHERE id IN (32415, 32416);
SELECT id, status, code, sender, recipient, created_at
FROM text_relays
WHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'
ORDER BY created_at DESC
LIMIT 10;
SELECT id, uuid, status, code, sender, recipient, created_at, updated_at
FROM text_relays
WHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');
# [PASSWORD_DOTS]
SELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count
FROM users u
INNER JOIN activities a ON u.id = .user_id
WHERE a.type LIKE 'sms%'
AND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY u.id, u.email, u.name, u.softphone_number
ORDER BY sms_count DESC;
select * from teams where id = 1;
select * from roles;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1117 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES
SELECT * FROM activities WHERE uuid_to_bin('[CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NO
SELECT * FROM crm_configurations WHERE id = 1053;
SELECT * FROM teams WHERE id = 1117;
select * from users where id = 30249;
select * from playbooks where id = 5473;
select * from playbook_categories where id = 43783;
select * from playbook_categories where playbook_id = 5473;
select * from crm_fields where id = 659242;
select * from crm_field_values where crm_field_id = 659242;
SELECT * FROM crm_field_data fd
# JOIN crm_fields f ON fd.crm_field_id = f.id
# JOIN activities a ON fd.activity_id = a.id
WHERE activity_id = 79933459
# AND f.crm_provider_id = 'hs_activity_type';
SELECT * FROM activity_messages;
select * from text_relays where created_at > '2026-05-01';
select * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;
select * from users where team_id = 1 and id IN (18608, 13934, 7160);
select * from activities where user_id = 7160 order by id desc limit 10;
select * from accounts where team_id = 1 and name = 'Column5';
select * from users where...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.041666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"45","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"41","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"66","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01';\nand id IN (32415, 32416);\n# and id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436\n\nSELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses\nFROM text_relays\nWHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')\nGROUP BY email_provider_id;\nSELECT id, status, telephony_provider_id, created_at\nFROM activities\nWHERE id IN (80028719, 80028846);\nSELECT id, status, code, email_sent_at, created_at, updated_at\nFROM text_relays\nWHERE id IN (32415, 32416);\nSELECT id, status, code, sender, recipient, created_at\nFROM text_relays\nWHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'\nORDER BY created_at DESC\nLIMIT 10;\n\nSELECT id, uuid, status, code, sender, recipient, created_at, updated_at\nFROM text_relays\nWHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');\n\n# ***************\nSELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count\nFROM users u\nINNER JOIN activities a ON u.id = .user_id\nWHERE a.type LIKE 'sms%'\nAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)\nGROUP BY u.id, u.email, u.name, u.softphone_number\nORDER BY sms_count DESC;\n\nselect * from teams where id = 1;\n\nselect * from roles;\n\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1117 and sa.provider = 'hubspot';\nSELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES\nSELECT * FROM activities WHERE uuid_to_bin('25529043-8094-4781-927f-4f4da2a8185c') = uuid; # 80186192 NO\nSELECT * FROM crm_configurations WHERE id = 1053;\nSELECT * FROM teams WHERE id = 1117;\nselect * from users where id = 30249;\nselect * from playbooks where id = 5473;\nselect * from playbook_categories where id = 43783;\nselect * from playbook_categories where playbook_id = 5473;\nselect * from crm_fields where id = 659242;\nselect * from crm_field_values where crm_field_id = 659242;\n\nSELECT * FROM crm_field_data fd\n# JOIN crm_fields f ON fd.crm_field_id = f.id\n# JOIN activities a ON fd.activity_id = a.id\nWHERE activity_id = 79933459\n# AND f.crm_provider_id = 'hs_activity_type';\n\n\nSELECT * FROM activity_messages;\nselect * from text_relays where created_at > '2026-05-01';\nselect * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;\nselect * from users where team_id = 1 and id IN (18608, 13934, 7160);\nselect * from activities where user_id = 7160 order by id desc limit 10;\n\nselect * from accounts where team_id = 1 and name = 'Column5';\n\nselect * from users where name like '%Subra%'; # 31054, 1117\nselect * from teams where id = 1117;\nselect * from activity_searches where user_id = 31054;\nselect * from activity_search_filters where activity_search_id IN (88882, 88902);","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01';\nand id IN (32415, 32416);\n# and id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436\n\nSELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses\nFROM text_relays\nWHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')\nGROUP BY email_provider_id;\nSELECT id, status, telephony_provider_id, created_at\nFROM activities\nWHERE id IN (80028719, 80028846);\nSELECT id, status, code, email_sent_at, created_at, updated_at\nFROM text_relays\nWHERE id IN (32415, 32416);\nSELECT id, status, code, sender, recipient, created_at\nFROM text_relays\nWHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'\nORDER BY created_at DESC\nLIMIT 10;\n\nSELECT id, uuid, status, code, sender, recipient, created_at, updated_at\nFROM text_relays\nWHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');\n\n# ***************\nSELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count\nFROM users u\nINNER JOIN activities a ON u.id = .user_id\nWHERE a.type LIKE 'sms%'\nAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)\nGROUP BY u.id, u.email, u.name, u.softphone_number\nORDER BY sms_count DESC;\n\nselect * from teams where id = 1;\n\nselect * from roles;\n\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1117 and sa.provider = 'hubspot';\nSELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES\nSELECT * FROM activities WHERE uuid_to_bin('25529043-8094-4781-927f-4f4da2a8185c') = uuid; # 80186192 NO\nSELECT * FROM crm_configurations WHERE id = 1053;\nSELECT * FROM teams WHERE id = 1117;\nselect * from users where id = 30249;\nselect * from playbooks where id = 5473;\nselect * from playbook_categories where id = 43783;\nselect * from playbook_categories where playbook_id = 5473;\nselect * from crm_fields where id = 659242;\nselect * from crm_field_values where crm_field_id = 659242;\n\nSELECT * FROM crm_field_data fd\n# JOIN crm_fields f ON fd.crm_field_id = f.id\n# JOIN activities a ON fd.activity_id = a.id\nWHERE activity_id = 79933459\n# AND f.crm_provider_id = 'hs_activity_type';\n\n\nSELECT * FROM activity_messages;\nselect * from text_relays where created_at > '2026-05-01';\nselect * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;\nselect * from users where team_id = 1 and id IN (18608, 13934, 7160);\nselect * from activities where user_id = 7160 order by id desc limit 10;\n\nselect * from accounts where team_id = 1 and name = 'Column5';\n\nselect * from users where name like '%Subra%'; # 31054, 1117\nselect * from teams where id = 1117;\nselect * from activity_searches where user_id = 31054;\nselect * from activity_search_filters where activity_search_id IN (88882, 88902);","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-3426377887922344263
|
2218652917440067399
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41
66
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01';
and id IN (32415, 32416);
# and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
SELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses
FROM text_relays
WHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')
GROUP BY email_provider_id;
SELECT id, status, telephony_provider_id, created_at
FROM activities
WHERE id IN (80028719, 80028846);
SELECT id, status, code, email_sent_at, created_at, updated_at
FROM text_relays
WHERE id IN (32415, 32416);
SELECT id, status, code, sender, recipient, created_at
FROM text_relays
WHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'
ORDER BY created_at DESC
LIMIT 10;
SELECT id, uuid, status, code, sender, recipient, created_at, updated_at
FROM text_relays
WHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');
# [PASSWORD_DOTS]
SELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count
FROM users u
INNER JOIN activities a ON u.id = .user_id
WHERE a.type LIKE 'sms%'
AND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY u.id, u.email, u.name, u.softphone_number
ORDER BY sms_count DESC;
select * from teams where id = 1;
select * from roles;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1117 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES
SELECT * FROM activities WHERE uuid_to_bin('[CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NO
SELECT * FROM crm_configurations WHERE id = 1053;
SELECT * FROM teams WHERE id = 1117;
select * from users where id = 30249;
select * from playbooks where id = 5473;
select * from playbook_categories where id = 43783;
select * from playbook_categories where playbook_id = 5473;
select * from crm_fields where id = 659242;
select * from crm_field_values where crm_field_id = 659242;
SELECT * FROM crm_field_data fd
# JOIN crm_fields f ON fd.crm_field_id = f.id
# JOIN activities a ON fd.activity_id = a.id
WHERE activity_id = 79933459
# AND f.crm_provider_id = 'hs_activity_type';
SELECT * FROM activity_messages;
select * from text_relays where created_at > '2026-05-01';
select * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;
select * from users where team_id = 1 and id IN (18608, 13934, 7160);
select * from activities where user_id = 7160 order by id desc limit 10;
select * from accounts where team_id = 1 and name = 'Column5';
select * from users where...
|
85512
|
NULL
|
NULL
|
NULL
|
|
85515
|
2933
|
0
|
2026-05-28T12:45:42.399515+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972342399_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.019946808,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","depth":4,"bounds":{"left":0.13630319,"top":0.14684756,"width":0.37300533,"height":0.85315245},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41589096,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.43550533,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5516507573295334113
|
-239707456976798842
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History...
|
85513
|
NULL
|
NULL
|
NULL
|
|
85514
|
2932
|
0
|
2026-05-28T12:45:40.394162+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972340394_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41
66
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01';
and id IN (32415, 32416);
# and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
SELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses
FROM text_relays
WHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')
GROUP BY email_provider_id;
SELECT id, status, telephony_provider_id, created_at
FROM activities
WHERE id IN (80028719, 80028846);
SELECT id, status, code, email_sent_at, created_at, updated_at
FROM text_relays
WHERE id IN (32415, 32416);
SELECT id, status, code, sender, recipient, created_at
FROM text_relays
WHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'
ORDER BY created_at DESC
LIMIT 10;
SELECT id, uuid, status, code, sender, recipient, created_at, updated_at
FROM text_relays
WHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');
# [PASSWORD_DOTS]
SELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count
FROM users u
INNER JOIN activities a ON u.id = .user_id
WHERE a.type LIKE 'sms%'
AND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY u.id, u.email, u.name, u.softphone_number
ORDER BY sms_count DESC;
select * from teams where id = 1;
select * from roles;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1117 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES
SELECT * FROM activities WHERE uuid_to_bin('[CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NO
SELECT * FROM crm_configurations WHERE id = 1053;
SELECT * FROM teams WHERE id = 1117;
select * from users where id = 30249;
select * from playbooks where id = 5473;
select * from playbook_categories where id = 43783;
select * from playbook_categories where playbook_id = 5473;
select * from crm_fields where id = 659242;
select * from crm_field_values where crm_field_id = 659242;
SELECT * FROM crm_field_data fd
# JOIN crm_fields f ON fd.crm_field_id = f.id
# JOIN activities a ON fd.activity_id = a.id
WHERE activity_id = 79933459
# AND f.crm_provider_id = 'hs_activity_type';
SELECT * FROM activity_messages;
select * from text_relays where created_at > '2026-05-01';
select * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;
select * from users where team_id = 1 and id IN (18608, 13934, 7160);
select * from activities where user_id = 7160 order by id desc limit 10;
select * from accounts where team_id = 1 and name = 'Column5';
select * from users where...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.041666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"45","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"41","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"66","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01';\nand id IN (32415, 32416);\n# and id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436\n\nSELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses\nFROM text_relays\nWHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')\nGROUP BY email_provider_id;\nSELECT id, status, telephony_provider_id, created_at\nFROM activities\nWHERE id IN (80028719, 80028846);\nSELECT id, status, code, email_sent_at, created_at, updated_at\nFROM text_relays\nWHERE id IN (32415, 32416);\nSELECT id, status, code, sender, recipient, created_at\nFROM text_relays\nWHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'\nORDER BY created_at DESC\nLIMIT 10;\n\nSELECT id, uuid, status, code, sender, recipient, created_at, updated_at\nFROM text_relays\nWHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');\n\n# ***************\nSELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count\nFROM users u\nINNER JOIN activities a ON u.id = .user_id\nWHERE a.type LIKE 'sms%'\nAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)\nGROUP BY u.id, u.email, u.name, u.softphone_number\nORDER BY sms_count DESC;\n\nselect * from teams where id = 1;\n\nselect * from roles;\n\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1117 and sa.provider = 'hubspot';\nSELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES\nSELECT * FROM activities WHERE uuid_to_bin('25529043-8094-4781-927f-4f4da2a8185c') = uuid; # 80186192 NO\nSELECT * FROM crm_configurations WHERE id = 1053;\nSELECT * FROM teams WHERE id = 1117;\nselect * from users where id = 30249;\nselect * from playbooks where id = 5473;\nselect * from playbook_categories where id = 43783;\nselect * from playbook_categories where playbook_id = 5473;\nselect * from crm_fields where id = 659242;\nselect * from crm_field_values where crm_field_id = 659242;\n\nSELECT * FROM crm_field_data fd\n# JOIN crm_fields f ON fd.crm_field_id = f.id\n# JOIN activities a ON fd.activity_id = a.id\nWHERE activity_id = 79933459\n# AND f.crm_provider_id = 'hs_activity_type';\n\n\nSELECT * FROM activity_messages;\nselect * from text_relays where created_at > '2026-05-01';\nselect * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;\nselect * from users where team_id = 1 and id IN (18608, 13934, 7160);\nselect * from activities where user_id = 7160 order by id desc limit 10;\n\nselect * from accounts where team_id = 1 and name = 'Column5';\n\nselect * from users where name like '%Subra%'; # 31054, 1117\nselect * from teams where id = 1117;\nselect * from activity_searches where user_id = 31054;\nselect * from activity_search_filters where activity_search_id IN (88882, 88902);","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01';\nand id IN (32415, 32416);\n# and id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436\n\nSELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses\nFROM text_relays\nWHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')\nGROUP BY email_provider_id;\nSELECT id, status, telephony_provider_id, created_at\nFROM activities\nWHERE id IN (80028719, 80028846);\nSELECT id, status, code, email_sent_at, created_at, updated_at\nFROM text_relays\nWHERE id IN (32415, 32416);\nSELECT id, status, code, sender, recipient, created_at\nFROM text_relays\nWHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'\nORDER BY created_at DESC\nLIMIT 10;\n\nSELECT id, uuid, status, code, sender, recipient, created_at, updated_at\nFROM text_relays\nWHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');\n\n# ***************\nSELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count\nFROM users u\nINNER JOIN activities a ON u.id = .user_id\nWHERE a.type LIKE 'sms%'\nAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)\nGROUP BY u.id, u.email, u.name, u.softphone_number\nORDER BY sms_count DESC;\n\nselect * from teams where id = 1;\n\nselect * from roles;\n\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1117 and sa.provider = 'hubspot';\nSELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES\nSELECT * FROM activities WHERE uuid_to_bin('25529043-8094-4781-927f-4f4da2a8185c') = uuid; # 80186192 NO\nSELECT * FROM crm_configurations WHERE id = 1053;\nSELECT * FROM teams WHERE id = 1117;\nselect * from users where id = 30249;\nselect * from playbooks where id = 5473;\nselect * from playbook_categories where id = 43783;\nselect * from playbook_categories where playbook_id = 5473;\nselect * from crm_fields where id = 659242;\nselect * from crm_field_values where crm_field_id = 659242;\n\nSELECT * FROM crm_field_data fd\n# JOIN crm_fields f ON fd.crm_field_id = f.id\n# JOIN activities a ON fd.activity_id = a.id\nWHERE activity_id = 79933459\n# AND f.crm_provider_id = 'hs_activity_type';\n\n\nSELECT * FROM activity_messages;\nselect * from text_relays where created_at > '2026-05-01';\nselect * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;\nselect * from users where team_id = 1 and id IN (18608, 13934, 7160);\nselect * from activities where user_id = 7160 order by id desc limit 10;\n\nselect * from accounts where team_id = 1 and name = 'Column5';\n\nselect * from users where name like '%Subra%'; # 31054, 1117\nselect * from teams where id = 1117;\nselect * from activity_searches where user_id = 31054;\nselect * from activity_search_filters where activity_search_id IN (88882, 88902);","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-3426377887922344263
|
2218652917440067399
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41
66
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01';
and id IN (32415, 32416);
# and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
SELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses
FROM text_relays
WHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')
GROUP BY email_provider_id;
SELECT id, status, telephony_provider_id, created_at
FROM activities
WHERE id IN (80028719, 80028846);
SELECT id, status, code, email_sent_at, created_at, updated_at
FROM text_relays
WHERE id IN (32415, 32416);
SELECT id, status, code, sender, recipient, created_at
FROM text_relays
WHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'
ORDER BY created_at DESC
LIMIT 10;
SELECT id, uuid, status, code, sender, recipient, created_at, updated_at
FROM text_relays
WHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');
# [PASSWORD_DOTS]
SELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count
FROM users u
INNER JOIN activities a ON u.id = .user_id
WHERE a.type LIKE 'sms%'
AND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY u.id, u.email, u.name, u.softphone_number
ORDER BY sms_count DESC;
select * from teams where id = 1;
select * from roles;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1117 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES
SELECT * FROM activities WHERE uuid_to_bin('[CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NO
SELECT * FROM crm_configurations WHERE id = 1053;
SELECT * FROM teams WHERE id = 1117;
select * from users where id = 30249;
select * from playbooks where id = 5473;
select * from playbook_categories where id = 43783;
select * from playbook_categories where playbook_id = 5473;
select * from crm_fields where id = 659242;
select * from crm_field_values where crm_field_id = 659242;
SELECT * FROM crm_field_data fd
# JOIN crm_fields f ON fd.crm_field_id = f.id
# JOIN activities a ON fd.activity_id = a.id
WHERE activity_id = 79933459
# AND f.crm_provider_id = 'hs_activity_type';
SELECT * FROM activity_messages;
select * from text_relays where created_at > '2026-05-01';
select * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;
select * from users where team_id = 1 and id IN (18608, 13934, 7160);
select * from activities where user_id = 7160 order by id desc limit 10;
select * from accounts where team_id = 1 and name = 'Column5';
select * from users where...
|
85512
|
NULL
|
NULL
|
NULL
|
|
85513
|
NULL
|
0
|
2026-05-28T12:45:12.029765+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972312029_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.019946808,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","depth":4,"bounds":{"left":0.13630319,"top":0.14684756,"width":0.37300533,"height":0.85315245},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41589096,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.43550533,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5516507573295334113
|
-239707456976798842
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85512
|
NULL
|
0
|
2026-05-28T12:45:10.005704+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972310005_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41
66
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01';
and id IN (32415, 32416);
# and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
SELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses
FROM text_relays
WHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')
GROUP BY email_provider_id;
SELECT id, status, telephony_provider_id, created_at
FROM activities
WHERE id IN (80028719, 80028846);
SELECT id, status, code, email_sent_at, created_at, updated_at
FROM text_relays
WHERE id IN (32415, 32416);
SELECT id, status, code, sender, recipient, created_at
FROM text_relays
WHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'
ORDER BY created_at DESC
LIMIT 10;
SELECT id, uuid, status, code, sender, recipient, created_at, updated_at
FROM text_relays
WHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');
# [PASSWORD_DOTS]
SELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count
FROM users u
INNER JOIN activities a ON u.id = .user_id
WHERE a.type LIKE 'sms%'
AND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY u.id, u.email, u.name, u.softphone_number
ORDER BY sms_count DESC;
select * from teams where id = 1;
select * from roles;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1117 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES
SELECT * FROM activities WHERE uuid_to_bin('[CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NO
SELECT * FROM crm_configurations WHERE id = 1053;
SELECT * FROM teams WHERE id = 1117;
select * from users where id = 30249;
select * from playbooks where id = 5473;
select * from playbook_categories where id = 43783;
select * from playbook_categories where playbook_id = 5473;
select * from crm_fields where id = 659242;
select * from crm_field_values where crm_field_id = 659242;
SELECT * FROM crm_field_data fd
# JOIN crm_fields f ON fd.crm_field_id = f.id
# JOIN activities a ON fd.activity_id = a.id
WHERE activity_id = 79933459
# AND f.crm_provider_id = 'hs_activity_type';
SELECT * FROM activity_messages;
select * from text_relays where created_at > '2026-05-01';
select * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;
select * from users where team_id = 1 and id IN (18608, 13934, 7160);
select * from activities where user_id = 7160 order by id desc limit 10;
select * from accounts where team_id = 1 and name = 'Column5';
select * from users where...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.041666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"45","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"41","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"66","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01';\nand id IN (32415, 32416);\n# and id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436\n\nSELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses\nFROM text_relays\nWHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')\nGROUP BY email_provider_id;\nSELECT id, status, telephony_provider_id, created_at\nFROM activities\nWHERE id IN (80028719, 80028846);\nSELECT id, status, code, email_sent_at, created_at, updated_at\nFROM text_relays\nWHERE id IN (32415, 32416);\nSELECT id, status, code, sender, recipient, created_at\nFROM text_relays\nWHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'\nORDER BY created_at DESC\nLIMIT 10;\n\nSELECT id, uuid, status, code, sender, recipient, created_at, updated_at\nFROM text_relays\nWHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');\n\n# ***************\nSELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count\nFROM users u\nINNER JOIN activities a ON u.id = .user_id\nWHERE a.type LIKE 'sms%'\nAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)\nGROUP BY u.id, u.email, u.name, u.softphone_number\nORDER BY sms_count DESC;\n\nselect * from teams where id = 1;\n\nselect * from roles;\n\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1117 and sa.provider = 'hubspot';\nSELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES\nSELECT * FROM activities WHERE uuid_to_bin('25529043-8094-4781-927f-4f4da2a8185c') = uuid; # 80186192 NO\nSELECT * FROM crm_configurations WHERE id = 1053;\nSELECT * FROM teams WHERE id = 1117;\nselect * from users where id = 30249;\nselect * from playbooks where id = 5473;\nselect * from playbook_categories where id = 43783;\nselect * from playbook_categories where playbook_id = 5473;\nselect * from crm_fields where id = 659242;\nselect * from crm_field_values where crm_field_id = 659242;\n\nSELECT * FROM crm_field_data fd\n# JOIN crm_fields f ON fd.crm_field_id = f.id\n# JOIN activities a ON fd.activity_id = a.id\nWHERE activity_id = 79933459\n# AND f.crm_provider_id = 'hs_activity_type';\n\n\nSELECT * FROM activity_messages;\nselect * from text_relays where created_at > '2026-05-01';\nselect * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;\nselect * from users where team_id = 1 and id IN (18608, 13934, 7160);\nselect * from activities where user_id = 7160 order by id desc limit 10;\n\nselect * from accounts where team_id = 1 and name = 'Column5';\n\nselect * from users where name like '%Subra%'; # 31054, 1117\nselect * from teams where id = 1117;\nselect * from activity_searches where user_id = 31054;\nselect * from activity_search_filters where activity_search_id IN (88882, 88902);","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01';\nand id IN (32415, 32416);\n# and id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436\n\nSELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses\nFROM text_relays\nWHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')\nGROUP BY email_provider_id;\nSELECT id, status, telephony_provider_id, created_at\nFROM activities\nWHERE id IN (80028719, 80028846);\nSELECT id, status, code, email_sent_at, created_at, updated_at\nFROM text_relays\nWHERE id IN (32415, 32416);\nSELECT id, status, code, sender, recipient, created_at\nFROM text_relays\nWHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'\nORDER BY created_at DESC\nLIMIT 10;\n\nSELECT id, uuid, status, code, sender, recipient, created_at, updated_at\nFROM text_relays\nWHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');\n\n# ***************\nSELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count\nFROM users u\nINNER JOIN activities a ON u.id = .user_id\nWHERE a.type LIKE 'sms%'\nAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)\nGROUP BY u.id, u.email, u.name, u.softphone_number\nORDER BY sms_count DESC;\n\nselect * from teams where id = 1;\n\nselect * from roles;\n\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1117 and sa.provider = 'hubspot';\nSELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES\nSELECT * FROM activities WHERE uuid_to_bin('25529043-8094-4781-927f-4f4da2a8185c') = uuid; # 80186192 NO\nSELECT * FROM crm_configurations WHERE id = 1053;\nSELECT * FROM teams WHERE id = 1117;\nselect * from users where id = 30249;\nselect * from playbooks where id = 5473;\nselect * from playbook_categories where id = 43783;\nselect * from playbook_categories where playbook_id = 5473;\nselect * from crm_fields where id = 659242;\nselect * from crm_field_values where crm_field_id = 659242;\n\nSELECT * FROM crm_field_data fd\n# JOIN crm_fields f ON fd.crm_field_id = f.id\n# JOIN activities a ON fd.activity_id = a.id\nWHERE activity_id = 79933459\n# AND f.crm_provider_id = 'hs_activity_type';\n\n\nSELECT * FROM activity_messages;\nselect * from text_relays where created_at > '2026-05-01';\nselect * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;\nselect * from users where team_id = 1 and id IN (18608, 13934, 7160);\nselect * from activities where user_id = 7160 order by id desc limit 10;\n\nselect * from accounts where team_id = 1 and name = 'Column5';\n\nselect * from users where name like '%Subra%'; # 31054, 1117\nselect * from teams where id = 1117;\nselect * from activity_searches where user_id = 31054;\nselect * from activity_search_filters where activity_search_id IN (88882, 88902);","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-3426377887922344263
|
2218652917440067399
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41
66
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01';
and id IN (32415, 32416);
# and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
SELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses
FROM text_relays
WHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')
GROUP BY email_provider_id;
SELECT id, status, telephony_provider_id, created_at
FROM activities
WHERE id IN (80028719, 80028846);
SELECT id, status, code, email_sent_at, created_at, updated_at
FROM text_relays
WHERE id IN (32415, 32416);
SELECT id, status, code, sender, recipient, created_at
FROM text_relays
WHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'
ORDER BY created_at DESC
LIMIT 10;
SELECT id, uuid, status, code, sender, recipient, created_at, updated_at
FROM text_relays
WHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');
# [PASSWORD_DOTS]
SELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count
FROM users u
INNER JOIN activities a ON u.id = .user_id
WHERE a.type LIKE 'sms%'
AND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY u.id, u.email, u.name, u.softphone_number
ORDER BY sms_count DESC;
select * from teams where id = 1;
select * from roles;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1117 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES
SELECT * FROM activities WHERE uuid_to_bin('[CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NO
SELECT * FROM crm_configurations WHERE id = 1053;
SELECT * FROM teams WHERE id = 1117;
select * from users where id = 30249;
select * from playbooks where id = 5473;
select * from playbook_categories where id = 43783;
select * from playbook_categories where playbook_id = 5473;
select * from crm_fields where id = 659242;
select * from crm_field_values where crm_field_id = 659242;
SELECT * FROM crm_field_data fd
# JOIN crm_fields f ON fd.crm_field_id = f.id
# JOIN activities a ON fd.activity_id = a.id
WHERE activity_id = 79933459
# AND f.crm_provider_id = 'hs_activity_type';
SELECT * FROM activity_messages;
select * from text_relays where created_at > '2026-05-01';
select * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;
select * from users where team_id = 1 and id IN (18608, 13934, 7160);
select * from activities where user_id = 7160 order by id desc limit 10;
select * from accounts where team_id = 1 and name = 'Column5';
select * from users where...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85511
|
2931
|
16
|
2026-05-28T12:44:41.683601+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972281683_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.019946808,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","depth":4,"bounds":{"left":0.13630319,"top":0.14684756,"width":0.37300533,"height":0.85315245},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
-8304606894645505368
|
-239707456976798810
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}...
|
85510
|
NULL
|
NULL
|
NULL
|
|
85510
|
2931
|
15
|
2026-05-28T12:44:39.690932+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972279690_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5091835203192983291
|
-8776159844266423872
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
rapstomEV faVsco,ls ~ProjectvViewCooc#12121 on JY-20963-fix-InWindowwnapers.ohv Salesforc› 0 Fields• OpportunityMatcher• OpportunitySyncStrateProspectSearchStrateg› ServiceTraits© ClientTest.phpC DecorateActivityTest.pC DeleteObjects TraitTestC FieldDefinitionsTest.ph© GetActivityFieldNametE PayloadBullder Test.phy@ QueryBullderTest.phpQueryHandlerTest.phoC QueryiteratorTest.php© QueryResultsTests.phc© ServiceTest.phpc) Suncta chredk Servic© BaseServiceTest.phpceacheemsarcod.oco© CrmActivityServiceTest.pteeimeontauratonsottnad© CrmObjectsResolverTest,OLekоkyseiwico.on©ActivityController.php© Kemnel.php© Client.phpPap aUlOoenOeCneSTNCEVORSDMnamesoace tests. Untt Services hasuse Soogle Seruice cnatl as sooqi esnaneuse 6oogle\Service\Gnail\Message as GnailMessage;use soogle Serwice charl Nessage?antuse Google\Service\Gnail\MessagePartHeader;userulursinate Suppors Facades conto.use Jininny\Services\Mail\TextRelayService;uea proios Soaneronkytes hitae Thovaneh neeuse PHPUnit\Franework\Attributes\DataProvider:use Tests\TestCase;use ReflectionClass;use Nockery:#[CoversClass(TextRelayService:: class)]class TextRelayServiceTest extends TestCase© EmaillHelper Test.phpFieldValueconverterTest.fLayoutManagerTest.phpMiarateProvderSandcal.C OpportunityActivityMatchi© OpportunitySyncStrategyf© ProspectCacheTest.php© ProspectSearchStrategyf:G ProviderRegistryTest.php© RecordSelectorTest.php€ ResolveCompanyNameBylC TimePerioditeratorTest.ph© UpdateCrmDataResclverT>Ea Internal› E Kioskwiewar› @Actions› Office> &a Resolvers→D traits• - Validators181 %c) BatchservicetestchoE EmallActivityService Test.,f 212 €© InboxServiceTest.phpTextRelayServiceTest.php.IilMeet ne caneratorM Notification> A RoCalIAIpublic static function environmentProvider(): arrayf...,protected function setUp(): voidf...,protected function tearDown(): voidf...,#[OataProvider('environmentProvider")]public function testIsForCurrentEnvironnentWithMatchingXGn0riginalToHeader(string SdeployRegion, stringwoata?rouider'envs.ronment?row.der"ouloublic functsion testlsForkunnentEnvironnentZanonesTolesdenO= wotdk...Houblie functsion testIefor@urcentEnwironnentTkthf-otvHeadens= vosdh...%public function testIsForCurrentEnvironnentWithException(): voidf...nubbictunctsion teetSyncliseszuASinssorsubechion oi wosda.public function testSyncUsesUsALiasForUsRegion(): voidf...PatAApublic function test6etlistorywithpagineAccept Fle X.х коссіню 0хеoo Inu comoy 10:44:02E customlogE Iaravel.logA SF (iminny@localhost)A console (STAGING)0 0 €i.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)Ry mialRunUTextRelayServiceTestxvOErO:~ v Test ResultsA console (PROD) x © Service,phpds consoe leu,68 jminny045 A1 A41 X66 ACascadeanoainellohtine<truncated 184 lines»aewerhdhra roundloin doceconnen tor ferhed3SAc 447m726v 17 tests passed 17 tests total, 3 sec 447 ms)[docker-compose://l/Users/Lukas/j1minny/infrastructure/dev/docker/docker-compose.ymUJ:Lamp/1:php -/vendor/bin/phpunit --configuration phpunit.xml --filter Tests| \Unit||Servicesl +Tes aind stanted at 15:44.WARN[0000] /Users/Lukas/jiminny/infrastructure/dev/docker/docker-conpose.ynl: the attribute "version' is obsolete, it will be ignored, please renove it to avoid potential confussPupun.5SS bu Scbaesian Beramann and contetibutonsPuntindPHp 8.5,Sconiaunat.ion:hone/iiminny//nhnunst.xnsine: 88:8S.Sas. Menory: 66.00M:thene wasPHPlnit test cunner warnsing.Na nado Aauonsno dasvon avashlahrnu t +hond Hono echocllTocte: 17 Aecontsanes 18 ouolias+ WannsnaetWhat's next:Debug this Compose error with Gordon » docker ai "help me fix this compose erron"OAnansd Blnlchod with oukt colojerviceTestivityServiceTest::testGetAcuse a depreces ed steadiltwdcalslidntfanTactertactlnder is ignored in current code)merchescurtenicimo..ementa.ioncall Whch coche chosAeerroraccoun emCRinDOESem nanERОnGt * from users where nane Like '%Subrax": # 31054, 1117t * from teans where id = 1117:+* Sron activity sparches where usen id = 31054+trom actavity search filltens where actaivity seanch.sid TM 88882 88082)1tile +168Ask anything (XOL)@ Code swioThsand testConstructorThroushh.or integration testsmolex mocking of databastBul -RTRetctalAcceot allKowodeu Taimeehi.%ensd....
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85509
|
2930
|
10
|
2026-05-28T12:44:39.590587+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972279590_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.041666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-942531853549382332
|
-221694157978944634
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification...
|
85507
|
NULL
|
NULL
|
NULL
|
|
85508
|
2931
|
14
|
2026-05-28T12:44:28.734640+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972268734_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Rerun 'PHPUnit: TextRelayServiceTest'
Debug 'TextRelayServiceTest'
Stop 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41
66
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01';
and id IN (32415, 32416);
# and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
SELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses
FROM text_relays
WHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')
GROUP BY email_provider_id;
SELECT id, status, telephony_provider_id, created_at
FROM activities
WHERE id IN (80028719, 80028846);
SELECT id, status, code, email_sent_at, created_at, updated_at
FROM text_relays
WHERE id IN (32415, 32416);
SELECT id, status, code, sender, recipient, created_at
FROM text_relays
WHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'
ORDER BY created_at DESC
LIMIT 10;
SELECT id, uuid, status, code, sender, recipient, created_at, updated_at
FROM text_relays
WHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');
# [PASSWORD_DOTS]
SELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count
FROM users u
INNER JOIN activities a ON u.id = .user_id
WHERE a.type LIKE 'sms%'
AND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY u.id, u.email, u.name, u.softphone_number
ORDER BY sms_count DESC;
select * from teams where id = 1;
select * from roles;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1117 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES
SELECT * FROM activities WHERE uuid_to_bin('[CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NO
SELECT * FROM crm_configurations WHERE id = 1053;
SELECT * FROM teams WHERE id = 1117;
select * from users where id = 30249;
select * from playbooks where id = 5473;
select * from playbook_categories where id = 43783;
select * from playbook_categories where playbook_id = 5473;
select * from crm_fields where id = 659242;
select * from crm_field_values where crm_field_id = 659242;
SELECT * FROM crm_field_data fd
# JOIN crm_fields f ON fd.crm_field_id = f.id
# JOIN activities a ON fd.activity_id = a.id
WHERE activity_id = 79933459
# AND f.crm_provider_id = 'hs_activity_type';
SELECT * FROM activity_messages;
select * from text_relays where created_at > '2026-05-01';
select * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;
select * from users where team_id = 1 and id IN (18608, 13934, 7160);
select * from activities where user_id = 7160 order by id desc limit 10;
select * from accounts where team_id = 1 and name ...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Rerun 'PHPUnit: TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Stop 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9494681,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.019946808,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","depth":4,"bounds":{"left":0.13630319,"top":0.14684756,"width":0.37300533,"height":0.85315245},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41589096,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.43550533,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.44414893,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.45279256,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.4637633,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.47473404,"top":0.09896249,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.5013298,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.51230055,"top":0.09896249,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.7237367,"top":0.09896249,"width":0.02825798,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"45","depth":4,"bounds":{"left":0.6938165,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.70611703,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"41","depth":4,"bounds":{"left":0.71542555,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"66","depth":4,"bounds":{"left":0.72706115,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.7390292,"top":0.12210695,"width":0.00731383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.7463431,"top":0.12210695,"width":0.006981383,"height":0.018355945},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01';\nand id IN (32415, 32416);\n# and id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436\n\nSELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses\nFROM text_relays\nWHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')\nGROUP BY email_provider_id;\nSELECT id, status, telephony_provider_id, created_at\nFROM activities\nWHERE id IN (80028719, 80028846);\nSELECT id, status, code, email_sent_at, created_at, updated_at\nFROM text_relays\nWHERE id IN (32415, 32416);\nSELECT id, status, code, sender, recipient, created_at\nFROM text_relays\nWHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'\nORDER BY created_at DESC\nLIMIT 10;\n\nSELECT id, uuid, status, code, sender, recipient, created_at, updated_at\nFROM text_relays\nWHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');\n\n# ***************\nSELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count\nFROM users u\nINNER JOIN activities a ON u.id = .user_id\nWHERE a.type LIKE 'sms%'\nAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)\nGROUP BY u.id, u.email, u.name, u.softphone_number\nORDER BY sms_count DESC;\n\nselect * from teams where id = 1;\n\nselect * from roles;\n\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1117 and sa.provider = 'hubspot';\nSELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES\nSELECT * FROM activities WHERE uuid_to_bin('25529043-8094-4781-927f-4f4da2a8185c') = uuid; # 80186192 NO\nSELECT * FROM crm_configurations WHERE id = 1053;\nSELECT * FROM teams WHERE id = 1117;\nselect * from users where id = 30249;\nselect * from playbooks where id = 5473;\nselect * from playbook_categories where id = 43783;\nselect * from playbook_categories where playbook_id = 5473;\nselect * from crm_fields where id = 659242;\nselect * from crm_field_values where crm_field_id = 659242;\n\nSELECT * FROM crm_field_data fd\n# JOIN crm_fields f ON fd.crm_field_id = f.id\n# JOIN activities a ON fd.activity_id = a.id\nWHERE activity_id = 79933459\n# AND f.crm_provider_id = 'hs_activity_type';\n\n\nSELECT * FROM activity_messages;\nselect * from text_relays where created_at > '2026-05-01';\nselect * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;\nselect * from users where team_id = 1 and id IN (18608, 13934, 7160);\nselect * from activities where user_id = 7160 order by id desc limit 10;\n\nselect * from accounts where team_id = 1 and name = 'Column5';\n\nselect * from users where name like '%Subra%'; # 31054, 1117\nselect * from teams where id = 1117;\nselect * from activity_searches where user_id = 31054;\nselect * from activity_search_filters where activity_search_id IN (88882, 88902);","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01';\nand id IN (32415, 32416);\n# and id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436\n\nSELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses\nFROM text_relays\nWHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')\nGROUP BY email_provider_id;\nSELECT id, status, telephony_provider_id, created_at\nFROM activities\nWHERE id IN (80028719, 80028846);\nSELECT id, status, code, email_sent_at, created_at, updated_at\nFROM text_relays\nWHERE id IN (32415, 32416);\nSELECT id, status, code, sender, recipient, created_at\nFROM text_relays\nWHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'\nORDER BY created_at DESC\nLIMIT 10;\n\nSELECT id, uuid, status, code, sender, recipient, created_at, updated_at\nFROM text_relays\nWHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');\n\n# ***************\nSELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count\nFROM users u\nINNER JOIN activities a ON u.id = .user_id\nWHERE a.type LIKE 'sms%'\nAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)\nGROUP BY u.id, u.email, u.name, u.softphone_number\nORDER BY sms_count DESC;\n\nselect * from teams where id = 1;\n\nselect * from roles;\n\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1117 and sa.provider = 'hubspot';\nSELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES\nSELECT * FROM activities WHERE uuid_to_bin('25529043-8094-4781-927f-4f4da2a8185c') = uuid; # 80186192 NO\nSELECT * FROM crm_configurations WHERE id = 1053;\nSELECT * FROM teams WHERE id = 1117;\nselect * from users where id = 30249;\nselect * from playbooks where id = 5473;\nselect * from playbook_categories where id = 43783;\nselect * from playbook_categories where playbook_id = 5473;\nselect * from crm_fields where id = 659242;\nselect * from crm_field_values where crm_field_id = 659242;\n\nSELECT * FROM crm_field_data fd\n# JOIN crm_fields f ON fd.crm_field_id = f.id\n# JOIN activities a ON fd.activity_id = a.id\nWHERE activity_id = 79933459\n# AND f.crm_provider_id = 'hs_activity_type';\n\n\nSELECT * FROM activity_messages;\nselect * from text_relays where created_at > '2026-05-01';\nselect * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;\nselect * from users where team_id = 1 and id IN (18608, 13934, 7160);\nselect * from activities where user_id = 7160 order by id desc limit 10;\n\nselect * from accounts where team_id = 1 and name = 'Column5';\n\nselect * from users where name like '%Subra%'; # 31054, 1117\nselect * from teams where id = 1117;\nselect * from activity_searches where user_id = 31054;\nselect * from activity_search_filters where activity_search_id IN (88882, 88902);","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"bounds":{"left":0.011968086,"top":0.047885075,"width":0.024268618,"height":0.024740623},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Options","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3828161051717048171
|
2218635325254022983
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Rerun 'PHPUnit: TextRelayServiceTest'
Debug 'TextRelayServiceTest'
Stop 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41
66
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01';
and id IN (32415, 32416);
# and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
SELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses
FROM text_relays
WHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')
GROUP BY email_provider_id;
SELECT id, status, telephony_provider_id, created_at
FROM activities
WHERE id IN (80028719, 80028846);
SELECT id, status, code, email_sent_at, created_at, updated_at
FROM text_relays
WHERE id IN (32415, 32416);
SELECT id, status, code, sender, recipient, created_at
FROM text_relays
WHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'
ORDER BY created_at DESC
LIMIT 10;
SELECT id, uuid, status, code, sender, recipient, created_at, updated_at
FROM text_relays
WHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');
# [PASSWORD_DOTS]
SELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count
FROM users u
INNER JOIN activities a ON u.id = .user_id
WHERE a.type LIKE 'sms%'
AND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY u.id, u.email, u.name, u.softphone_number
ORDER BY sms_count DESC;
select * from teams where id = 1;
select * from roles;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1117 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES
SELECT * FROM activities WHERE uuid_to_bin('[CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NO
SELECT * FROM crm_configurations WHERE id = 1053;
SELECT * FROM teams WHERE id = 1117;
select * from users where id = 30249;
select * from playbooks where id = 5473;
select * from playbook_categories where id = 43783;
select * from playbook_categories where playbook_id = 5473;
select * from crm_fields where id = 659242;
select * from crm_field_values where crm_field_id = 659242;
SELECT * FROM crm_field_data fd
# JOIN crm_fields f ON fd.crm_field_id = f.id
# JOIN activities a ON fd.activity_id = a.id
WHERE activity_id = 79933459
# AND f.crm_provider_id = 'hs_activity_type';
SELECT * FROM activity_messages;
select * from text_relays where created_at > '2026-05-01';
select * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;
select * from users where team_id = 1 and id IN (18608, 13934, 7160);
select * from activities where user_id = 7160 order by id desc limit 10;
select * from accounts where team_id = 1 and name ...
|
85506
|
NULL
|
NULL
|
NULL
|
|
85507
|
2930
|
9
|
2026-05-28T12:44:22.949731+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972262949_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
iTerm2• • 0ShellEditViewSessionScripts|ProfilesW iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"O ₴4-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec -itdocker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85ec2-user@ip-10-30-129-...100% <78• Thu 28 May 15:44:22181ec2-user@ip-10-30-140-...₴7...
|
NULL
|
6672601273599384867
|
NULL
|
click
|
ocr
|
NULL
|
iTerm2• • 0ShellEditViewSessionScripts|ProfilesW iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"O ₴4-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec -itdocker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85ec2-user@ip-10-30-129-...100% <78• Thu 28 May 15:44:22181ec2-user@ip-10-30-140-...₴7...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85506
|
2931
|
13
|
2026-05-28T12:44:22.543963+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972262543_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.019946808,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-6154356338949023626
|
-4668876984633013312
|
visual_change
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
rapstomViewCoocWindowFV faVsco.s ~#12121 on JY-20963-fx-lproidetwnapers.oh©ActivityControlier.phpv Salesforc>MFeldeOLekоkyseiwico.on• # OpportunityMatcher• = OpportunitySyncStrateProspectSearchStrated› ServiceTraitsClientTest.phoDecorateActivityTest.p© DeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phsQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.pho© QueryResultsTests.phcC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. phoceacheemsarcod.ocoCeimAdiMiseroettereeeimeontauratonsottnadeimomlocstoss vertes@i FmailHelnerTest.ohoFieldValueconverterTest.gLayoutManagerTest.phgMiarateProvderSandcal.Onnortun tvA chivirllatchOnnortun tSwncStrateovfProsnacteachatast mhoC ProspectSearchStrategyFi2 ProviderRecistryTest.php© RecordSelectorTest.pho* pasolveCompanyNamebyl© TimePerioditeratorTest.ph© UpdateCrmDataResolverwlathrnd>D Kioskwiewar>DActions>& Office> &a Resolvers→D traitsOAeindi.onePap aUlOoenwecaneSTNCVORSDWnamesoace tests. Untt Services hasuse soogle Serwice cnat as soogi esnaseuse soogle Serwice cnat Hessage as snarhessaderuse soogle Serwice charl Nessage?antuse soogle Seruice 6ng Kessageparcheader.usemlursinate Suppor Facades contio.use Jiminny Services\Mail\TextRelayService:uea proios Soaneronkytes hitae Thovaneh neeuse PHPUnit\Franework\Attributes DataProvideruse Tests TestCaseuse ReflectionClass;Use nockehyiawanerieclttoytPonuConvsco..olneelnAlace Tov+PolauSonuicoToet oytonde Tocthseopublic static function environmentProvider: arrayi...protected function setUp: voidf..protected functiion teardownd: voidf..."#[OataPcoyider("environmentProvider')oublic functsion testisFor@urrentEnyironnent@lithMatchingXGn0niginalToHeader(stoing SdeplovRecion, stoindwoata?rouider'envs.ronment?row.der"oulpublic function testIsForCurrentEnvironnentIgnoresToHeader: voidf...public function testIsForCurrentEnvironnentWithEmptyHeaders(): void(...}public function testIsForCurrentEnvironnentWithException(): voidf...}• - Validators181Vnuh bictunctsion tee+SyncllseszuASinesorzubeghon oiewosdat.c) BatchservicetestchoCEmailActivityServiceTest.p.. 0C inboxServiceTest.phpTextRelayServiceTest.php.IilMeet ne caneratorM NotificationSMOMaIApublic function testSyncUsesUsALiasForUsRegionO: void...;public function testGettfistorywithPagireAccept Fle X.х коссіню 0х9TO0У L7Thu 28 May 15:44:22+0.A SF fiminny@localhost)console (PROD) XA console [STAGING)D000€Ty: Autowi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.700701•BY u.id, u.enail, u.nane, u.softphone number:BY sms count DESCt * from teans where id = 1:t * from rolesCONCAT(u.id, CASE WHEN u.id = t.owner_id THEN " (ouner)' ELSE "* END) AS user_idS.ouner_id FROM social_accounts sausers u on u.id = sa.sociable..igteans t (1.n<->1: on t.id = v.tean,idu.team_id = 1117 and sa.provider = 'hubspot":T * FROM actáváties WHERE uvid_to_bin( 8024fffb-2df7-4017-91f4-d9f896850248') = uvid; # 79933459 YES* FROM activities WHERE uuid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = vuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;T* FROM teans WHERE id = 1117:t * from users where id = 30249;**tron nlavbooks where saln Shakt * from playbook_categories where id = 43783;t * from playbook categories where playbook id = 5473t * from crn_fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN crn fields f ON fd.crn field id = f.idN activities a ON fd.activity id = a.idactivity id = 799334591 f.crm provider id = 'hs activity type':153.734T * FROM activity nessages* fron toxt relave where created at > 12826-85-01*.** fron activitice where usen id IM (7168, 18688) and coeated at > 12826-85-221 onden by sid desca** fron usens nhere tean id = 1 and Sid TN (18688, 13934, 7169):** fron activities where usen jid = 7168 onder by id desc Linit 16** fron accounts where tean jid = 1and nane = "ColunnS".nane Like "ySubrakt: # 31054, 1117nhere $d= 1117,**Erom actaivity searches where lusen sdn 318565*trom actaivity search Saltens where actaivity seanch.sidtM 188882.RRORD# console fiaum045 A1 A41 У 66 4Testalun Meseratc souee inodeceratorito0oT BetheeetinoProyiderTest:: testHasReout redScopeMa) TextRelayService est.one.docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestmunceooteinesTos Asthi myReportActivityServiceTestestestGetATestAty totacofor bethratedReportsServiceVaLidat1onTest::testVatesuesrorcurtchtchveronchczonores loneuoct e xeotcoro to nesoerislenorco in cument code.mentwtheorwlenders = whtn no messoe marches curtendimo ementation2. Addnd 7 new tests tor coveraad.tactGatkietanthP.otnat.on =moinhtioalind•testsethistoryPoint = cache put operadortestRetreshHistoryPo int — Gmail watch Apt eal.testGetService - Google client configurationRemovad. problematic testSyncProcesscsMessaoes.AndD/apatches.Jobs.and.testConst.ructorThroushhncradentfal Miscina = thaes tactad intacration coiote bahet eritad for inthoration tacteThe tests now cover all the key methoos in Textkelayservice wnile avolaina complex mocking or databaseAsk anything (XOL)o PodeswiettAccept allt4 spad...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85505
|
2931
|
12
|
2026-05-28T12:43:54.479350+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972234479_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6423983795013307969
|
-3852565242246887264
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
rapstomProinet vWindowFV faVsco.|s ~o-t2t2t ml-snota.©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)d console (PROD) x C Service.phpcoatraimv Salestorg>MFelde• # OpportunityMatcherOpportunitySyncStrateProspectSearchStrated• 5 ServiceTraitsClientTest.phpDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.pho©QueryResultsTests.phoC ServiceTest.pho© SyncBatchRedisServick© BaseService Test. phoLCAKONySCIECO.OnOAeindi.oneA console [STAGING700Cass exkela seru chles exehos estast#DataProvider("environmentProvider)782public function testisForCurrentenvironnent#fithMatchingX6n0riginalToHeader(string SdeployRegion, string 70)134 P169 P1819ceacheemsarcod.ocoCeimAdiMiseroettereeeimeontauratonsottnad@i FmailHelnerTest.oho© FieldValueconvertertest4,4LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirMatchOnnortun tSwncStrateovf(al Prosnect GacheTest oho© ProspectSearchStrategyFi .2 ProviderRecistryTest.php© RecordSelectorTest.pho2 pasolucComosnyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrnd>D Kioskwiewar>DActions262› D Office› Ea Resolvers> Da Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTestfnhosConieaTast. cho@ TeytRelavSerdiceTest.obd>M MeetinaGeneraton>M Notification#[DataProvider("environmentProvider')]public function testIsForCurrentEnvironnentWithNonMatchingX6n0riginalToHeader(string SdeployRegionpublic function testIsForCurrentEnvironnentIgnoresToHeader: voidi...HННHHÀpublic function testIsForCurrentEnvironnentWithEnptyHeaders(): voidf...public function testIsForCurrentEnvironnentWithException: void{..}oublic functsion testSvncllsesEuAliasForEuRecionG= voidf..public function testSyncUsesUsALiasForUsRegion: void{...}Rerect717public function test6etHistorywithPaginationO: voigConfig::set("jiminny.google_text_user'. "[EMAIL]'):contta:.set/tiiminny.anggle text relay toohc""testetonfc"Sseruiice = Sthiiso>createlextPelaySeruicelorSgnailService = Sthis->createMock( orGoogle6nail::class)ShistoryResponse1 = Sthis-›createMockorignalClassNanGoogle \Service Gmail ListHistoryResponse::ClmrChretonuPocnanconthietanuld122/C1"getHistory'->willReturn(0p:ChretanuPocnancon-mothadlcoactr.'getNextPageToken' ->willReturn( value: "next-page-token')Shietanupoenangon = Cohie,SAnoatoMAAlt MinimsiGnselamos ICAnnlol Conulnol Genill Зetll etАлиРоСnAneo гShistoryResponse2->historyId = 12346ShistoryResponse2->method( constraint: 'getHistory')->willReturn([)ShistoryResponse2->method( constraint'getNextPageToken')->willReturn( value: null)SusersHistory = Sthis->createMock( originalClassName: \Google|Service|Gmail\Resource UsersHistory::clSusensHistony->nethod( constraint: "TictlsensHistory»)wwwkeurnintonsrcte.wemsehttonresodnse1, ShistoryResponse2);\Gaches-shouldRecoive("act") -rithf\Gaches-shouldRecssive ("nut ") -nithf aross "testatonic')wache. chou drecevelaurow tharos testetonieMockery::on(fn (Sexpires) => Sexpir74nockery::on(tn (sexpires) " Sexpici74Sresult = Sservice-agetHistory(§gn Acceot Fle x~ X Reject Fle oxcTXS AUTO NIi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.045 A1 A41 У 66 4by U.zo, U.elazl, U.nane, U.sorconone nundel:BY sms count DESCt * from teans where id = 1:* tron rolesONCAT(U.10, CASE WHEN U.4d = t.owner_id THEN " (ouner)' ELSE ** END) AS user.3domner thuh soot sccounusensu on uisid e shsocabledtcanst1.ndonsde u.teanand ea-orovider & "hubsoor"T * FROM activities WHERE uuid_to_bin(^8024fffb-2df7-4817-91f4-d9f896850248') = uuid; # 79933459 YES* FROM activities WHERE uuid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = vuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;*SPOM teans THERE 50810025t * from users where id = 30249**tron nlavbooks where saln Shakt * from playbook categories where id = 43783;t * from playbook categories where playbook id = 5473t * from crn fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN cre fields f ON fd.crm fleld id = f.idN activities a ON fd.activity id = a.idacavily10 = 799554541 f.crn provider id = 'hs activity type':T * FROM activity nessages** fron toxt relave where created at > 12826-85-01*.** fron activitice where usen id IM (7168, 18688) and coeated at > 12826-85-221 onden by sid desca** fron usens nhere tean id = 1 and Sid TN (18688, 13934. 7169),ttnonactivities where usen jid = 7160 onder by id desc Linit 16rom accounts where cennurds and inanes "solunnse** fron usens nhere nane Like IySubrakt: # 31054, 1117*Xrom teans nhere 5din10175***Erom actaiviity searches where lusen sdn318523trom actavity search Sialtens where actaivity search_sdTM 188882 88002Thu 28 May 15:43:54+0.V oockch exce dockerlobontone arohtcenlch tekclo beiceihnincedaanesсарлeлоeти сетеяс сеstоeсоmenукесхpiengTestau teteratee ouee inoeretotorntoco ceteet1ngProv/derTest:/ testHssRequ1 redScopelSearched tunction abort unless in -niminnyaoTextRelayServicetest.om+1-docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestctruncated 184 LinessTestau Meservicesoued inodec-fotmentooot metheeetinoProvtdertesti:testHasRegut redScopewTextRelayServica est.ohd0 docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestetocata in doe-onentts typrecotte sed itiTest ongecalculatsupported sin PHPUnit 12. Uodate vour test code to use attributes insteadMetadata foundin doc-commentfor clas,Testsits t oeprecatid ardityit no lonteroe iorport I ireatoTe5 u Mate you tesoc-Accept alllock amthing (XoL)o PodeswiettKtwodeurlaime"eiireht4 spa...
|
85503
|
NULL
|
NULL
|
NULL
|
|
85504
|
2930
|
8
|
2026-05-28T12:43:50.751758+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972230751_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
1359069580965570500
|
1744564719952544192
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"O &4-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec-it docker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85100% <78• Thu 28 May 15:43:50L881ec2-user@ip-10-30-129-...ec2-user@ip-10-30-140-...₴7...
|
85502
|
NULL
|
NULL
|
NULL
|
|
85503
|
2931
|
11
|
2026-05-28T12:43:22.000950+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972202000_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5599254006743683834
|
-7050965352302034496
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
rapstomProinet vWindowFV faVsco.|s ~o-t2t2t ml-snota.©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)d console (PROD) x C Service.phpconsoaianiv Salestorg>MFelde• # OpportunityMatcherOpportunitySyncStrateProspectSearchStrateg• 5 ServiceTraitsClientTest.phpDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.pho©QueryResultsTests.phoC ServiceTest.pho© SyncBatchRedisServick© BaseService Test. phoLCAKONySCIECO.OnOAeindi.oneA console [STAGING700Cass exkela seru chles exehos estast#DataProvider("environmentProvider)782public function testisForCurrentenvironnent#fithMatchingX6n0riginalToHeader(string SdeployRegion, string 70)134 P169 P1819ceacheemsarcod.ocoCeimAdiMiseroettereeeimeontauratonsottnad@ FmailHelnerTest.ohd© FieldValueconvertertest4,4LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirMatchOnnortun tSwncStrateovf(al Prosnect GacheTest oho© ProspectSearchStrategyFi .2 ProviderRecistryTest.php© RecordSelectorTest.pho2 pasolucComosnyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrnd>D Kioskwiewar>DActions262› D Office› Ea Resolvers> Da Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTestfnhosConieaTast. cho@ TeytRelavSerdceTest.ohol>M MeetinaGeneraton>M Notification#[DataProvider("environmentProvider')]public function testIsForCurrentEnvironnentWithNonMatchingX6n0riginalToHeader(string SdeployRegionpublic function testIsForCurrentEnvironnentIgnoresToHeader: voidi...HННHHÀpublic function testIsForCurrentEnvironnentWithEnptyHeaders(): voidf...public function testIsForCurrentEnvironnentWithException: void{..}oublic functsion testSvncllsesEuAliasForEuRecionG= voidf..public function testSyncUsesUsALiasForUsRegion: void{...}Rerect717public function test6etHistorywithPaginationO: voigConfig::set("jiminny.google_text_user'. "[EMAIL]'):contta:.set/tiiminny.anggle text relay toohc""testetonfc"Sseruiice = Sthiiso>createlextPelaySeruicelorSgnailService = Sthis->createMock( orGoogle6nail::class)ShistoryResponse1 = Sthis-›createMockorignalClassNanGoogle \Service Gmail ListHistoryResponse::ClmrChretonuPocnanconthietanuld122/C1"getHistory'->willReturn(0p:ChretanuPocnancon-mothadlcoactr.'getNextPageToken' ->willReturn( value: "next-page-token')Shietanupoenangon = Cohie,SAnoatoMAAlt MinimsiGnselamos ICAnnlol Conulnol Genill Зetll etАлиРоСnAneo гShistoryResponse2->historyId = 12346ShistoryResponse2->method( constraint: 'getHistory')->willReturn([)ShistoryResponse2->method( constraint'getNextPageToken')->willReturn( value: null)SusersHistory = Sthis->createMock( originalClassName: \Google|Service|Gmail\Resource UsersHistory::clSusensHistony->nethod( constraint: "TictlsensHistory»)wwwkeurnintonsrcte.wemsehttony.esoonse1, ShistoryResponse2);\Gaches-shouldRecoive("act") -rithf\Gaches-shouldRecssive ("nut ") -nithf aross "testatonic')wache. chou drecevelaurow tharos testetonieMockery::on(fn (Sexpires) => Sexpir74nockery::on(tn (sexpires) " Sexpici74Sresult = Sservice-agetHistory(§gn Acceot Fle x~ X Reject Fle oxcTXS AUTO NIi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.045 A1 A41 У 66 4by U.zo, U.elazl, U.nane, U.sorconone nundel:BY sms count DESCt * from teans where id = 1:* tron rolesONCAT(U.10, CASE WHEN U.4d = t.owner_id THEN " (ouner)' ELSE ** END) AS user.3domner thuh soot sccounusensu on uisid e shsocabledtcanst1.ndonsde u.teanand ea-orovider & "hubsoor"T * FROM activities WHERE uuid_to_bin(^8024fffb-2df7-4817-91f4-d9f896850248') = uuid; # 79933459 YES* FROM activities WHERE uuid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = vuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;*SPOM teans THERE 50810025t * from users where id = 30249**tron nlavbooks where saln Shakt * from playbook categories where id = 43783;t * from playbook categories where playbook id = 5473t * from crn fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN cre fields f ON fd.crm fleld id = f.idN activities a ON fd.activity id = a.idacavily10 = 799554541 f.crn provider id = 'hs activity type':T * FROM activity nessages** fron toxt relave where created at > 12826-85-01*.** fron activitice where usen id IM (7168, 18688) and coeated at > 12826-85-221 onden by sid desca** fron usens nhere tean id = 1 and Sid TN (18688, 13934. 7169),ttnonactivities where usen jid = 7160 onder by id desc Linit 16rom accounts where cennurds and inanes "solunnse** fron usens nhere nane Like IySubrakt: # 31054, 1117*Xrom teans nhere 5din10175***Erom actaiviity searches where lusen sdn318523trom actavity search Sialtens where actaivity search_sdTM 188882 88002Inu cowoy 1o.4si+0.V oockch exce dockerlobontone arohtcenlch tekclo beiceihnincedaanesсарлeлоeти сетеяс сеstоeсоmenукесхpiengTestau teteratee ouee inoeretotorntoco ceteet1ngProv/derTest:/ testHssRequ1 redScopelSearched tunction abort unless in -niminnyaoTextRelayServicetest.om+1-docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestctruncated 184 LinessTestau Meservicesoued inodec-fotmentooot metheeetinoProvtdertesti:testHasRegut redScopewTextRelayServica est.ohd0 docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestetocata in doe-onentts typrecotte sed itiTest ongecalculatsupported sin PHPUnit 12. Uodate vour test code to use attributes insteadMetadata foundin doc-commentfor clas,Testsits t oeprecatid ardityit no lonteroe iorport I ireatoTe5 u Mate you tesoc-Accept alllock amthing (XoL)o PodeswiettKtwodeurlaime"eiireht4 spa...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85502
|
2930
|
7
|
2026-05-28T12:43:18.754795+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972198754_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
iTerm2• • 0ShellEditViewSessionScripts|ProfilesW iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"O ₴4-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec -itdocker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85ec2-user@ip-10-30-129-...100% <78• Thu 28 May 15:43:181₴1ec2-user@ip-10-30-140-...₴7...
|
NULL
|
2930774160291958409
|
NULL
|
idle
|
ocr
|
NULL
|
iTerm2• • 0ShellEditViewSessionScripts|ProfilesW iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"O ₴4-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec -itdocker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85ec2-user@ip-10-30-129-...100% <78• Thu 28 May 15:43:181₴1ec2-user@ip-10-30-140-...₴7...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85501
|
2931
|
10
|
2026-05-28T12:42:46.842326+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972166842_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
rapstomProinet vWindowFV faVsco.|s ~o-t2t2t ml-sno rapstomProinet vWindowFV faVsco.|s ~o-t2t2t ml-snota.©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) Xv Salestorg>MFelde• # OpportunityMatcherOpportunitySyncStrateProspectSearchStrated# ServiceTraitsClientTest.phoDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.pho©QueryResultsTests.phoC ServiceTest.pho© SyncBatchRedisServick© BaseService Test. phoLCAKONySCIECO.OnOAeindi.oneA console [STAGING700Cass exkela seru chles exehos estast#DataProvider("environmentProvider)782public function testisForCurrentenvironnent#fithMatchingX6n0riginalToHeader(string SdeployRegion, string 70)134 P169 P1819ceacheemsarcod.ocoCeimAdiMiseroettereeeimeontauratonsottnad@ FmailHelnerTest.ohd© FieldValueconvertertest4,4LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirMatchOnnortun tSwncStrateovf(al Prosnect GacheTest oho© ProspectSearchStrategyFi .2 ProviderRecistryTest.php© RecordSelectorTest.pho2 pasolucComosnyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrnd>D Kioskwiewar>DActions262› D Office› Ea Resolvers> Da Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTestfnhosConieaTast. cho@ TeytRelavSerdceTest.ohol>M MeetinaGeneraton>M Notification#[DataProvider("environmentProvider')]public function testIsForCurrentEnvironnentWithNonMatchingX6n0riginalToHeader(string SdeployRegionpublic function testIsForCurrentEnvironnentIgnoresToHeader: voidi...HННHHÀpublic function testIsForCurrentEnvironnentWithEnptyHeaders(): voidf...public function testIsForCurrentEnvironnentWithException: void{..}oublic functsion testSvncllsesEuAliasForEuRecionG= voidf..public function testSyncUsesUsALiasForUsRegion: void{...}Rerect717public function test6etHistorywithPaginationO: voigConfig::set("jiminny.google_text_user'. "[EMAIL]'):contta:.set/tiiminny.anggle text relay toohc""testetonfc"Sseruiice = Sthiiso>createlextPelaySeruicelorSgnailService = Sthis->createMock( orGoogle6nail::class)ShistoryResponse1 = Sthis-›createMockorignalClassNanGoogle \Service Gmail ListHistoryResponse::ClmrhretanuPocnoncorthsctanuid12216x"getHistory'->willReturn(0p:ChretanuPocnancon-mothadlcoactr.'getNextPageToken' ->willReturn( value: "next-page-token')Shietanupoenangon = Cohie,SAnoatoMAAlt MinimsiGnselamos ICAnnlol Conulnol Genill Зetll etАлиРоСnAneo гShistoryResponse2->historyId = 12346ShistoryResponse2->method( constraint: 'getHistory')->willReturn([))ShistoryResponse2->method( constraint'getNextPageToken')->willReturn( value: null)SusersHistory = Sthis->createMock( originalClassName: \Google|Service|Gmail\Resource UsersHistory::clSusensHistony->nethod( constraint: "TictlsensHistory")wwwkeurnintonsrcte.wemsehttony.esoonse1, ShistoryResponse2);\Gaches-shouldRecoive("act") -rithf\Gaches-shouldRecssive ("nut ") -nithf aross "testatonic')wache. chou drecevelaurow tharos testetonieMockery::on(fn (Sexpires) => Sexpir74nockery::on(tn (sexpires) " Sexpici74Sresult = Sservice-agetHistory(§gn Acceot Fle x~ X Reject Fle oxcTXS AUTO NIi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.by U.zo, U.elazl, U.nane, U.sorconone nundel:BY sms count DESCt * from teans where id = 1:* tron rolesONCAT(U.10, CASE WHEN U.4d = t.owner_id THEN " (ouner)' ELSE ** END) AS user.3domner thuh soot sccounusensu on uisid e shsocabledtcanst1.ndonsde u.toanand ea-orovider & "hubsoor"T * FROM activities WHERE uuid_to_bin(^8024fffb-2df7-4817-91f4-d9f896850248') = uuid; # 79933459 YES* FROM activities WHERE uuid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = vuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;*SPOM teans THERE 50810025t * from users where id = 30249**tron nlavbooks where saln Shakt * from playbook categories where id = 43783;t * from playbook categories where playbook id = 5473t * from crn fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN cre fields f ON fd.crm fleld id = f.idN activities a ON fd.activity id = a.idacavily10 = 799554541 f.crn provider id = 'hs activity type':T * FROM activity nessages** fron toxt relave where created at > 12826-85-01*.** fron usens nhere tean id = 1 and Sid TN (18688, 13934. 7169),ttnonactivities where usen jid = 7160 onder by id desc Linit 16rom accounts where cennurds and inanes "solunnse** fron usens nhere nane Like IySubrakt: # 31054, 1117*Xrom teans nhere 5din10175***Erom actaiviity searches where lusen sdn318523trom actavity search Sialtens where actaivity search_sdTM 188882 88002# console fiaum045 A1 A41 У 66 4TO0У L7Thu 28 May 15:42:46+0.TextRelayServica est.oheTextRelayServicetest.php-71TnougntsVoockch excedockonloboonerehoertccakoeeteienincedanesG asdainny no pingesbe supported in PHPUnit 12. Uodate vour tost code to uce attributes insteadTestAu Meseratee foued inodoc-ratsentodor wethoeetinoProviderTest::testHasReoutredScopeMSearched tunction abort unless in -himinnyapaexKeyeMicalesiHondocker exec dacker tano oho artacan test ettiter TextRe huSericetestctruncated 184 lines)Testau teservicesoued in dec-otmentooot methedetinoProviderTesti:testHasRegut redScopewTextRelsyServica est.ohO docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestAsk anything Xolo PodeswiettKtwodeutasmeOun steChinAccept allt4 spa...
|
NULL
|
-3106983071264799211
|
NULL
|
visual_change
|
ocr
|
NULL
|
rapstomProinet vWindowFV faVsco.|s ~o-t2t2t ml-sno rapstomProinet vWindowFV faVsco.|s ~o-t2t2t ml-snota.©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) Xv Salestorg>MFelde• # OpportunityMatcherOpportunitySyncStrateProspectSearchStrated# ServiceTraitsClientTest.phoDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.pho©QueryResultsTests.phoC ServiceTest.pho© SyncBatchRedisServick© BaseService Test. phoLCAKONySCIECO.OnOAeindi.oneA console [STAGING700Cass exkela seru chles exehos estast#DataProvider("environmentProvider)782public function testisForCurrentenvironnent#fithMatchingX6n0riginalToHeader(string SdeployRegion, string 70)134 P169 P1819ceacheemsarcod.ocoCeimAdiMiseroettereeeimeontauratonsottnad@ FmailHelnerTest.ohd© FieldValueconvertertest4,4LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirMatchOnnortun tSwncStrateovf(al Prosnect GacheTest oho© ProspectSearchStrategyFi .2 ProviderRecistryTest.php© RecordSelectorTest.pho2 pasolucComosnyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrnd>D Kioskwiewar>DActions262› D Office› Ea Resolvers> Da Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTestfnhosConieaTast. cho@ TeytRelavSerdceTest.ohol>M MeetinaGeneraton>M Notification#[DataProvider("environmentProvider')]public function testIsForCurrentEnvironnentWithNonMatchingX6n0riginalToHeader(string SdeployRegionpublic function testIsForCurrentEnvironnentIgnoresToHeader: voidi...HННHHÀpublic function testIsForCurrentEnvironnentWithEnptyHeaders(): voidf...public function testIsForCurrentEnvironnentWithException: void{..}oublic functsion testSvncllsesEuAliasForEuRecionG= voidf..public function testSyncUsesUsALiasForUsRegion: void{...}Rerect717public function test6etHistorywithPaginationO: voigConfig::set("jiminny.google_text_user'. "[EMAIL]'):contta:.set/tiiminny.anggle text relay toohc""testetonfc"Sseruiice = Sthiiso>createlextPelaySeruicelorSgnailService = Sthis->createMock( orGoogle6nail::class)ShistoryResponse1 = Sthis-›createMockorignalClassNanGoogle \Service Gmail ListHistoryResponse::ClmrhretanuPocnoncorthsctanuid12216x"getHistory'->willReturn(0p:ChretanuPocnancon-mothadlcoactr.'getNextPageToken' ->willReturn( value: "next-page-token')Shietanupoenangon = Cohie,SAnoatoMAAlt MinimsiGnselamos ICAnnlol Conulnol Genill Зetll etАлиРоСnAneo гShistoryResponse2->historyId = 12346ShistoryResponse2->method( constraint: 'getHistory')->willReturn([))ShistoryResponse2->method( constraint'getNextPageToken')->willReturn( value: null)SusersHistory = Sthis->createMock( originalClassName: \Google|Service|Gmail\Resource UsersHistory::clSusensHistony->nethod( constraint: "TictlsensHistory")wwwkeurnintonsrcte.wemsehttony.esoonse1, ShistoryResponse2);\Gaches-shouldRecoive("act") -rithf\Gaches-shouldRecssive ("nut ") -nithf aross "testatonic')wache. chou drecevelaurow tharos testetonieMockery::on(fn (Sexpires) => Sexpir74nockery::on(tn (sexpires) " Sexpici74Sresult = Sservice-agetHistory(§gn Acceot Fle x~ X Reject Fle oxcTXS AUTO NIi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.by U.zo, U.elazl, U.nane, U.sorconone nundel:BY sms count DESCt * from teans where id = 1:* tron rolesONCAT(U.10, CASE WHEN U.4d = t.owner_id THEN " (ouner)' ELSE ** END) AS user.3domner thuh soot sccounusensu on uisid e shsocabledtcanst1.ndonsde u.toanand ea-orovider & "hubsoor"T * FROM activities WHERE uuid_to_bin(^8024fffb-2df7-4817-91f4-d9f896850248') = uuid; # 79933459 YES* FROM activities WHERE uuid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = vuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;*SPOM teans THERE 50810025t * from users where id = 30249**tron nlavbooks where saln Shakt * from playbook categories where id = 43783;t * from playbook categories where playbook id = 5473t * from crn fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN cre fields f ON fd.crm fleld id = f.idN activities a ON fd.activity id = a.idacavily10 = 799554541 f.crn provider id = 'hs activity type':T * FROM activity nessages** fron toxt relave where created at > 12826-85-01*.** fron usens nhere tean id = 1 and Sid TN (18688, 13934. 7169),ttnonactivities where usen jid = 7160 onder by id desc Linit 16rom accounts where cennurds and inanes "solunnse** fron usens nhere nane Like IySubrakt: # 31054, 1117*Xrom teans nhere 5din10175***Erom actaiviity searches where lusen sdn318523trom actavity search Sialtens where actaivity search_sdTM 188882 88002# console fiaum045 A1 A41 У 66 4TO0У L7Thu 28 May 15:42:46+0.TextRelayServica est.oheTextRelayServicetest.php-71TnougntsVoockch excedockonloboonerehoertccakoeeteienincedanesG asdainny no pingesbe supported in PHPUnit 12. Uodate vour tost code to uce attributes insteadTestAu Meseratee foued inodoc-ratsentodor wethoeetinoProviderTest::testHasReoutredScopeMSearched tunction abort unless in -himinnyapaexKeyeMicalesiHondocker exec dacker tano oho artacan test ettiter TextRe huSericetestctruncated 184 lines)Testau teservicesoued in dec-otmentooot methedetinoProviderTesti:testHasRegut redScopewTextRelsyServica est.ohO docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestAsk anything Xolo PodeswiettKtwodeutasmeOun steChinAccept allt4 spa...
|
85499
|
NULL
|
NULL
|
NULL
|
|
85500
|
2930
|
6
|
2026-05-28T12:42:45.335406+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972165335_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
iTerm2• • 0ShellEditViewSessionScripts|ProfilesW iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3ffmpegapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php84348-zsh+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec-it docker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85ec2-user@ip-10-30-129-...100% <78• Thu 28 May 15:42:451₴1ec2-user@ip-10-30-140-...₴7...
|
NULL
|
1876696574756909717
|
NULL
|
click
|
ocr
|
NULL
|
iTerm2• • 0ShellEditViewSessionScripts|ProfilesW iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3ffmpegapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php84348-zsh+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec-it docker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85ec2-user@ip-10-30-129-...100% <78• Thu 28 May 15:42:451₴1ec2-user@ip-10-30-140-...₴7...
|
85498
|
NULL
|
NULL
|
NULL
|
|
85499
|
2931
|
9
|
2026-05-28T12:42:42.340478+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972162340_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
rapstomProinet vWindowFV faVsco.|s ~o-t2t2t ml-sno rapstomProinet vWindowFV faVsco.|s ~o-t2t2t ml-snota.©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) Xv Salestorg>ImFelde• # OpportunityMatcherOpportunitySyncStrateProspectSearchStrated• 5 ServiceTraitsClientTest.phpDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.pho©QueryResultsTests.phoC ServiceTest.pho© SyncBatchRedisServick© BaseService Test. phoLCAKONySCIECO.OnOAeindi.oneA console [STAGING700Cass exkela seru chles exehos estast#DataProvider("environmentProvider)782public function testisForCurrentenvironnent#lithMatchingX6n0riginalToHeader(string SdeployRegion, string 78%134 P169 P1819ceacheemsarcod.ocoCeimAdiMiseroettereeeimeontauratonsottnad@ FmailHelnerTest.ohd© FieldValueconvertertest4,4LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirMatchOnnortun tSwncStrateovf(al Prosnect GacheTest oho© ProspectSearchStrategyFi .2 ProviderRecistryTest.php© RecordSelectorTest.pho2 pasolucComosnyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrnd>D Kioskwiewar>DActions262› D Office› Ea Resolvers> Da Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTestfnhosConieaTast. cho@ TeytRelavSerdiceTest.obd>M MeetinaGeneraton>M Notification#[DataProvider("environmentProvider')]public function testIsForCurrentEnvironnentWithNonMatchingX6n0riginalToHeader(string SdeployRegionpublic function testIsForCurrentEnvironnentIgnoresToHeader: voidi...HННHHÀpublic function testIsForCurrentEnvironnentWithEnptyHeaders(): voidf...public function testIsForCurrentEnvironnentWithException: void{..}oublic functsion testSvncllsesEuAliasForEuRecionG= voidf..public function testSyncUsesUsALiasForUsRegion: void{...}Rerect717public function test6etHistorywithPaginationO: voigConfig::set("jiminny.google_text_user'. "[EMAIL]'):contto:.set/tiiminny.aogdle text celay toofc""testetonfc"Sseruiice = Sthiiso>createlextPelaySeruicelorGoogle6nail::class)ShistoryResponse1 = Sthis-›createMockorignalClassNanChretonuPocnanconthietanuld122/C1Google \Service Gmail ListHistoryResponse::Clmr"getHistory'->willReturn(0p:ChretanuPocnancon-mothadlcoactr.'getNextPageToken' ->willReturn( value: "next-page-token')Shietanupoenangon = Cohie,SAnoatoMAAlt MinimsiGnselamos ICAnnlol Conulnol Genill Зetll etАлиРоСnAneo гShistoryResponse2->historyId = 12346ShistoryResponse2->method( constraint: 'getHistory')->willReturn([)ShistoryResponse2->method( constraint'getNextPageToken')->willReturn( value: null)SusersHistory = Sthis->createMock( originalClassName: \Google|Service|Gmail\Resource UsersHistory::clSusensHistony->nethod( constraint: "TictlsensHistory»)wwwkeurnintonsrcte.wemsehttony.esoonse1, ShistoryResponse2);\Gaches-shouldRecoive("act") -rithr\Gaches-shouldRecssive ("nut ") -nithf aross "testatonic')wache. chou drece veltourowthiuudroh restetonseMockery::on(fn (Sexpires) => Sexpir74nockery::on(tn (sexpires) " Sexpici74Sresult = Sservice-agetHistory(§gn Acceot Fle x~ X Reject Fle oxcTXS AUTO NIi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.by U.zo, U.elazl, U.nane, U.sorconone nundel:BY sms count DESCt * from teans where id = 1:* tron rolesONCAT(U.10, CASE WHEN U.4d = t.owner_id THEN " (ouner)' ELSE ** END) AS user.3domner thuh soot sccounusensu on uisid e shsocabledtcanst1.ndonsde u.teanand ea-orovider & "hubsoor"T * FROM activities WHERE uvid_to_bin(^8024fffb-2df7-4017-91f4-d9f896850248*) = vuid; # 79933459 YES* FROM activities WHERE uuid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = vuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;*SPOM teans THERE 50810025t * from users where id = 30249**tron nlavbooks where saln Shakt * from playbook categories where id = 43783;t * from playbook categories where playbook id = 5473t * from crn fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN cre fields f ON fd.crm fleld id = f.idN activities a ON fd.activity id = a.idacavily10 = 799554541 f.crn provider id = 'hs activity type':T * FROM activity nessages** fron toxt relave where created at > 12826-85-01*.** fron activitice where usen id IM (7168, 18688) and coeated at > 12826-85-221 onden by sid desca** fron usens nhere tean id = 1 and Sid TN (18688, 13934. 7169),ttnonactivities where usen jid = 7160 onder by id desc Linit 16rom accounts where cennurds and inanes "solunnse** fron usens nhere nane Like IySubrakt: # 31054, 1117*Xrom teans nhere 5din10175**Erom actaivity searches where lusen 5dn 318563trom actavity search Sialtens where actaivity search_sdTM 188882 88002TO0У L7Inu cowoy 1o.42.+0.# console fiaum045 A1 A41 У 66 4• docker exec dockerlanp1 ohp arcisan test -filter Textkelayservicerescctnuncated 184binessTAAtGOMSCATAStRstACtGOt KeinnuporintontFe supaorted in PHPUntya 12eSUpdaMe yduta test ccee to use ittreprees enstedwilii no longetToctetin thecaoata• Cocker Axer docker laso hohn art thn Tect →itAr ATRA AMKAMICATACTctruncated 184 LinessnaMetadaoa sn docptentsetsbe supported in PHPUnit 12. Update your test code to use attributes instead.Testagu Metedate foued inodorerotoentfor nethoeetinoProviderTest.1 testHasReoul redScopeilO docker avor docker laen nho Artican tect Cfilter TeytRAlaCarvicataeAsk anything (%oL)o PodeswiettPun std SkinAccept allKtwodeurlaime"eiireht4 spad...
|
NULL
|
-8846264479126570672
|
NULL
|
visual_change
|
ocr
|
NULL
|
rapstomProinet vWindowFV faVsco.|s ~o-t2t2t ml-sno rapstomProinet vWindowFV faVsco.|s ~o-t2t2t ml-snota.©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) Xv Salestorg>ImFelde• # OpportunityMatcherOpportunitySyncStrateProspectSearchStrated• 5 ServiceTraitsClientTest.phpDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.pho©QueryResultsTests.phoC ServiceTest.pho© SyncBatchRedisServick© BaseService Test. phoLCAKONySCIECO.OnOAeindi.oneA console [STAGING700Cass exkela seru chles exehos estast#DataProvider("environmentProvider)782public function testisForCurrentenvironnent#lithMatchingX6n0riginalToHeader(string SdeployRegion, string 78%134 P169 P1819ceacheemsarcod.ocoCeimAdiMiseroettereeeimeontauratonsottnad@ FmailHelnerTest.ohd© FieldValueconvertertest4,4LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirMatchOnnortun tSwncStrateovf(al Prosnect GacheTest oho© ProspectSearchStrategyFi .2 ProviderRecistryTest.php© RecordSelectorTest.pho2 pasolucComosnyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrnd>D Kioskwiewar>DActions262› D Office› Ea Resolvers> Da Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTestfnhosConieaTast. cho@ TeytRelavSerdiceTest.obd>M MeetinaGeneraton>M Notification#[DataProvider("environmentProvider')]public function testIsForCurrentEnvironnentWithNonMatchingX6n0riginalToHeader(string SdeployRegionpublic function testIsForCurrentEnvironnentIgnoresToHeader: voidi...HННHHÀpublic function testIsForCurrentEnvironnentWithEnptyHeaders(): voidf...public function testIsForCurrentEnvironnentWithException: void{..}oublic functsion testSvncllsesEuAliasForEuRecionG= voidf..public function testSyncUsesUsALiasForUsRegion: void{...}Rerect717public function test6etHistorywithPaginationO: voigConfig::set("jiminny.google_text_user'. "[EMAIL]'):contto:.set/tiiminny.aogdle text celay toofc""testetonfc"Sseruiice = Sthiiso>createlextPelaySeruicelorGoogle6nail::class)ShistoryResponse1 = Sthis-›createMockorignalClassNanChretonuPocnanconthietanuld122/C1Google \Service Gmail ListHistoryResponse::Clmr"getHistory'->willReturn(0p:ChretanuPocnancon-mothadlcoactr.'getNextPageToken' ->willReturn( value: "next-page-token')Shietanupoenangon = Cohie,SAnoatoMAAlt MinimsiGnselamos ICAnnlol Conulnol Genill Зetll etАлиРоСnAneo гShistoryResponse2->historyId = 12346ShistoryResponse2->method( constraint: 'getHistory')->willReturn([)ShistoryResponse2->method( constraint'getNextPageToken')->willReturn( value: null)SusersHistory = Sthis->createMock( originalClassName: \Google|Service|Gmail\Resource UsersHistory::clSusensHistony->nethod( constraint: "TictlsensHistory»)wwwkeurnintonsrcte.wemsehttony.esoonse1, ShistoryResponse2);\Gaches-shouldRecoive("act") -rithr\Gaches-shouldRecssive ("nut ") -nithf aross "testatonic')wache. chou drece veltourowthiuudroh restetonseMockery::on(fn (Sexpires) => Sexpir74nockery::on(tn (sexpires) " Sexpici74Sresult = Sservice-agetHistory(§gn Acceot Fle x~ X Reject Fle oxcTXS AUTO NIi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.by U.zo, U.elazl, U.nane, U.sorconone nundel:BY sms count DESCt * from teans where id = 1:* tron rolesONCAT(U.10, CASE WHEN U.4d = t.owner_id THEN " (ouner)' ELSE ** END) AS user.3domner thuh soot sccounusensu on uisid e shsocabledtcanst1.ndonsde u.teanand ea-orovider & "hubsoor"T * FROM activities WHERE uvid_to_bin(^8024fffb-2df7-4017-91f4-d9f896850248*) = vuid; # 79933459 YES* FROM activities WHERE uuid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = vuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;*SPOM teans THERE 50810025t * from users where id = 30249**tron nlavbooks where saln Shakt * from playbook categories where id = 43783;t * from playbook categories where playbook id = 5473t * from crn fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN cre fields f ON fd.crm fleld id = f.idN activities a ON fd.activity id = a.idacavily10 = 799554541 f.crn provider id = 'hs activity type':T * FROM activity nessages** fron toxt relave where created at > 12826-85-01*.** fron activitice where usen id IM (7168, 18688) and coeated at > 12826-85-221 onden by sid desca** fron usens nhere tean id = 1 and Sid TN (18688, 13934. 7169),ttnonactivities where usen jid = 7160 onder by id desc Linit 16rom accounts where cennurds and inanes "solunnse** fron usens nhere nane Like IySubrakt: # 31054, 1117*Xrom teans nhere 5din10175**Erom actaivity searches where lusen 5dn 318563trom actavity search Sialtens where actaivity search_sdTM 188882 88002TO0У L7Inu cowoy 1o.42.+0.# console fiaum045 A1 A41 У 66 4• docker exec dockerlanp1 ohp arcisan test -filter Textkelayservicerescctnuncated 184binessTAAtGOMSCATAStRstACtGOt KeinnuporintontFe supaorted in PHPUntya 12eSUpdaMe yduta test ccee to use ittreprees enstedwilii no longetToctetin thecaoata• Cocker Axer docker laso hohn art thn Tect →itAr ATRA AMKAMICATACTctruncated 184 LinessnaMetadaoa sn docptentsetsbe supported in PHPUnit 12. Update your test code to use attributes instead.Testagu Metedate foued inodorerotoentfor nethoeetinoProviderTest.1 testHasReoul redScopeilO docker avor docker laen nho Artican tect Cfilter TeytRAlaCarvicataeAsk anything (%oL)o PodeswiettPun std SkinAccept allKtwodeurlaime"eiireht4 spad...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85498
|
2930
|
5
|
2026-05-28T12:42:40.025102+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972160025_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
iTerm2• • 0ShellEditViewSessionScripts|ProfilesW iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"0 84-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec-it docker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|X5ec2-user@ip-10-30-129-...100% <78• Thu 28 May 15:42:391₴1ec2-user@ip-10-30-140-...₴7...
|
NULL
|
998028513498261508
|
NULL
|
idle
|
ocr
|
NULL
|
iTerm2• • 0ShellEditViewSessionScripts|ProfilesW iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"0 84-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec-it docker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|X5ec2-user@ip-10-30-129-...100% <78• Thu 28 May 15:42:391₴1ec2-user@ip-10-30-140-...₴7...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85497
|
2931
|
8
|
2026-05-28T12:42:35.276792+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972155276_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
rapstomproidetWindowFV faVsco.|s ~o-t2t2t ml-snota rapstomproidetWindowFV faVsco.|s ~o-t2t2t ml-snota.©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) Xv SalestorgLcAkokyociwco.onOAeindi.oneA console [STAGING>MFelde• # OpportunityMatcherOpportunitySyncStrateProspectSearchStrated• 5 ServiceTraitsClientTest.phoDecorateActivityTest.p© DeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameTPayfoadBuilderTest.phgQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.pho700Cass exkela seru chles exehos estast134Pc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. phoceacheemsarcod.ocoEmal talnartest.ood© FieldValueconvertertestf,4© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortun tSwncStrateovfProsnactCachatast ohoProspectsearcnststegy.osz2 ProviderRecistryTest.php© RecordSelectorTest.pho*pasolveComoanyNamebylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrnd>D Kioskwiewar>DActions› D Office> &a Resolvers→D traits• - [EMAIL]@ EmailActivitvServiceTest© InboxServiceTest.phpo meytcalavsemceltestood>M MeetinaGeneraton>M Notification#DataProvider("environmentProvider)782public function testisForCurrentenvironnentlithMatchingX6n0riginalToHeader(string SdeployRegion, string 70)#[DataProvider("environmentProvider')]public function testIsForCurrentEnvironnentWithNonMatchingX6n0riginalToHeader(string SdeployRegion.public function testIsForCurrentEnvironnentIgnoresToHeader: voidi...HННHHÀpublic function testIsForCurrentEnvironnentWithEnptyHeaders(): voidf...public function testIsForCurrentEnvironnentWithException: void{..}auodruncstonessuncusestuadrstorcuroronowospublic function testSyncUsesUsALiasForUsRegion: void{...}Rerect717public function test6etHistorywithPaginationO: voigConfig::set("jiminny.google_text_user'. "[EMAIL]'):contia:.setthiminny.aoggle text celay toonc', "testetooic")Sseruiice = Sthiiso>createlextPelaySeruicelorSgnailService = Sthis-›createMock or: 6oogleбnail::class)ShistoryResponse1 = Sthis->createMock(orignalClassNan1600gle|Service\Gnail ListHistoryResponse::=U 72ChretonuPocnanconthietanuld122/C1"getHistory'->willReturn(0p:ChretanuPocnancon-mothadlcoactr.'getNextPageToken' ->willReturn( value: "next-page-token')Shdetanupoenaneon - Cohle,sanoatolaait Mininsionselame1casnlol Conuinol Conttl l2ettietanuPosnancorShistoryResponse2->historyId = 12346ShistoryResponse2->method( constraint: 'getHistory')->willReturn([)ShistoryResponse2->method( constraint'getNextPageToken')->willReturn( value: null)SusersHistory = Sthis->createMock( originalClassName: \Google|Service|Gmail\Resource UsersHistory::clSusensHistony->nethod( constraint: "TictlsensHistory»)wwwkeurnintonsrcte.wemrenttton.esnsez, Shastorykesponse2);wache. choudheceuaanoohiwache. chou dhece velauro throese onewache. chou drecevelaurow tharos testetonieMockery::on(fn (Sexpires) => Sexpir74носkery::on(tn (sexpires) *> Sexpici74Sresult = Sservice-soetHistory(SonailService)TXS AUTO NIi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.bY U.zo, U.enazl, U.nane, U.sorconone nundel:BY sms count DESCt * from teans where id = 1:* tron rolesONCAT(U.10, CASE WHEN U.4d = t.owner_id THEN " (ouner)' ELSE ** END) AS user.3domner thuh soot sccounusensu on uisid e shsocabledtcanst1.ndonsde u.teanand ea-orovider & "hubsoor"T * FROM activities WHERE uuid_to_bin(^8024fffb-2df7-4817-91f4-d9f896850248') = uuid; # 79933459 YES* FROM activities WHERE uvid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;*SPOM teans THERE 50810025t * from users where id = 30249**tron nlavbooks where saln Shakt * from playbook categories where id = 43783;t * from playbook categories where playbook id = 5473t * from crn fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN cre fields f ON fd.crm fleld id = f.idN activities a ON fd.activity id = a.idacavily10 = 799554541 f.crn provider id = 'hs activity type':T * FROM activity nessages** fron toxt relave where created at > 12826-85-01*.** fron activitice where usen id IM (7168, 18688) and coeated at > 12826-85-221 onden by sid desci** fron usens nhere tean id = 1 and Sid TN (18688, 13934. 7169),ttnonactivities where usen jid = 7168 onder by id desc Linit 16)rom nccounts where cennurds and inane "solunns** fron usens nhere nane Like IySubrakt: # 31054, 1117*Xrom teans nhere 5din10175***Erom actaiviity searches where lusen sdn318523trom actavity search Silltens where actaivity seanch sidTM 188882 88082# console fiaum045 A1 A41 У 66 4TO0У L7Thu 28 May 15:42:34axineainealieir+0.TextRelayServiceTest.php410-7ecndnexRehySewice.ondwowTextRelayservicctest.phg+0-TextRelayServicetest.php© docker exec docker lamp 1 php artisan test -filter TextRelayServiceTes:uincareoboonnessMetadata found in doc-comment for methogTests UnitlServicesoueetinodenerator1C000l GettoeetinoProviderTest:: testHasRequiredScopeN)Searched function abort unless in -himinnyapThoughtsSearched abort unless in -niminryapgTextRelayServiceTest.php+1-1O docker exec docker lanooho artisan test attiter TextRe avservicerestminetah ieA Knoesadura test docee eo use attrapreesites rinlec penerMetadata found in doc-comment for nethodTestelUnit|Services\Meet/inoGenerator/GooolMoetMeetinoProwiderTesttstestHSsReoufredScooowTextRclayServiccrest.phgAsk anything (XoL)o PodeswiettAcceot allKtwodeurlaime"eiireht4 spag...
|
NULL
|
-2649892461722090229
|
NULL
|
visual_change
|
ocr
|
NULL
|
rapstomproidetWindowFV faVsco.|s ~o-t2t2t ml-snota rapstomproidetWindowFV faVsco.|s ~o-t2t2t ml-snota.©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) Xv SalestorgLcAkokyociwco.onOAeindi.oneA console [STAGING>MFelde• # OpportunityMatcherOpportunitySyncStrateProspectSearchStrated• 5 ServiceTraitsClientTest.phoDecorateActivityTest.p© DeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameTPayfoadBuilderTest.phgQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.pho700Cass exkela seru chles exehos estast134Pc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. phoceacheemsarcod.ocoEmal talnartest.ood© FieldValueconvertertestf,4© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortun tSwncStrateovfProsnactCachatast ohoProspectsearcnststegy.osz2 ProviderRecistryTest.php© RecordSelectorTest.pho*pasolveComoanyNamebylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrnd>D Kioskwiewar>DActions› D Office> &a Resolvers→D traits• - [EMAIL]@ EmailActivitvServiceTest© InboxServiceTest.phpo meytcalavsemceltestood>M MeetinaGeneraton>M Notification#DataProvider("environmentProvider)782public function testisForCurrentenvironnentlithMatchingX6n0riginalToHeader(string SdeployRegion, string 70)#[DataProvider("environmentProvider')]public function testIsForCurrentEnvironnentWithNonMatchingX6n0riginalToHeader(string SdeployRegion.public function testIsForCurrentEnvironnentIgnoresToHeader: voidi...HННHHÀpublic function testIsForCurrentEnvironnentWithEnptyHeaders(): voidf...public function testIsForCurrentEnvironnentWithException: void{..}auodruncstonessuncusestuadrstorcuroronowospublic function testSyncUsesUsALiasForUsRegion: void{...}Rerect717public function test6etHistorywithPaginationO: voigConfig::set("jiminny.google_text_user'. "[EMAIL]'):contia:.setthiminny.aoggle text celay toonc', "testetooic")Sseruiice = Sthiiso>createlextPelaySeruicelorSgnailService = Sthis-›createMock or: 6oogleбnail::class)ShistoryResponse1 = Sthis->createMock(orignalClassNan1600gle|Service\Gnail ListHistoryResponse::=U 72ChretonuPocnanconthietanuld122/C1"getHistory'->willReturn(0p:ChretanuPocnancon-mothadlcoactr.'getNextPageToken' ->willReturn( value: "next-page-token')Shdetanupoenaneon - Cohle,sanoatolaait Mininsionselame1casnlol Conuinol Conttl l2ettietanuPosnancorShistoryResponse2->historyId = 12346ShistoryResponse2->method( constraint: 'getHistory')->willReturn([)ShistoryResponse2->method( constraint'getNextPageToken')->willReturn( value: null)SusersHistory = Sthis->createMock( originalClassName: \Google|Service|Gmail\Resource UsersHistory::clSusensHistony->nethod( constraint: "TictlsensHistory»)wwwkeurnintonsrcte.wemrenttton.esnsez, Shastorykesponse2);wache. choudheceuaanoohiwache. chou dhece velauro throese onewache. chou drecevelaurow tharos testetonieMockery::on(fn (Sexpires) => Sexpir74носkery::on(tn (sexpires) *> Sexpici74Sresult = Sservice-soetHistory(SonailService)TXS AUTO NIi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.bY U.zo, U.enazl, U.nane, U.sorconone nundel:BY sms count DESCt * from teans where id = 1:* tron rolesONCAT(U.10, CASE WHEN U.4d = t.owner_id THEN " (ouner)' ELSE ** END) AS user.3domner thuh soot sccounusensu on uisid e shsocabledtcanst1.ndonsde u.teanand ea-orovider & "hubsoor"T * FROM activities WHERE uuid_to_bin(^8024fffb-2df7-4817-91f4-d9f896850248') = uuid; # 79933459 YES* FROM activities WHERE uvid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;*SPOM teans THERE 50810025t * from users where id = 30249**tron nlavbooks where saln Shakt * from playbook categories where id = 43783;t * from playbook categories where playbook id = 5473t * from crn fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN cre fields f ON fd.crm fleld id = f.idN activities a ON fd.activity id = a.idacavily10 = 799554541 f.crn provider id = 'hs activity type':T * FROM activity nessages** fron toxt relave where created at > 12826-85-01*.** fron activitice where usen id IM (7168, 18688) and coeated at > 12826-85-221 onden by sid desci** fron usens nhere tean id = 1 and Sid TN (18688, 13934. 7169),ttnonactivities where usen jid = 7168 onder by id desc Linit 16)rom nccounts where cennurds and inane "solunns** fron usens nhere nane Like IySubrakt: # 31054, 1117*Xrom teans nhere 5din10175***Erom actaiviity searches where lusen sdn318523trom actavity search Silltens where actaivity seanch sidTM 188882 88082# console fiaum045 A1 A41 У 66 4TO0У L7Thu 28 May 15:42:34axineainealieir+0.TextRelayServiceTest.php410-7ecndnexRehySewice.ondwowTextRelayservicctest.phg+0-TextRelayServicetest.php© docker exec docker lamp 1 php artisan test -filter TextRelayServiceTes:uincareoboonnessMetadata found in doc-comment for methogTests UnitlServicesoueetinodenerator1C000l GettoeetinoProviderTest:: testHasRequiredScopeN)Searched function abort unless in -himinnyapThoughtsSearched abort unless in -niminryapgTextRelayServiceTest.php+1-1O docker exec docker lanooho artisan test attiter TextRe avservicerestminetah ieA Knoesadura test docee eo use attrapreesites rinlec penerMetadata found in doc-comment for nethodTestelUnit|Services\Meet/inoGenerator/GooolMoetMeetinoProwiderTesttstestHSsReoufredScooowTextRclayServiccrest.phgAsk anything (XoL)o PodeswiettAcceot allKtwodeurlaime"eiireht4 spag...
|
85496
|
NULL
|
NULL
|
NULL
|
|
85496
|
2931
|
7
|
2026-05-28T12:42:19.554856+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972139554_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6879326690315022146
|
-8631728821509045824
|
visual_change
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
rapstomViewCoocWindowFV faVsco.s ~#12121 on JY-20963-fx-wnapers.oh©ActivityControlier.phpv SalestorgOLekоkyseiwico.onOAeindi.one>MFelde• # OpportunityMatcher• = OpportunitySyncStrateProspectSearchStrateg> ServiceTraitsClientTest.phoDecorateActivityTest.p© DeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameTPayfoadBuilderTest.phgQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.pho© QueryResultsTests.phcC ServiceTest.pho358 €c) Suncta chredk Servic© BaseService Test. phoceacheeimsarcd.oconCeimAdiMiwseroeieroeeimeontauratonsottnad©ermobjectsResolvertest.fEmal talnartest.oodFieldValueconverterTest.g© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatch©OpportunitySyncStrategyfProsnactCachatast ohoProsoectScarchstatceyrProvida Pacistr Tast nho© RecordSelectorTest.pho© ResolveCompanyNameByl© TimePerioditeratorTest.ph© UpdateCrmDataResolverwlathrnd>D Kioskwiewar>DActions› D Office> &a Resolvers381→D traits› Ea Validators$ B$ 3cassexkela seru ches excnos lestwastpublic function testSetHistoryPoint(): voidSreflection = new ReflectionClass(Sservice):Smethod = Sreflection->getMethod( name:sethastoryrounoSnethod->setAccessibte( accessible: true);aros: "test-topic', 12345);suuoasserohsoncour expccioo.orconwahohhcsssunoublac tunction testrerreshhstoryporntor vordcontlo:"ser('ominny, coogi e text user',"Testicexanolle con")Sona i Seruice = Sthis-screarelock, onons eassvame: sooo ecnoniclass)SwatchResponse = Sthis-screateMock( orioinalClassName: \Goocl.e|Service|Gnasi1|WatchResponse:rclass)lwatchlosucerumoitranchhacaoncaSgnailService->users = Susers:Sservice = new class @ extends TextRelayService 1public function _constructopublic function getService(string Snailbox): 6009le6mailrecorn schises ockoervicerASERMCEES OCKSRTUREEOOERN© BatchServiceTest.php@ EmailActivitvServiceTest© InboxServiceTest.phpo meytcalavsemceltestood>M MeetinaGeneraton>M Notification(Cache::shoutdReceive('put')-›with( -args: 'test-topic', 99999, \Mockery::on(fn (Sexpires) => Sexpint742Sresult= Sseruice-srerreshhsstonyPosintttooe"test-tooscloi3esSthis-sasser Sanet eoacken.coor,v Accept Fle x- X Reject Flle oxQcustom.loglaravel.logA SF fiminny@localhost)& console (PROD) XA console (STAGING)D0.000Ty: Autowi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.700701•BY u.id, u.enail, u.nane, u.softphone number:BY sms count DESCFRABREERRAE775726BEBEOEEt * from teans where id = 1:t * from rolesCONCAT(u.id, CASE WHEN u.id = t.owner_id THEN • (ouner)' ELSE "* END) AS user_idS.ouner_id FROM social_accounts sausers u on u.id = sa.sociable..igteans t 1.neonsdeu.toanutcanbiid e 117 and eh-orovider = "hubsootT * FROM actáváties WHERE uvid_to_bin( 8024fffb-2df7-4817-91f4-d9f896850248') = uuid; # 79933459 YES* FROM activities WHERE uvid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = vuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;T* FROM teans WHERE id = 1117t * from users where id = 30249t * from playbooks where id = 5473t * from playbook categories where id = 43783:t * from playbook categories where playbook id = 5473t * from crn fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN crn fields f ON fd.crn field id = f.idN activities a ON fd.activity id = a.idacavily10 = 799554541f.crm provider id = 'hs activity type' :T * FROM activity nessages** fron toxt relave where created at > 12826-85-01*.** fron activitice where usen id IM (7168, 18688) and coeated at > 12826-85-221 onden by sid desca** fron usens nhere tean id = 1 and Sid TN (18688. 13934. 7169)=activities where usen jid = 7160 onder by id desc Linit 16** fron accounts where tean jid = 1and nane = "ColunnS".** fron usens nhere nane Like IySubrakt: # 31054, 1117where $d= 1117,***Erom actaiviity searches where lusen sdn318523+ fron activity search filtens where activity seanch ja TN (8880p. 8R092)# console fiaum045 A1 A41 У 66 4TO0У L7Thu 28 May 15:42:19+0.+20 -8+10 -12axineainealieir-TexiRelayservicetest.phgex Rewysemica esdondkeao lextkelayservice.ond #lzo-/TextRelayServiceTest.phpTnougnt lor 1sTextRelayServiceTest.phpo docker exec docker lanosl ono artasian test etiiter TextRelavservice est<truncated 184 lines>Attceprtcdteo onosaate no tongeTests un Mserateesoeet1nodoneratorito0ol Detheeet inoProviderTest:/ testHasRequlredScopekTextReinyScrvicetcst.ohdO docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestin doc-commentSparta i rotate 12: (rae you Cet coe to tia aaletea a ta a ogor ovioein doc-comment for clas,1tile +166Ask anything (Xol")Hode swiothAcceot allKtwodeurlaime"eiireht4 spag...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85495
|
2931
|
6
|
2026-05-28T12:42:14.295336+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972134295_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
rapstomProjectvFV faVsco.|s ~ViewCooc#12121 on JY- rapstomProjectvFV faVsco.|s ~ViewCooc#12121 on JY-20963-fox-hWindowwnapers.oh©ActivityController.phpv SalestorgOLeAkоkyscrco.onOAeindi.one› 0 Fields• # OpportunityMatcher• OpportunitySyncStrateProspectSearchStrateg> ServiceTraits© ClientTest.phpCass exkela seru chles exehos estastpublic function testRefreshHistoryPoint(): voidSservice = new class 0 extends TextRelavService "© DecorateActivityTest.pC DeleteObjects TraitTestC FieldDefinitionsTest.ph© GetActivityFieldNametpublic GoogleGmail SmockService;E PayloadBullder Test.phy= 787@ QueryBullderTest.phpQueryHandlerTest.phoC QueryiteratorTest.phpSservice-»nockService = SgnaitService;(Cache: :shoutdReceive('put')->with(-args 'test-topic', 99999, Mockery: :on(fn (Sexpires) » Sexpire718© QueryResultsTests.phc© ServiceTest.php387Scesulta SserxicR:2cefceshHistoryPoint( topic: Ltest-tRRia.).:c Suncta chredk seric388© BaseServiceTest.php389Sthis-›assertSame( expected: 99999, Sresult):@ CachedCrm Senvice Decor 396© CrmActivityServiceTest.pteeimeontauratonsottnad392 %E custom.logE Iaravel.logA SF (iminny@localhost)A console (STAGING)D0.000TXS AUTO NIi.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)•BY u.id, u.enail, u.nane, u.softphone number:BY sms_count DESC;A console (PROD) X)© EmallHelperTest.phpFieldValueconverterTest.r© LayoutManagerTest.php397MiarateProv derSendcale39© Opportunity ActivityMatchy 399C OpportunitySyneStrategyf 409ProspectCacheTest.php© ProspectSearchStrategyf© ProviderRegistryTest.php© RecordSelectorTest.phpResolveCompanyNameBylC TimePerioditeratorTest.ph04 61© UpdateCrmDataResclverT>Ea Internal› E Kioskwiewar› @Actions› Office› E Resolvers→D traits› E Validators© BatchServiceTest.phpBEGS&$ 6©EmailActivityServiceTest.fInboxServiceTest.phpo meytcalavsemceltestood› MeetingGenerator>M Notification>M PacallAlt * fron teans where id = 1;t * from roles:ONCAT(u.1d, CASE WHEN U.1d = t.owner_id THEN • (ouner)' ELSE "* END) AS user_id,puorio funetion testetsenvieel): velSservice = Sthis->createTextReLayServiceO:Sresult = Sservice->[EMAIL]');suoerohconcour expoclot. boockondtesure.ouner_id FROM social_accounts sausensu on uisid e shsocabledteans ton t.id = u.tean_idand sa-provider = 'hubspot":T * FROM actáváties WHERE uvid_to_bin( 8024fffb-2df7-4017-91f4-d9f896850248') = uvid; # 79933459 YEST * FROM activities WHERE uvid_to_bin('[CREDIT_CARD]-9274-4f4da2a8185c') = vuid; # 80186192 NOT * FROM crn_configurations WHERE id = 1053;ET * FROM teans WHERE id = 1117;t * from users where id = 30249;t * from playbooks where id = 5473:t * from playbook_categories where id = 43783;t * from playbook_categories where playbook_id = 5473;t * from crn_fields where id = 659242;t * from crn field values where crm field id = 659242:usagesprivate function createTextRelayService(): TextRelayServiceSservice = new class() extends TextRelayService (public function _constructoT * FROM crn field data fN crn_fields f ON fd.Crn_field_id = f.1dN activities a ON fd.activity_id = a.idactivity_id = 79933459f.crm_provider_id = 'hs_activity_type':netunn Ssenusce*T * FROM activity_nessages;* fron text_relays where created_at > ^2026-85-01*:t * from actávities where user_id IN (7160, 18608) and created_at > *28026-85-22' order by id desc;* from users where tean_id = 1 and id IN (18688, 13934, 7168);activities where user_id = 7160 order by id desc linit 10;public function testConstructorThrowslhenCredentialsMissing(): voidf..nane Like "XSubrak"; # 31054, 1117Srom actaivity searches where lusen sdun31856trom actavity search Silltens where actaivity seanch sidTM 188882 88082+ 1 of 2 edits+V Accept Fle x- X Rejeet Fie ox®TO0У L7A console (EU?045 A1 A41 X66 AThu 28 May 15:42:13+0.+20 -8+10 -12axineainealieir-TexiRelayservicetest.phgTextRelayServiceTest.phpkeao lextkelayservice.ond #lzo-/D TextRelayServiceTest.phpTnougnt lor 1sD TextRelayServiceTest.phpo docker exec docker lanool ono artasian test etiiter TextRelavserice es"«truncated 184 lines>as repreest ensted witi no longeiTests un Mserateesoueet1nodenerator1Go00l DethoeetingProviderTest:/ testHasRequlredScopeMTextReinyScrvicetcst.ohdo docker exec docker_lamp_1 php artisan test —1ilter TextRelayServiceTestin doc-commentin doc-comment for classAsk anything (XOL)"PodswiothAcceot allKtwodeurlaime"eiireh2 4 spac...
|
NULL
|
-2187018441005032171
|
NULL
|
idle
|
ocr
|
NULL
|
rapstomProjectvFV faVsco.|s ~ViewCooc#12121 on JY- rapstomProjectvFV faVsco.|s ~ViewCooc#12121 on JY-20963-fox-hWindowwnapers.oh©ActivityController.phpv SalestorgOLeAkоkyscrco.onOAeindi.one› 0 Fields• # OpportunityMatcher• OpportunitySyncStrateProspectSearchStrateg> ServiceTraits© ClientTest.phpCass exkela seru chles exehos estastpublic function testRefreshHistoryPoint(): voidSservice = new class 0 extends TextRelavService "© DecorateActivityTest.pC DeleteObjects TraitTestC FieldDefinitionsTest.ph© GetActivityFieldNametpublic GoogleGmail SmockService;E PayloadBullder Test.phy= 787@ QueryBullderTest.phpQueryHandlerTest.phoC QueryiteratorTest.phpSservice-»nockService = SgnaitService;(Cache: :shoutdReceive('put')->with(-args 'test-topic', 99999, Mockery: :on(fn (Sexpires) » Sexpire718© QueryResultsTests.phc© ServiceTest.php387Scesulta SserxicR:2cefceshHistoryPoint( topic: Ltest-tRRia.).:c Suncta chredk seric388© BaseServiceTest.php389Sthis-›assertSame( expected: 99999, Sresult):@ CachedCrm Senvice Decor 396© CrmActivityServiceTest.pteeimeontauratonsottnad392 %E custom.logE Iaravel.logA SF (iminny@localhost)A console (STAGING)D0.000TXS AUTO NIi.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)•BY u.id, u.enail, u.nane, u.softphone number:BY sms_count DESC;A console (PROD) X)© EmallHelperTest.phpFieldValueconverterTest.r© LayoutManagerTest.php397MiarateProv derSendcale39© Opportunity ActivityMatchy 399C OpportunitySyneStrategyf 409ProspectCacheTest.php© ProspectSearchStrategyf© ProviderRegistryTest.php© RecordSelectorTest.phpResolveCompanyNameBylC TimePerioditeratorTest.ph04 61© UpdateCrmDataResclverT>Ea Internal› E Kioskwiewar› @Actions› Office› E Resolvers→D traits› E Validators© BatchServiceTest.phpBEGS&$ 6©EmailActivityServiceTest.fInboxServiceTest.phpo meytcalavsemceltestood› MeetingGenerator>M Notification>M PacallAlt * fron teans where id = 1;t * from roles:ONCAT(u.1d, CASE WHEN U.1d = t.owner_id THEN • (ouner)' ELSE "* END) AS user_id,puorio funetion testetsenvieel): velSservice = Sthis->createTextReLayServiceO:Sresult = Sservice->[EMAIL]');suoerohconcour expoclot. boockondtesure.ouner_id FROM social_accounts sausensu on uisid e shsocabledteans ton t.id = u.tean_idand sa-provider = 'hubspot":T * FROM actáváties WHERE uvid_to_bin( 8024fffb-2df7-4017-91f4-d9f896850248') = uvid; # 79933459 YEST * FROM activities WHERE uvid_to_bin('[CREDIT_CARD]-9274-4f4da2a8185c') = vuid; # 80186192 NOT * FROM crn_configurations WHERE id = 1053;ET * FROM teans WHERE id = 1117;t * from users where id = 30249;t * from playbooks where id = 5473:t * from playbook_categories where id = 43783;t * from playbook_categories where playbook_id = 5473;t * from crn_fields where id = 659242;t * from crn field values where crm field id = 659242:usagesprivate function createTextRelayService(): TextRelayServiceSservice = new class() extends TextRelayService (public function _constructoT * FROM crn field data fN crn_fields f ON fd.Crn_field_id = f.1dN activities a ON fd.activity_id = a.idactivity_id = 79933459f.crm_provider_id = 'hs_activity_type':netunn Ssenusce*T * FROM activity_nessages;* fron text_relays where created_at > ^2026-85-01*:t * from actávities where user_id IN (7160, 18608) and created_at > *28026-85-22' order by id desc;* from users where tean_id = 1 and id IN (18688, 13934, 7168);activities where user_id = 7160 order by id desc linit 10;public function testConstructorThrowslhenCredentialsMissing(): voidf..nane Like "XSubrak"; # 31054, 1117Srom actaivity searches where lusen sdun31856trom actavity search Silltens where actaivity seanch sidTM 188882 88082+ 1 of 2 edits+V Accept Fle x- X Rejeet Fie ox®TO0У L7A console (EU?045 A1 A41 X66 AThu 28 May 15:42:13+0.+20 -8+10 -12axineainealieir-TexiRelayservicetest.phgTextRelayServiceTest.phpkeao lextkelayservice.ond #lzo-/D TextRelayServiceTest.phpTnougnt lor 1sD TextRelayServiceTest.phpo docker exec docker lanool ono artasian test etiiter TextRelavserice es"«truncated 184 lines>as repreest ensted witi no longeiTests un Mserateesoueet1nodenerator1Go00l DethoeetingProviderTest:/ testHasRequlredScopeMTextReinyScrvicetcst.ohdo docker exec docker_lamp_1 php artisan test —1ilter TextRelayServiceTestin doc-commentin doc-comment for classAsk anything (XOL)"PodswiothAcceot allKtwodeurlaime"eiireh2 4 spac...
|
85493
|
NULL
|
NULL
|
NULL
|
|
85494
|
2930
|
4
|
2026-05-28T12:42:07.653809+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972127653_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
iTerm2• • 0ShellEditViewSessionScripts|ProfilesW iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKER₴81DEV (docker)₴82-zshN3screenpipe"O &4-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec-it docker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|X5ec2-user@ip-10-30-129-...100% <78 • Thu 28 May 15:42:07181ec2-user@ip-10-30-140-...₴7...
|
NULL
|
1219965165948393394
|
NULL
|
idle
|
ocr
|
NULL
|
iTerm2• • 0ShellEditViewSessionScripts|ProfilesW iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKER₴81DEV (docker)₴82-zshN3screenpipe"O &4-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec-it docker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|X5ec2-user@ip-10-30-129-...100% <78 • Thu 28 May 15:42:07181ec2-user@ip-10-30-140-...₴7...
|
85491
|
NULL
|
NULL
|
NULL
|
|
85493
|
2931
|
5
|
2026-05-28T12:41:41.911535+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972101911_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6423983795013307969
|
-3852565242246887264
|
visual_change
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
rapstomProjectvFV faVsco.|s ~ViewCooc#12121 on JY-20963-fox-hWindowwnapers.oh©ActivityController.phpv SalestorgOLekоkyseiwico.onOAeindi.one› 0 Fields• # OpportunityMatcher• OpportunitySyncStrateProspectSearchStrateg> ServiceTraits© ClientTest.phpCass exkela seru chles exehos estastpublic function testRefreshHistoryPoint(): voidSservice = new class 0 extends TextRelavService "© DecorateActivityTest.pC DeleteObjects TraitTestC FieldDefinitionsTest.ph© GetActivityFieldNametpublic GoogleGmail SmockService;E PayloadBullder Test.phy= 787@ QueryBullderTest.phpQueryHandlerTest.phoC QueryiteratorTest.phpSservice-»nockService = SgnaitService;(Cache: :shoutdReceive('put')->with(-args 'test-topic', 99999, Mockery: :on(fn (Sexpires) » Sexpire718© QueryResultsTests.phc© ServiceTest.php387Scesulta SserxicR:2cefceshHistoryPoint( topic: Ltest-tRRia.).:c) Suncta chredk Servic388© BaseServiceTest.php389Sthis-›assertSame( expected: 99999, Sresult):@ CachedCrm Senvice Decor 396© CrmActivityServiceTest.pteeimeontauratonsottnad392 %E custom.logE Iaravel.logA SF (iminny@localhost)A console (STAGING)D0.000TXS AUTO NIi.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)•BY u.id, u.enail, u.nane, u.softphone number:BY sms_count DESC;A console (PROD) X)© EmallHelperTest.phpFieldValueconverterTest.r© LayoutManagerTest.php397MiarateProv derSendcale39© Opportunity ActivityMatchy 399C OpportunitySyneStrategyf 409© ProspectCacheTest.php© ProspectSearchStrategyfa© ProviderRegistryTest.php© RecordSelectorTest.phpResolveCompanyNameBylC TimePerioditeratorTest.ph04 61© UpdateCrmDataResclverT>Ea Internal› E Kioskwiewar› @Actions› Office› E Resolvers→D traits› E Validators© BatchServiceTest.phpBEGS&$ 6©EmailActivityServiceTest.fInboxServiceTest.phpo meytcalavsemceltestood› MeetingGenerator>M Notification>M PacallAlt * fron teans where id = 1;t * from roles:ONCAT(u.1d, CASE WHEN U.1d = t.owner_id THEN • (ouner)' ELSE "* END) AS user_id,puorio funetion testetsenvieel): velSservice = Sthis->createTextReLayServiceO:Sresult = Sservice->[EMAIL]');suoerohconcour expoclot. boockondtesure.ouner_id FROM social_accounts sausensu on uisid e shsocabledteans ton t.id = u.tean_idand sa-provider = 'hubspot":T * FROM actáváties WHERE uvid_to_bin( 8024fffb-2df7-4017-91f4-d9f896850248') = uvid; # 79933459 YEST * FROM activities WHERE uvid_to_bin('[CREDIT_CARD]-9274-4f4da2a8185c') = vuid; # 80186192 NOT * FROM crn_configurations WHERE id = 1053;ET * FROM teans WHERE id = 1117;t * from users where id = 30249;t * from playbooks where id = 5473:t * from playbook_categories where id = 43783;t * from playbook_categories where playbook_id = 5473;t * from crn_fields where id = 659242;t * from crn field values where crm field id = 659242:usagesprivate function createTextRelayService(): TextRelayServiceSservice = new class() extends TextRelayService (public function _constructoT * FROM crn field data fN crn_fields f ON fd.Crn_field_id = f.1dN activities a ON fd.activity_id = a.idactivity_id = 79933459f.crm_provider_id = 'hs_activity_type':netunn Ssenusce*T * FROM activity_nessages;* fron text_relays where created_at > ^2026-85-01':t * from actávities where user_id IN (7160, 18608) and created_at > *28026-85-22' order by id desc;* from users where tean_id = 1 and id IN (18688, 13934, 7168);activities where user_id = 7160 order by id desc linit 10;public function testConstructorThrowslhenCredentialsMissing(): voidf..nane Like "XSubrak"; # 31054, 1117Srom actaivity searches where lusen sdun31856trom actavity search Silltens where actaivity seanch sidTM 188882 88082+ 1 of 2 edits+V Accept Fle x- X Rejeet Fie ox®A console (EU?045 A1 A41 X66 ATO0У L7Inu cowoy 1o.41.4+0.+20 -8+10 -12axineainealieir-TexiRelayservicetest.phgTextRelayServiceTest.phpkeao lextkelayservice.ond #lzo-/D TextRelayServiceTest.phpTnougnt lor 1sD TextRelayServiceTest.phpo docker exec docker lanool ono artasian test etiiter TextRelavserice es"«truncated 184 lines>as repreest ensted witi no longeiTests un Mserateesoueet1nodenerator1Go00l DethoeetingProviderTest:/ testHasRequlredScopeMD TextRelayServiceTest.phpo docker exec docker_lamp_1 php artisan test —1ilter TextRelayServiceTestin doc-commentin doc-comment for classAsk anything (XOL)"PodswiothAcceot allKtwodeurlaime"eiireh2 4 spac...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85492
|
2931
|
4
|
2026-05-28T12:41:38.701531+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972098701_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
rapstomViewCootWindowFV faVsco.|s ~#12121 on JY-20 rapstomViewCootWindowFV faVsco.|s ~#12121 on JY-20963-fogproidetv SalestorgLcAkokyociwco.on>MFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"> ServiceTraitsClientTest.pho© DecorateActivityTest.p© DeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phs© QueryBullderTest.phpQueryHandlerTest.pho©QueryiteratorTest.phd© QueryResultsTests.phcC ServiceTest.pho© SyncBatchRedisServick© BaseService Test. phoceacheemsarcod.ocoCCrmActivitvServiceTest.oteeimeontauratonsottnad©crmoojectskesoiverrestf,oeope autprosnedsoarohs@ FmailHelnerTest.ohd300 €1FieldValueconverterTest.f© LayoutManagerTest.phpMiarateProv derSendcale382Onnortun tvA chivirlatchOnnortun tSwncStrateovfProsnacteachatast mhoC ProspectSearchStrategyf* 307(a ProvidarPecisto Test oho© RecordSelectorTest.php© ResolveComoanyNameByl© TimePerioditeratorTest.ph© UpdateCrmDataResolverTwlathrnd>D Kioskwiewar>DActions› D Office> &a Resolvers→D traitsAВЛBВВЯЯ># ValidatorsC BatchServiceTest.php@ EmailActivitvServiceTest© InboxServiceTest.phpo meytcalavsemceltestood>M MeetinaGeneraton>M Notification322 %ActivityController.phpOAeindi.oneCass exkelaysery celes extenosestaspublic function testGetHistoryCallsRefreshHistoryPointlhenNoHistory(): voidSwatchResponse = Sthis-›createMockoclassName: \Google \Service \6mail WatchResponse::class)Snacchkesponseosniscorylds yyyyysusers e schzsescreacenock onemiesoame boogle servace onazl kesource users..classmstorvkesconsesnsoscrechockoxtenbooOleDerWCeoDISTWISTORVKeSCOnSENsscorukesponseosmenool constoeoettorswkernlae*getNextPageToken')->willReturn( value: null)Gooole|Servsce|Gnat1|Resounce|UsersHictorvrsclSsUserstistory'->wtRecunnShistoryResponsenSservice = new classno usanes@ extends TextRelayService 1public function __constructopublic function getService(string Snailbox): 6oogle6nailTecor suts"aocrodwacenpublic GoogleGmail SmockService:Sservice-›nockService = SmockService734cache:.snoutokecezvelgec -azcnletest-coozc ->anokecurn maras talse"cache::Shoutokecezvelouc ->azchl0\Mockery: :on(fn (Sexpires) = SexpiFi,z!cache::Shoutokecezvelouc -azchlwaes xest-coolc"12545Mockery::on(fn (Sexpires) => Sexpim3Snesult = Sservice->oetHictony(SnockSeryice)aSaoweRCCSCArMWeNsuLdsConfag: set ( 3ininny 9р78. ТР- Аос во хи а овн) р кооcontto[EMAIL] text=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) XA console [STAGING00 €TXS AUTO NIi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.700701bx U.zo, U.elazl, U.nane, U.sorconone nundel:BY sms count DESCt * from teans where id = 1:* tron roles-706ONCAT(U.10, CASE WHEN U.4d = t.owner_id THEN " (ouner)' ELSE ** END) AS user.3domner thuh soot sccounusensu on uisid e shsocabledtcanst1.ndonsde u.teanand ea-orovider & "hubsoor"T * FROM activities WHERE uvid_to_bin(^8024fffb-2df7-4017-91f4-d9f896850248*) = vuid; # 79933459 YES* FROM activities WHERE uuid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = vuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;*SPOM teans THERE 50810675t * from users where id = 30249**tron nlavbooks where saln Shakt * from playbook categories where id = 43783;t * from playbook categories where playbook id = 5473t * from crn fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN cre fields f ON fd.crm fleld id = f.idN activities a ON fd.activity id = a.idacavily10 = 799554541f.crm provider id = 'hs activity type' :T * FROM activity nessages** fron toxt relave where created at > 12826-85-01*.** fron activitice where usen id IM (7168, 18688) and coeated at > 12826-85-221 onden by sid desca** fron usens nhere tean id = 1 and Sid TN (18688, 13934. 7169),ttnonactivities where usen jid = 7168 onder by id desc Linit 16)rom accounts where cennurds and inanes "solunnse** fron usens nhere nane Like IySubrakt: # 31054, 1117***trom actaivity searches where usen 5dn31856trom actavity search Sialtens where actaivity search_id TM 88882 88082)# console fiaum045 A1 A41 У 66 4TO0У L7Inu cowoy 10:41.0e+0.+20 -8+10 -12axineainealieir-TexiRelayservicetest.phgex Rewysemica esdondkeao lextkelayservice.ond #lzo-/TextRelayServiceTest.phpTnougnt lor 1sTextRelayServiceTest.phpo docker exec docker lanosl oho artacan test entiter TextRelavservicerest<truncated 184 lines>Attceprtcdteo onosaate no tongeTests un Mserateesoueet1nodenerator1Go00l DethoeetingProviderTest:/ testHasRequlredScopeMTextReinyScrvicetcst.ohdO docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestin doc-commentSparta e ratate 12: (rate you Cet coe to i aal etea an ta ao ogoe tovioein doc-comment for clas,lock amthing (XoL)"PodswiothAcceot allKtwodeurlaime"eiireht4 spag...
|
NULL
|
-4000122773975664524
|
NULL
|
visual_change
|
ocr
|
NULL
|
rapstomViewCootWindowFV faVsco.|s ~#12121 on JY-20 rapstomViewCootWindowFV faVsco.|s ~#12121 on JY-20963-fogproidetv SalestorgLcAkokyociwco.on>MFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"> ServiceTraitsClientTest.pho© DecorateActivityTest.p© DeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phs© QueryBullderTest.phpQueryHandlerTest.pho©QueryiteratorTest.phd© QueryResultsTests.phcC ServiceTest.pho© SyncBatchRedisServick© BaseService Test. phoceacheemsarcod.ocoCCrmActivitvServiceTest.oteeimeontauratonsottnad©crmoojectskesoiverrestf,oeope autprosnedsoarohs@ FmailHelnerTest.ohd300 €1FieldValueconverterTest.f© LayoutManagerTest.phpMiarateProv derSendcale382Onnortun tvA chivirlatchOnnortun tSwncStrateovfProsnacteachatast mhoC ProspectSearchStrategyf* 307(a ProvidarPecisto Test oho© RecordSelectorTest.php© ResolveComoanyNameByl© TimePerioditeratorTest.ph© UpdateCrmDataResolverTwlathrnd>D Kioskwiewar>DActions› D Office> &a Resolvers→D traitsAВЛBВВЯЯ># ValidatorsC BatchServiceTest.php@ EmailActivitvServiceTest© InboxServiceTest.phpo meytcalavsemceltestood>M MeetinaGeneraton>M Notification322 %ActivityController.phpOAeindi.oneCass exkelaysery celes extenosestaspublic function testGetHistoryCallsRefreshHistoryPointlhenNoHistory(): voidSwatchResponse = Sthis-›createMockoclassName: \Google \Service \6mail WatchResponse::class)Snacchkesponseosniscorylds yyyyysusers e schzsescreacenock onemiesoame boogle servace onazl kesource users..classmstorvkesconsesnsoscrechockoxtenbooOleDerWCeoDISTWISTORVKeSCOnSENsscorukesponseosmenool constoeoettorswkernlae*getNextPageToken')->willReturn( value: null)Gooole|Servsce|Gnat1|Resounce|UsersHictorvrsclSsUserstistory'->wtRecunnShistoryResponsenSservice = new classno usanes@ extends TextRelayService 1public function __constructopublic function getService(string Snailbox): 6oogle6nailTecor suts"aocrodwacenpublic GoogleGmail SmockService:Sservice-›nockService = SmockService734cache:.snoutokecezvelgec -azcnletest-coozc ->anokecurn maras talse"cache::Shoutokecezvelouc ->azchl0\Mockery: :on(fn (Sexpires) = SexpiFi,z!cache::Shoutokecezvelouc -azchlwaes xest-coolc"12545Mockery::on(fn (Sexpires) => Sexpim3Snesult = Sservice->oetHictony(SnockSeryice)aSaoweRCCSCArMWeNsuLdsConfag: set ( 3ininny 9р78. ТР- Аос во хи а овн) р кооcontto[EMAIL] text=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) XA console [STAGING00 €TXS AUTO NIi.created at > DATE SUB(NOWO, INTERVAL 38 DAY.700701bx U.zo, U.elazl, U.nane, U.sorconone nundel:BY sms count DESCt * from teans where id = 1:* tron roles-706ONCAT(U.10, CASE WHEN U.4d = t.owner_id THEN " (ouner)' ELSE ** END) AS user.3domner thuh soot sccounusensu on uisid e shsocabledtcanst1.ndonsde u.teanand ea-orovider & "hubsoor"T * FROM activities WHERE uvid_to_bin(^8024fffb-2df7-4017-91f4-d9f896850248*) = vuid; # 79933459 YES* FROM activities WHERE uuid_to_bin( [CREDIT_CARD]-927f-4f4da2a8185c') = vuid; # 80186192 NCT * FROM crn_configurations WHERE id = 1053;*SPOM teans THERE 50810675t * from users where id = 30249**tron nlavbooks where saln Shakt * from playbook categories where id = 43783;t * from playbook categories where playbook id = 5473t * from crn fields where id = 659242;t * from crn field values where crm field id = 659242T * FROM crn field data faN cre fields f ON fd.crm fleld id = f.idN activities a ON fd.activity id = a.idacavily10 = 799554541f.crm provider id = 'hs activity type' :T * FROM activity nessages** fron toxt relave where created at > 12826-85-01*.** fron activitice where usen id IM (7168, 18688) and coeated at > 12826-85-221 onden by sid desca** fron usens nhere tean id = 1 and Sid TN (18688, 13934. 7169),ttnonactivities where usen jid = 7168 onder by id desc Linit 16)rom accounts where cennurds and inanes "solunnse** fron usens nhere nane Like IySubrakt: # 31054, 1117***trom actaivity searches where usen 5dn31856trom actavity search Sialtens where actaivity search_id TM 88882 88082)# console fiaum045 A1 A41 У 66 4TO0У L7Inu cowoy 10:41.0e+0.+20 -8+10 -12axineainealieir-TexiRelayservicetest.phgex Rewysemica esdondkeao lextkelayservice.ond #lzo-/TextRelayServiceTest.phpTnougnt lor 1sTextRelayServiceTest.phpo docker exec docker lanosl oho artacan test entiter TextRelavservicerest<truncated 184 lines>Attceprtcdteo onosaate no tongeTests un Mserateesoueet1nodenerator1Go00l DethoeetingProviderTest:/ testHasRequlredScopeMTextReinyScrvicetcst.ohdO docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestin doc-commentSparta e ratate 12: (rate you Cet coe to i aal etea an ta ao ogoe tovioein doc-comment for clas,lock amthing (XoL)"PodswiothAcceot allKtwodeurlaime"eiireht4 spag...
|
85490
|
NULL
|
NULL
|
NULL
|
|
85491
|
2930
|
3
|
2026-05-28T12:41:35.577957+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972095577_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-1678849104122188672
|
593894980799643872
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKER881DEV (docker)₴82-zshN3screenpipe"O ₴4-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec -itdocker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85ec2-user@ip-10-30-129-...100% <78• Thu 28 May 15:41:351₴1ec2-user@ip-10-30-140-...₴7...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85490
|
2931
|
3
|
2026-05-28T12:41:07.935114+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972067935_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5714658179048184897
|
-8634297297851446848
|
visual_change
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
rapstomFV faVsco.s ~o-t2t2t ml-snota.proidetv Salestorg>MFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"• 5 ServiceTraitsClientTest.phoDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phsQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.phoTAQYc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. pho@ CachedCrmSenvice Dacor 212 €@i FmailHelnerTest.ohoC FadV. tacouererte© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortunitSwneStrateovt, 25Prosnacteachetast mhoC ProspectSearchStrategyF:2 ProviderRecistryTest.phpRacoriSalactorTast oho2 pasolvcComosnyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrndsha Kioskwiewar>DActions>& Office› Ea Resolvers>&a Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTest© InboxServiceTest.php@ TeytRelavSerdiceTest.obd>M MeetinaGeneraton>M Notification26%.268©ActivityControlier.phpcustom.loglaravel.logA SF fiminny@localhost)& console (PROD) XOAeindi.onecassexkela seru ches excnos lestwastA console (STAGING)D0000AND a.created_at > DATE_SUB(NOW), INTERVAL 38 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numben781ORDER BY sns_count DESC:public function testisForcurrentenvironnentasthHatchingX6n0riginalToHeader(string SdepLoyRegion, string 782#[DataProvider('environmentProvider')public function testisForcurrentenvironnent#_thNonMatchingX6n0riginalToHeader(string SdeployRegion, ste 7e5public function testisForcurrentenvironnent.gnoresToMeader: voidt....public function testisForCurrentenvironnent@zthEnptyHeaders: voidt...,public function testisForCurrentenvironnent#ithexception: voidi...public function testSyncUsesUsALiasForUsRegion: voidi...;Reject727public function testGetHistorywithPaginationO: voidConfio:-set("iiminny. googie text user'.Confioesset("iininny google text relay topic', 'test-topic'):SonailSenyiice = Sthis-screateMockd oridShistonyResponset = Sthis-screateMockd1600gLe (Service \Gmail \ListHistoryResponse::=l 720722723724725727cerhistory"->waeRecunn dno"octKextPaocToken")-swillPetunnG valud16oogLe \Service \G6mail\ListHistoryResponse::.l73)730=732'getHistory")->willReturn(0):"aetkext Paoclloken"->wr? Petunnl values nubolCuconeHsetonu Whieasanostolaahlone mieieetiaSuconcHfctonv.snothodt constr16009Le|Service\Gmai1|Resource\UsersHistory:=clas: 736"UistUsersHistory')->willReturn0nConsecutiveCalls(ShistoryResponse1, ShistoryResponse2):738Cache::shouldReceive("get')-swith(argsCache::shouldReceive("put')->with(_args: "test-topic'\Cache::shouldReceive("put')->with(_args: "test-topic'748\Mockery::on(fn (Sexpires) => Sexpicr 742Nockery: :on(fn (Sexpires) => Sexpir 745Sresult = Sservice->getHistory(SgnailService)+ 1of2 editsv Accept Fle x-wthtosoeehntTeAnrou/Sanone)y oin fihdwhselect * fron teans where id = 1select * fron roles.SELECTCONCAT(u.id, CASE WHEN u.id = t.ouner_id THEN ' (ouner)' ELSE "* END) AS user_id,sa.*,Touner1o Froy social accounts s.JOIN teans ti.ne-si: on tod e u.teanoWHERE V.tean_id = 1117 and sa.provider = 'hubspot':SELECT * FROM actavitles WHERE uufd to bin(+[CREDIT_CARD]-[CREDIT_CARD]') = uuld: # 79933459 YESselect * fron crm_fields where id = 659242)select * fron cra_field_values where crn_field_id = 659242;SELECT * FROM crn_field_data fd# JOIN crn. fields f ON fd.crm field id = f.io# JOIN activities a ON fd.activity id = a.idWHERE activity_id = 79933459= AND f.crn_provider id = 'hs activity type':select * fron text relavs where created at > :2826-85-81*:select * fron actavitles where usen id IN (7168, 18688) and created at > 12026-05-22' order by id desciMer" tron usenswhere tean id = 1 and $id TN (18688, 13934, 7160):select * fron actavitsles where usen 1d = 7168 order by id desc tinit 10.select * fron accounts whereselect * fron users where name Like "XSubrax'; # 31854, 1117select * fron ceanswherdsde147actávity scarches nhere usen $d = 31054:y seanchittens where nctyity seanch.idoi 188882, 88982)# console fiaum045 A1 A41 У 66 4TO0У L7Thu 28 May 15:41:07axineainealieir+0.зевекоpunas/phpunac/sre/rго скогкуноскоо) ссклоспегасог/носкe toss • pпp:swub de tunccion cencrarcet srein14 (icaats exie (ssscoe):ockNane, false)) ‹TextRelayServiceTest.php+20 -8Thought for 3+0-7Read TextRelayService.php #L25-74TextRelayServiceTest.phpTextRelayServiceTest.phcO docker exec docker lanon oho artacian test ettlter Tex Relavservice estCcincatad 184 14nacsresacdtcesoutoskladoc-coemeeeofor RecholentServiceTestestestGetJedouto test oode tocils hetceputesMetadata found in doc-comment for nethodTestelUnit|Seruices|Meet/noGenerator/GoooleMoetMeet1noProwfderTest/stostHasRoaufredScooohTexRelnyScrvicatest.obdO docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestlock amthing (XoL)")Hode swioth60Accept allKtwodeurlaime"eiireht4 spad...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85488
|
2930
|
2
|
2026-05-28T12:41:05.270596+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972065270_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Symfony\Component\HttpKernel\Exception\HttpException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.041666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Symfony\\Component\\HttpKernel\\Exception\\HttpException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Symfony\\Component\\HttpKernel\\Exception\\HttpException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
124444496193625784
|
-798154910282368122
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Symfony\Component\HttpKernel\Exception\HttpException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground...
|
85486
|
NULL
|
NULL
|
NULL
|
|
85489
|
2931
|
2
|
2026-05-28T12:41:04.795545+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972064795_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
8043719072324535154
|
-8628527368849355612
|
visual_change
|
hybrid
|
NULL
|
Project: faVsco.js, menu
rapstomFV faVsco.|s ~o-t2 Project: faVsco.js, menu
rapstomFV faVsco.|s ~o-t2t2t ml-snota.proidetv Salestorg>MFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"• 5 ServiceTraitsClientTest.phoDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phsQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.phoTAQYc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. pho@ CachedCrmSenvice Dacor 212 €@ FmailHelnerTest.ohdC FleldVetueConverterTest., 24%© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortunitSwneStrateovt, 25Prosnacteachatast mhoC ProspectSearchStrategyF:2 ProviderRecistryTest.phpRacoriSalnctortast nhe2 pasolvcComosnyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrndsha Kioskwiewar>DActions>& Office› Ea Resolvers>&a Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTest© InboxServiceTest.php@ TeytRelavSerdiceTest.obd>M MeetinaGeneraton>M Notification26%.268©ActivityControlier.phpcustom.loglaravel.logA SF fiminny@localhost)& console (PROD) XOAeindi.onecassexkela seru ches excnos lestwastA console (STAGING)D0000AND a.created_at > DATE_SUB(NOW), INTERVAL 38 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numben781ORDER BY sns_count DESC:public function testisForcurrentenvironnentasthHatchingX6n0riginalToHeader(string SdepLoyRegion, string 782#[DataProvider('environmentProvider')public function testisForcurrentenvironnent#_thNonMatchingX6n0riginalToHeader(string SdeployRegion, ste 7e5public function testisForcurrentenvironnent.gnoresToMeader: voidt....public function testisForCurrentenvironnent@zthEnptyHeaders: voidt...,public function testisForCurrentenvironnent#ithexception: void...public function testSyncUsesUsALiasForUsRegion: voidi...;Reject727public function testGetHistorywithPaginationO: voidConfio:-set("iiminny. googie text user'.Confio:sset(iininny google text relay topic', 'test-topic'):SonailSenyiice = Sthis-screateMockd oridShistonyResponset = Sthis-screateMockd1600gLe (Service \Gmail \ListHistoryResponse::=l 720722723724725727cerhistory"->waeRecunn dno"octKextPaocToken")-swillPetunnG valud16oogLe \Service \G6mail\ListHistoryResponse::.l73)730=732'getHistory")->willReturn(0):"aetkext Paoclloken"->wr? Petunnl values nubolCuconeHsetonu Whieasanostolaahlone mieieetiaSuconcHfctonv.snothodt constr16009Le|Service\Gmai1|Resource\UsersHistory:=clas: 736"UistUsersHistory')->willReturn0nConsecutiveCalls(ShistoryResponse1, ShistoryResponse2):738Cache::shouldReceive("get')-swith(argsCache::shouldReceive("put')->with( _args: "test-topic'\Cache::shouldReceive("put')->with(_args: "test-topic'748\Mockery::on(fn (Sexpires) => Sexpicr 742Nockery: :on(fn (Sexpires) => Sexpir 745Sresult = Sservice->getHistory(SqnailService)+ 1of2 editsv Accept Fle x-wthtosoeehntTeAnrou/Sanone)y oin fihdwhselect * fron teans where id = 1select * fron roles.SELECTCONCAT(u.id, CASE WHEN u.id = t.ouner_id THEN ' (ouner)' ELSE "* END) AS user_id,sa.*,Touner1o Froy social accounts saJOIN teans ti.ne-sl: on tod = u.teanoWHERE V.tean_id = 1117 and sa.provider = 'hubspot':SELECT * FROM actavitles WHERE uufd to bin(+[CREDIT_CARD]-[CREDIT_CARD]') = uuld: # 79933459 YESselect * fron crm_fields where id = 659242)select * fron cra_field_values where crn_field_id = 659242;SELECT * FROM crn_field_data fd# JOIN crn. fields f ON fd.crm field id = f.io# JOIN activities a ON fd.activity id = a.idWHERE activity_id = 79933459= AND f.crn_provider id = 'hs activity type':select * fron text relavs where created at > :2826-85-81*:select * fron actavitles where usen id IN (7168, 18688) and created at > 12026-05-22' order by id desciMer" tron usenswhere tean id = 1 and $id TN (18688, 13934, 7160):select * fron actavitsles where usen 1d = 7168 order by id desc tinit 10.select * fron accounts whereselect * fron users where name Like "XSubrax'; # 31854, 1117select * fron ceanswherdsde147actávity scarches nhere usen $d = 31054:y seanchittens where nctyity seanch.idoi 188882, 88982)# console fiaumOaainaanewiein045 A1 A41 У 66 4nyicteltthie-wearithes.esTextRelayServicorest.phgTO0У L7Thu 28 May 15:41:04+0.+20 -+10-12+6-1• docker exec docker Lamp1 php artisan test =tilter Textrelayserviceresttaint tad 1RalnAeNetadata in dobe supported in PHPUnit 12. Update your test code to use attributes instead.Metadata found in doc-comment for nethodtinProvidertesO docker axer docker lano nhn Artican toct -f4lter TeriRAlaCAricaTaslock amthing (XoL)"PodswiothPun ta GhinAcceot allKowodeu Taimeehi.%t4 spad...
|
85487
|
NULL
|
NULL
|
NULL
|
|
85487
|
2931
|
1
|
2026-05-28T12:41:02.161911+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972062161_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
rapstomFV faVsco.|s ~o-t2t2t ml-snota.Proinet vv S rapstomFV faVsco.|s ~o-t2t2t ml-snota.Proinet vv Salestorg>MFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"• 5 ServiceTraitsClientTest.phoDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phsQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.phoTAQYc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. pho@ CachedCrmSenvice Dacor 212 €@ FmailHelnerTest.ohdC FleldVetueConverterTest., 24%© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortunitSwneStrateovt, 25Prosnacteachetast mhoC ProspectSearchStrategyF:2 ProviderRecistryTest.phpRacoriSalactorTast oho2 pasolucComoanyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrndsha Kioskwiewar>DActions>& Office› Ea Resolvers>&a Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTest© InboxServiceTest.php@ TeytRelavSerdceTest.ohol>M MeetinaGeneraton>M Notification26%.268TO0У L7Inu cowoy 1o41.u+0.©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) XOAeindi.onecassexkela seru ches excnos lestwastA console (STAGING)D0000AND a.created_at > DATE_SUB(NOW), INTERVAL 38 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numben781ORDER BY sns_count DESC:public function testisForcurrentenvironnentasthHatchingX6n0riginalToHeader(string SdepLoyRegion, string 782#[DataProvider('environmentProvider').public function testisForcurrentenvironnent#_thNonMatchingX6n0riginalToHeader(string SdeployRegion, ste 7e5public function testisForcurrentenvironnent.gnoresToMeader: voidt....public function testisForCurrentenvironnent@zthEnptyHeaders: voidt...,public function testisForCurrentenvironnent#ithexception: voidi...public function testSyncUsesUsALiasForUsRegion: voidi...;Reject727public function testGetHistorywithPaginationO: voidConfio:-set("iiminny. googie text user'.Confio:sset(iininny google text relay topic', 'test-topic'):SonailSenyiice = Sthis-screateMockd oridShistonyResponset = Sthis-screateMockd1600gLe (Service \Gmail \ListHistoryResponse::=l 720722723724725727cerhistory"->waeRecunn dno"octKextPaocToken")-swillPetunnG valud16oogLe \Service \G6mail\ListHistoryResponse::.l73)730=732'getHistory")->willReturn(0):"aetkext Paoclloken"->wr? Petunnl values nubolCuconeHsetonu Whieasanostolaahlone mieieetiaSuconcHfctonv.snothodt constr16009Le|Service\Gmai1|Resource\UsersHistory:=clas: 736"UistUsersHistory')->willReturn0nConsecutiveCalls(ShistoryResponse1, ShistoryResponse2):738Cache::shouldReceive("get')-swith(argsCache::shouldReceive("put')->with(_args: "test-topic'\Cache::shouldReceive("put')->with(_args: "test-topic'748\Mockery::on(fn (Sexpires) => Sexpicr 742Nockery: :on(fn (Sexpires) => Sexpir 745Sresult = Sservice->getHistory(SgnailService)+ 1of2 editsv Accept Fle x-wthtosoeehntTeAnrou/Sanone)y oin fihdwhselect * fron teans where id = 1select * fron roles.SELECTCONCAT(u.id, CASE WHEN u.id = t.ouner_id THEN ' (ouner)' ELSE "* END) AS user_id,sa.*,Touner1o Froy social accounts s.JOIN teans ti.ne-sl: on tod = u.teanoWHERE V.tean_id = 1117 and sa.provider = 'hubspot':SELECT * FROM actavitles WHERE uufd to bin(+[CREDIT_CARD]-[CREDIT_CARD]') = uuld: # 79933459 YESselect * fron crm_fields where id = 659242)select * fron cra_field_values where crn_field_id = 659242;SELECT * FROM crn_field_data fd# JOIN crn. fields f ON fd.crm field id = f.io# JOIN activities a ON fd.activity id = a.idWHERE activity_id = 79933459=AND f.crn_provider_id = 'hs activity type':select * fron text relavs where created at > :2826-85-81*:select * fron actavitles where usen id IN (7168, 18688) and created at > 12026-05-22' order by id desciMer" tron usenswhere tean id = 1 and $id TN (18688, 13934, 7160):select * fron actavitsles where usen 1d = 7168 order by id desc tinit 10.select * fron accounts whereselect * fron users where name Like "XSubrax'; # 31854, 1117select * fron ceanswherdsde147actávity scarches nhere usen $d = 31054:y seanchittens where nctyity seanch.idoi 188882, 88982)# console fiaum8458185Y00U dockeh exec docker lonpe ono areson test etalter lexkelaysericelesctruncated 447 l1nessvendor/phpunit/phpunit/src/Franework/Mock0bject/Generator/MockClass.php:52whtse function cenerateo): stringociaae takelTextRelayServicerest.php+20 -8Tnougnttor ssTIU-IRoad TextRolavService.obn #125-7extRe husemvicatest.ohTextRelayServicetest.phpo docker exec dockerlanpn php arcisan vest ezlter Texckelayserviceresctnuncated 184inessMetadata found in doc-comment for methodsed and ilyno pongesTO MA Metadata found in doc-comment for pethodtinoProviderTest::testlasBroutredScopoMSearched tunc ion noon unless in shiminnuaodTextRclayServiccrest.phglock amthing (XoL)")Hode swiothAccept allKowodeu Taimeehi.%t4 spad...
|
NULL
|
121256164630716868
|
NULL
|
idle
|
ocr
|
NULL
|
rapstomFV faVsco.|s ~o-t2t2t ml-snota.Proinet vv S rapstomFV faVsco.|s ~o-t2t2t ml-snota.Proinet vv Salestorg>MFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"• 5 ServiceTraitsClientTest.phoDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phsQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.phoTAQYc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. pho@ CachedCrmSenvice Dacor 212 €@ FmailHelnerTest.ohdC FleldVetueConverterTest., 24%© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortunitSwneStrateovt, 25Prosnacteachetast mhoC ProspectSearchStrategyF:2 ProviderRecistryTest.phpRacoriSalactorTast oho2 pasolucComoanyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrndsha Kioskwiewar>DActions>& Office› Ea Resolvers>&a Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTest© InboxServiceTest.php@ TeytRelavSerdceTest.ohol>M MeetinaGeneraton>M Notification26%.268TO0У L7Inu cowoy 1o41.u+0.©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) XOAeindi.onecassexkela seru ches excnos lestwastA console (STAGING)D0000AND a.created_at > DATE_SUB(NOW), INTERVAL 38 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numben781ORDER BY sns_count DESC:public function testisForcurrentenvironnentasthHatchingX6n0riginalToHeader(string SdepLoyRegion, string 782#[DataProvider('environmentProvider').public function testisForcurrentenvironnent#_thNonMatchingX6n0riginalToHeader(string SdeployRegion, ste 7e5public function testisForcurrentenvironnent.gnoresToMeader: voidt....public function testisForCurrentenvironnent@zthEnptyHeaders: voidt...,public function testisForCurrentenvironnent#ithexception: voidi...public function testSyncUsesUsALiasForUsRegion: voidi...;Reject727public function testGetHistorywithPaginationO: voidConfio:-set("iiminny. googie text user'.Confio:sset(iininny google text relay topic', 'test-topic'):SonailSenyiice = Sthis-screateMockd oridShistonyResponset = Sthis-screateMockd1600gLe (Service \Gmail \ListHistoryResponse::=l 720722723724725727cerhistory"->waeRecunn dno"octKextPaocToken")-swillPetunnG valud16oogLe \Service \G6mail\ListHistoryResponse::.l73)730=732'getHistory")->willReturn(0):"aetkext Paoclloken"->wr? Petunnl values nubolCuconeHsetonu Whieasanostolaahlone mieieetiaSuconcHfctonv.snothodt constr16009Le|Service\Gmai1|Resource\UsersHistory:=clas: 736"UistUsersHistory')->willReturn0nConsecutiveCalls(ShistoryResponse1, ShistoryResponse2):738Cache::shouldReceive("get')-swith(argsCache::shouldReceive("put')->with(_args: "test-topic'\Cache::shouldReceive("put')->with(_args: "test-topic'748\Mockery::on(fn (Sexpires) => Sexpicr 742Nockery: :on(fn (Sexpires) => Sexpir 745Sresult = Sservice->getHistory(SgnailService)+ 1of2 editsv Accept Fle x-wthtosoeehntTeAnrou/Sanone)y oin fihdwhselect * fron teans where id = 1select * fron roles.SELECTCONCAT(u.id, CASE WHEN u.id = t.ouner_id THEN ' (ouner)' ELSE "* END) AS user_id,sa.*,Touner1o Froy social accounts s.JOIN teans ti.ne-sl: on tod = u.teanoWHERE V.tean_id = 1117 and sa.provider = 'hubspot':SELECT * FROM actavitles WHERE uufd to bin(+[CREDIT_CARD]-[CREDIT_CARD]') = uuld: # 79933459 YESselect * fron crm_fields where id = 659242)select * fron cra_field_values where crn_field_id = 659242;SELECT * FROM crn_field_data fd# JOIN crn. fields f ON fd.crm field id = f.io# JOIN activities a ON fd.activity id = a.idWHERE activity_id = 79933459=AND f.crn_provider_id = 'hs activity type':select * fron text relavs where created at > :2826-85-81*:select * fron actavitles where usen id IN (7168, 18688) and created at > 12026-05-22' order by id desciMer" tron usenswhere tean id = 1 and $id TN (18688, 13934, 7160):select * fron actavitsles where usen 1d = 7168 order by id desc tinit 10.select * fron accounts whereselect * fron users where name Like "XSubrax'; # 31854, 1117select * fron ceanswherdsde147actávity scarches nhere usen $d = 31054:y seanchittens where nctyity seanch.idoi 188882, 88982)# console fiaum8458185Y00U dockeh exec docker lonpe ono areson test etalter lexkelaysericelesctruncated 447 l1nessvendor/phpunit/phpunit/src/Franework/Mock0bject/Generator/MockClass.php:52whtse function cenerateo): stringociaae takelTextRelayServicerest.php+20 -8Tnougnttor ssTIU-IRoad TextRolavService.obn #125-7extRe husemvicatest.ohTextRelayServicetest.phpo docker exec dockerlanpn php arcisan vest ezlter Texckelayserviceresctnuncated 184inessMetadata found in doc-comment for methodsed and ilyno pongesTO MA Metadata found in doc-comment for pethodtinoProviderTest::testlasBroutredScopoMSearched tunc ion noon unless in shiminnuaodTextRclayServiccrest.phglock amthing (XoL)")Hode swiothAccept allKowodeu Taimeehi.%t4 spad...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85486
|
2930
|
1
|
2026-05-28T12:40:54.644428+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972054644_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.041666668,"height":0.02111111},"on_screen":false,"role_description":"text"}]...
|
-8259427379480554577
|
-7551141163203049024
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"O ₴4-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec -itdocker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85100% <78• Thu 28 May 15:40:54L81ec2-user@ip-10-30-129-...ec2-user@ip-10-30-140-...₴7...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85485
|
2931
|
0
|
2026-05-28T12:40:29.424019+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972029424_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4899909956188268022
|
-8629512240427235104
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
rapstomFV faVsco.|s ~o-t2t2t ml-snota.Proinet vv Salestorg>MFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"# ServiceTraitsClientTest.phoDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phgQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.phoTAQYc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. pho@ CachedCrmSenvice Dacor 212 €@ FmailHelnerTest.ohdC FleldVetueConverterTest., 24%© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortunitSwneStrateovt, 25Prosnacteachatast mhoC ProspectSearchStrategyF:2 ProviderRecistryTest.phpRacoriSalnctortast nhe2 pasolucComoanyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrndsha Kioskwiewar>DActions>& Office› Ea Resolvers>&a Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTest© InboxServiceTest.php@ TeytRelavSerdceTest.ohol>M MeetinaGeneraton>M Notification26%.268©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) XOAeindi.onecassexkela seru ches excnos lestwastA console (STAGING)D0000AND a.created_at > DATE_SUB(NOW), INTERVAL 38 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numben781ORDER BY sns_count DESC:public function testisForcurrentenvironnentasthHatchingX6n0riginalToHeader(string SdepLoyRegion, string 782#[DataProvider('environmentProvider')public function testisForcurrentenvironnent#_thNonMatchingX6n0riginalToHeader(string SdeployRegion, ste 7e5public function testisForcurrentenvironnent.gnoresToHeader: voidt....public function testisForCurrentenvironnent@ithEnptyHeaders: voidt...,public function testisForCurrentenvironnent#ithexception: void...public function testSyncUsesUsALiasForUsRegion: voidi...;Reject727public function testGetHistorywithPaginationO: voidConfio:-set("iiminny. googie text user'.Confioesset("iininny google text relay topic', 'test-topic'):SonailSenyiice = Sthis-screateMockd oridShistonyResponset = Sthis-screateMockd1600gLe (Service \Gmail \ListHistoryResponse::=l 720722723724725727cerhistory"->waeRecunn dno"octKextPaocToken")->willPetunnG valud16oogLe \Service \G6mail\ListHistoryResponse::.l73)730=732'getHistory")->willReturn(0):"aetkext Paoclloken"->wr? Petunnl values nuboluconelsetanu Whieasanostolanhlone meitetaSuconcHfctonv.snothodt constr16009Le|Service\Gmai1|Resource\UsersHistory:=clas: 736"UistUsersHistory')->willReturn0nConsecutiveCalls(ShistoryResponse1, ShistoryResponse2):738Cache::shouldReceive("get')-swith(argsCache::shouldReceive("put')->with( _args: "test-topic'Cache::shouldReceive("put')->with(_args: "test-topic"748\Mockery::on(fn (Sexpires) => Sexpicr 742Nockery: :on(fn (Sexpires) => Sexpir 745Sresult = Sservice->getHistory(SgnailService)+ 1of2 editsv Accept Fle x-wthtosoeehntTeAnrou/Sanone)y oin fihdwhselect * fron teans where id = 1select * fron roles.SELECTCONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (ouner)' ELSE "* END) AS user_id.sa.*,Touner1o Froy social accounts saJOIN teans ti.ne-si: on tod e u.teanoWHERE V.tean_id = 1117 and sa.provider = 'hubspot':SELECT * FROM actavitles WHERE uufd to bin(+[CREDIT_CARD]-[CREDIT_CARD]') = uuld: # 79933459 YESselect * fron crm_fields where id = 659242)select * fron cra_field_values where crn_field_id = 659242;SELECT * FROM crn_field_data fd# JOIN crn. fields f ON fd.crm field id = f.io# JOIN activities a ON fd.activity id = a.idWHERE activity_id = 79933459= AND f.crn_provider id = 'hs activity type':select * fron text relavs where created at > :2826-85-81*:select * fron actavitles where usen id IN (7168, 18688) and created at > 12026-05-22' order by id desciMer" tron usenswhere tean id = 1 and $id TN (18688, 13934, 7160):select * fron actavitsles where usen 1d = 7168 order by id desc 1init 10.select * fron accounts whereselect * fron users where name Like "XSubrax'; # 31854, 1117select * fron ceanswherdsde147actávity scarches nhere usen $d = 31054:y seanchittens whers nctivity sennch_1doiN 188882 889822# console fiaum045 A1 A41 У 66 4TO0У L7Thu 28 May 15:40:28+0.+58 -4test code to use attributes insteadTextRelayServicotest.ohg• docker exec docker lamp 1 php artisan test -filter TextRelayServicerestctruncated 447 l1nesz3986691ndor/phpuntt/phpunit/src/Franework/Mock0bject/Generator/Mockclass-php:5;public function generate(): stringeocknase tale)TextRelayServiceTest.phpThouaht for 2eTextRelayServiceTest.php420-+10 -13a) TextRelayServica est.one.0 docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestAparta e ratate 12, (rate you ot ce o u aa eta arta a ongre dovloein doc-commenttor casit oeprecatit andityse no ongte De iueporte lk TreBatt Test, Mete you te soc-Ask anything Xol")Hode swiothAccept allKtwodeurlaime"eiireht4 spad...
|
85481
|
NULL
|
NULL
|
NULL
|
|
85484
|
2930
|
0
|
2026-05-28T12:40:23.319770+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779972023319_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5491484594888514086
|
-7050964252790406720
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"O ₴4-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec -itdocker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85100% <78• Thu 28 May 15:40:22L81ec2-user@ip-10-30-129-...ec2-user@ip-10-30-140-...₴7...
|
85482
|
NULL
|
NULL
|
NULL
|
|
85483
|
NULL
|
0
|
2026-05-28T12:39:54.926377+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971994926_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5599254006743683834
|
-7050965352302034496
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
rapstomFV faVsco.|s ~o-t2t2t ml-snota.Proinet vv Salestorg>MFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"• 5 ServiceTraitsClientTest.phoDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phsQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.phoTAQYc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. pho@ CachedCrmSenvice Dacor 212 €@ FmailHelnerTest.ohdC FleldVetueConverterTest., 24%© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortunitSwneStrateovt, 25Prosnacteachatast mhoC ProspectSearchStrategyF:2 ProviderRecistryTest.phpRacoriSalnctortast nhe2 pasolvcComosnyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrndsha Kioskwiewar>DActions>& Office› Ea Resolvers>&a Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTest© InboxServiceTest.php@ TeytRelavSerdiceTest.obd>M MeetinaGeneraton>M Notification26%.268©ActivityControlier.php=custom.loglaravel.logA SF fiminny@localhost)& console (PROD) XOAeindi.onecassexkela seru ches excnos lestwastA console (STAGING)D0000AND a.created_at > DATE_SUB(NOW), INTERVAL 38 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numben781ORDER BY sns_count DESC:public function testisForcurrentenvironnentasthHatchingX6n0riginalToHeader(string SdepLoyRegion, string 782#[DataProvider('environmentProvider')public function testisForcurrentenvironnent#_thNonMatchingX6n0riginalToHeader(string SdeployRegion, ste 7e5public function testisForcurrentenvironnent.gnoresToHeader: voidt....public function testisForCurrentenvironnent@ithEnptyHeaders: voidt...,public function testisForCurrentenvironnent#ithexception: void...public function testSyncUsesUsALiasForUsRegion: voidi...;Reject727public function testGetHistorywithPaginationO: voidConfio:-set("iiminny. googie text user'.Confio:sset(iininny google text relay topic', 'test-topic'):SonailSenyiice = Sthis-screateMockd oridShistonyResponset = Sthis-screateMockd1600gLe (Service \Gmail \ListHistoryResponse::=l 720722723724725727cerhistory"->waeRecunn dno"octKextPaocToken")->willPetunnG valud16oogLe \Service \G6mail\ListHistoryResponse::.l73)730=732'getHistory")->willReturn(0):"aetkext Paoclloken"->wr? Petunnl values nuboluconelsetanu Whieasanostolanhlone meitetaSuconcHfctonv.snothodt constr16009Le|Service\Gmai1|Resource\UsersHistory:=clas: 736"UistUsersHistory')->willReturn0nConsecutiveCalls(ShistoryResponse1, ShistoryResponse2):738Cache::shouldReceive("get')-swith(argsCache::shouldReceive("put')->with( _args: "test-topic'Cache::shouldReceive("put')->with(_args: "test-topic"748\Mockery::on(fn (Sexpires) => Sexpicr 742Nockery: :on(fn (Sexpires) => Sexpir 745Sresult = Sservice->getHistory(SgnailService)+ 1of2 editsv Accept Fle x-wthtosoeehntTeAnrou/Sanone)y oin fihdwhselect * fron teans where id = 1select * fron roles.SELECTCONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (ouner)' ELSE "* END) AS user_id.sa.*,Touner1o Froy social accounts saJOIN teans ti.ne-si: on tod e u.teanoWHERE V.tean_id = 1117 and sa.provider = 'hubspot':SELECT * FROM actavitles WHERE uufd to bin(+[CREDIT_CARD]-[CREDIT_CARD]') = uuld: # 79933459 YESselect * fron crm_fields where id = 659242)select * fron cra_field_values where crn_field_id = 659242;SELECT * FROM crn_field_data fd# JOIN crn. fields f ON fd.crm field id = f.io# JOIN activities a ON fd.activity id = a.idWHERE activity_id = 79933459= AND f.crn_provider id = 'hs activity type':select * fron text relavs where created at > :2826-85-81*:select * fron actavitles where usen id IN (7168, 18688) and created at > 12026-05-22' order by id desciMer" tron usenswhere tean id = 1 and $id TN (18688, 13934, 7160):select * fron actavitsles where usen 1d = 7168 order by id desc 1init 10.select * fron accounts whereselect * fron users where name Like "XSubrax'; # 31854, 1117select * fron ceanswherdsde147actávity scarches nhere usen $d = 31054:y seanchittens whers nctivity sennch_1doiN 188882 889822# console fiaum045 A1 A41 У 66 4TO0У L7Thu 28 May 15:39:54+0.+58 -4test code to use attributes insteadTextRelayServicotest.ohg• docker exec docker lamp 1 php artisan test -filter TextRelayServicerestctruncated 447 l1nesz3986691ndor/phpuntt/phpunit/src/Franework/Mock0bject/Generator/Mockclass-php:5;public function generate(): stringsockNase tale)TextRelayServiceTest.phpThouaht for 2eTextRelayServiceTest.php420-+10 -13a) TextRelayServica est.one.0 docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestAarta i ratate 12, (rata you ot ce o u aa eta arta a ongor covloein doc-commenttor casCerinpportt IkTineBnttoTes t. Mete you te dec-Accept alllock amthing (XoL)")Hode swiothKtwodeurlaime"eiireht4 spad...
|
85481
|
NULL
|
NULL
|
NULL
|
|
85482
|
NULL
|
0
|
2026-05-28T12:39:50.547682+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971990547_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
8043719072324535154
|
-8628527368849355612
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
iTerm2• • 0ShellEditVie Project: faVsco.js, menu
iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"app/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php884348-zsh+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976+++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec -itdocker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85100% <78• Thu 28 May 15:39:50L81ec2-user@ip-10-30-129-...ec2-user@ip-10-30-140-...₴7...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85481
|
2929
|
11
|
2026-05-28T12:39:22.618726+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971962618_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-5599254006743683834
|
-7050965352302034496
|
visual_change
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
rapstomFV faVsco.|s ~o-t2t2t ml-snota.Proinet vv Salestorg>MFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"# ServiceTraitsClientTest.phpDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phgQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.phoTAQYc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. pho@ CachedCrmSenvice Dacor 212 €@i FmailHelnerTest.ohoC FadV. tacouererte© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortunitSwneStrateovt, 25,Prosnacteachatast mhoC ProspectSearchStrategyF:2 ProviderRecistryTest.phpRacoriSalactorTast oho2 pasolucComoanyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrndsha Kioskwiewar>DActions>& Office› Ea Resolvers>&a Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTest© InboxServiceTest.php@ TeytRelavSerdiceTest.obd>M MeetinaGeneraton>M Notification26%.268©ActivityControlier.phpcustom.loglaravel.logA SF fiminny@localhost)& console (PROD) XOAeindi.onecassexkela seru ches excnos lestwastA console (STAGING)D0000AND a.created_at > DATE_SUB(NOW), INTERVAL 38 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numben781ORDER BY sns_count DESC:public function testisForcurrentenvironnentasthHatchingX6n0riginalToHeader(string SdepLoyRegion, string 782#[DataProvider('environmentProvider')public function testisForcurrentenvironnent#_thNonMatchingX6n0riginalToHeader(string SdeployRegion, ste 7e5public function testisForcurrentenvironnent.gnoresToMeader: voidt....public function testisForCurrentenvironnent@ithEnptyHeaders: voidt...,public function testisForCurrentenvironnent#ithexception: voidi...public function testSyncUsesUsALiasForUsRegion: voidi...;Reject727public function testGetHistorywithPaginationO: voidConfio:-set("iiminny. googie text user'.Confioesset("iininny google text relay topic', 'test-topic'):SonailSenyiice = Sthis-screateMockd oridShistonyResponset = Sthis-screateMockd1600gLe (Service \Gmail \ListHistoryResponse::=l 720722723724725727cerhistory"->waeRecunn dno"octKextPaocToken")-swillPetunnG valud16oogLe \Service \G6mail\ListHistoryResponse::.l73)730=732'getHistory")->willReturn(0):"aetkext Paoclloken"->wr? Petunnl values nubolCuconeHsetonu Whieasanostolaahlone mieieetiaSuconcHfctonv.snothodt constr16009Le|Service\Gmai1|Resource\UsersHistory:=clas: 736"UistUsersHistory')->willReturn0nConsecutiveCalls(ShistoryResponse1, ShistoryResponse2):738Cache::shouldReceive("get')-swith(argsCache::shouldReceive("put')->with( _args: "test-topic'\Cache::shouldReceive("put')->with(_args: "test-topic'748\Mockery::on(fn (Sexpires) => Sexpicr 742Nockery: :on(fn (Sexpires) => Sexpir 745Sresult = Sservice->getHistory(SgnailService)+ 1of2 editsv Accept Fle x-wthtosoeehntTeAnrou/Sanone)y oin fihdwhselect * fron teans where id = 1select * fron roles.SELECTCONCAT(u.id, CASE WHEN u.id = t.ouner_id THEN ' (ouner)' ELSE "* END) AS user_id,sa.*,Touner1o Froy social accounts saJOIN teans ti.ne-sl: on tod = u.teanoWHERE V.tean_id = 1117 and sa.provider = 'hubspot':SELECT * FROM actavitles WHERE uufd to bin(+[CREDIT_CARD]-[CREDIT_CARD]') = uuld: # 79933459 YESselect * fron crm_fields where id = 659242)select * fron cra_field_values where crn_field_id = 659242;SELECT * FROM crn_field_data fd# JOIN crn. fields f ON fd.crm field id = f.io# JOIN activities a ON fd.activity id = a.idWHERE activity_id = 79933459=AND f.crn_provider_id = 'hs activity type':select * fron text relavs where created at > :2826-85-81*:select * fron actavitles where usen id IN (7168, 18688) and created at > 12026-05-22' order by id desciMer" tron usenswhere tean id = 1 and $id TN (18688, 13934, 7160):select * fron actavitsles where usen 1d = 7168 order by id desc tinit 10.select * fron accounts whereselect * fron users where name Like "XSubrax'; # 31854, 1117select * fron ceanswherdsde147actávity scarches nhere usen $d = 31054:y seanchittens where nctyity seanch.idoi 188882, 88982)# console fiaum045 A1 A41 У 66 4TO0У L7Thu 28 May 15:39:22+0.docker exec docker lano nl oho artacian test etiter TextRe lavservice est<truncated 210 lines>Testa PeaturedservicestTeandTeanoelete and ers|Churn|DeleteWonentsHandlerTest, Metadatain doc-coments is deprecated and wilt no longer be supported in PHPUnit 12. Update youTestaaturedservtousdeamdte-coeteteand.e/s/Churn|DeletePlaybackThenesHandlerTest:TextRelayServicetest.ohe458 -4kdocker exec docker lamp 1 php artisan test -filter TextRelayServicetestctruncated 447 Linesx3986691indor/phpunit/phpunit/src/Franework/MockObject/Generator/MockClass-php:S;public function generate(): stringayrelhuserichlast.ohr420-TextRelayServiceTest.php+10 -12alTextRelayService est.oneO docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestAsk anything Xol")Hode swioth00Accept allKowodeu Taimeehi.%t4 spad...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85480
|
2929
|
10
|
2026-05-28T12:39:18.129176+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971958129_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
rapstomFV faVsco.|s ~o-t2t2t ml-snota.proidetv Sal rapstomFV faVsco.|s ~o-t2t2t ml-snota.proidetv Salestorg>ImFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"• 5 ServiceTraitsClientTest.phpDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phgQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.phoTAQYc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. pho@ CachedCrmSenvice Dacor 212 €@ FmailHelnerTest.ohdC FleldVetueConverterTest., 24%© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortunitSwneStrateovt, 25,Prosnacteachetast mhoC ProspectSearchStrategyF:2 ProviderRecistryTest.phpRacoriSalactorTast oho2 pasolucComoanyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrndsha Kioskwiewar>DActions>& Office› Ea Resolvers>&a Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTest© InboxServiceTest.php@ TeytRelavSerdiceTest.obd>M MeetinaGeneraton>M Notification26%.2687o0sLX©ActivityControlier.phpcustom.loglaravel.logA SF fiminny@localhost)& console (PROD) XOAeindi.oneCass exkela seru chles exehos estastA console (STAGING)D0000AND a.created_at > DATE_SUB(NOW), INTERVAL 38 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numben781ORDER BY sns_count DESC:public function testisForcurrentenvironnentasthHatchingX6n0riginalToHeader(string SdepLoyRegion, string 782#[DataProvider('environmentProvider').public function testisForcurrentenvironnent#_thNonMatchingX6n0riginalToHeader(string SdeployRegion, ste 7e5public function testisForcurrentenvironnent.gnoresToMeader: voidt....public function testisForCurrentenvironnent@ithEnptyHeaders: voidt...,public function testisForCurrentenvironnent#ithexception: voidi...public function testSyncUsesUsALiasForUsRegion: voidi...;Reject727public function testGetHistorywithPaginationO: voidConfio:-set("iiminny. googie text user'.Confio:sset(iininny google text relay topic', 'test-topic'):SonailSenyiice = Sthis-screateMockd oridShistonyResponset = Sthis-screateMockd1600gLe (Service \Gmail \ListHistoryResponse::=l 720722723724725727cerhistory"->waeRecunn dno"octKextPaocToken")-swillPetunnG valud16oogLe \Service \G6mail\ListHistoryResponse::.l73)730=732'getHistory")->willReturn(0):"cetkext Paoe oken" ->wr? Petunnld values nukoCuconeHsetonu Whieasanostolaahlone mieieetiaSuconcHfctonv.snothodt constr16009Le|Service\Gmai1|Resource\UsersHistory:=clas: 736"UistUsersHistory')->willReturn0nConsecutiveCalls(ShistoryResponse1, ShistoryResponse2):738Cache::shouldReceive("get')-swith(argsCache::shouldReceive("put')->with( _args: "test-topic'Cache::shouldReceive("put')->with(_args: "test-topic"748\Mockery::on(fn (Sexpires) => Sexpicr 742Nockery: :on(fn (Sexpires) => Sexpir 745Sresult = Sservice->getHistory(SgnailService)+ 1of2 editsv Accept Fle x-wthtosoeehntTeAnrou/Sanone)y oin fihdwhselect * fron teans where id = 1select * fron roles.SELECTCONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (ouner)' ELSE "* END) AS user_id,sa.*,Touner1o Froy social accounts s.JOIN teans ti.ne-si: on tod e u.teanoWHERE V.tean_id = 1117 and sa.provider = 'hubspot':SELECT * FROM actavitles WHERE uufd to bin(+[CREDIT_CARD]-[CREDIT_CARD]') = uuld: # 79933459 YESselect * fron crm_fields where id = 659242)select * fron cra_field_values where crn_field_id = 659242;SELECT * FROM crn_field_data fd# JOIN crn. fields f ON fd.crm field id = f.io# JOIN activities a ON fd.activity id = a.idWHERE activity_id = 79933459= AND f.crn_provider id = 'hs activity type':select * fron text relavs where created at > :2826-85-81*:select * fron actavitles where usen id IN (7168, 18688) and created at > 12026-05-22' order by id desciMer" tron usenswhere tean id = 1 and $id TN (18688, 13934, 7160):select * fron actavitsles where usen 1d = 7168 order by id desc tinit 10.select * fron accounts whereselect * fron users where name Like "XSubrax'; # 31854, 1117select * fron ceanswherdsde147actávity scarches nhere usen $d = 31054:y seanchittens where nctyity seanch.idoi 188882, 88982)# console fiaum045 A1 A41 У 66 4TesTa teredser toust eande-contee tor clasgChumntveleter layoacklnereshand terlestThu 28 May 15:39:17+0.+58 -45ctnuncated 447 Binosxrk/Mock0bfect/Generator/MockClass.php: 5:ockName, false)) ‹+20 -8O docker axer docker lano nhn Artican toct -f4lter TeriRAlaCAricaTasAsk anything (%oL)")Hode swiothRunX+ SkipAcceot allKtwodeurlaime"eiireht4 spad...
|
NULL
|
-4188848827621938566
|
NULL
|
click
|
ocr
|
NULL
|
rapstomFV faVsco.|s ~o-t2t2t ml-snota.proidetv Sal rapstomFV faVsco.|s ~o-t2t2t ml-snota.proidetv Salestorg>ImFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"• 5 ServiceTraitsClientTest.phpDecorateActivityTest.pDeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameT@ PayloadBuilderTest.phgQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.phoTAQYc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic© BaseService Test. pho@ CachedCrmSenvice Dacor 212 €@ FmailHelnerTest.ohdC FleldVetueConverterTest., 24%© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortunitSwneStrateovt, 25,Prosnacteachetast mhoC ProspectSearchStrategyF:2 ProviderRecistryTest.phpRacoriSalactorTast oho2 pasolucComoanyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrndsha Kioskwiewar>DActions>& Office› Ea Resolvers>&a Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTest© InboxServiceTest.php@ TeytRelavSerdiceTest.obd>M MeetinaGeneraton>M Notification26%.2687o0sLX©ActivityControlier.phpcustom.loglaravel.logA SF fiminny@localhost)& console (PROD) XOAeindi.oneCass exkela seru chles exehos estastA console (STAGING)D0000AND a.created_at > DATE_SUB(NOW), INTERVAL 38 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numben781ORDER BY sns_count DESC:public function testisForcurrentenvironnentasthHatchingX6n0riginalToHeader(string SdepLoyRegion, string 782#[DataProvider('environmentProvider').public function testisForcurrentenvironnent#_thNonMatchingX6n0riginalToHeader(string SdeployRegion, ste 7e5public function testisForcurrentenvironnent.gnoresToMeader: voidt....public function testisForCurrentenvironnent@ithEnptyHeaders: voidt...,public function testisForCurrentenvironnent#ithexception: voidi...public function testSyncUsesUsALiasForUsRegion: voidi...;Reject727public function testGetHistorywithPaginationO: voidConfio:-set("iiminny. googie text user'.Confio:sset(iininny google text relay topic', 'test-topic'):SonailSenyiice = Sthis-screateMockd oridShistonyResponset = Sthis-screateMockd1600gLe (Service \Gmail \ListHistoryResponse::=l 720722723724725727cerhistory"->waeRecunn dno"octKextPaocToken")-swillPetunnG valud16oogLe \Service \G6mail\ListHistoryResponse::.l73)730=732'getHistory")->willReturn(0):"cetkext Paoe oken" ->wr? Petunnld values nukoCuconeHsetonu Whieasanostolaahlone mieieetiaSuconcHfctonv.snothodt constr16009Le|Service\Gmai1|Resource\UsersHistory:=clas: 736"UistUsersHistory')->willReturn0nConsecutiveCalls(ShistoryResponse1, ShistoryResponse2):738Cache::shouldReceive("get')-swith(argsCache::shouldReceive("put')->with( _args: "test-topic'Cache::shouldReceive("put')->with(_args: "test-topic"748\Mockery::on(fn (Sexpires) => Sexpicr 742Nockery: :on(fn (Sexpires) => Sexpir 745Sresult = Sservice->getHistory(SgnailService)+ 1of2 editsv Accept Fle x-wthtosoeehntTeAnrou/Sanone)y oin fihdwhselect * fron teans where id = 1select * fron roles.SELECTCONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (ouner)' ELSE "* END) AS user_id,sa.*,Touner1o Froy social accounts s.JOIN teans ti.ne-si: on tod e u.teanoWHERE V.tean_id = 1117 and sa.provider = 'hubspot':SELECT * FROM actavitles WHERE uufd to bin(+[CREDIT_CARD]-[CREDIT_CARD]') = uuld: # 79933459 YESselect * fron crm_fields where id = 659242)select * fron cra_field_values where crn_field_id = 659242;SELECT * FROM crn_field_data fd# JOIN crn. fields f ON fd.crm field id = f.io# JOIN activities a ON fd.activity id = a.idWHERE activity_id = 79933459= AND f.crn_provider id = 'hs activity type':select * fron text relavs where created at > :2826-85-81*:select * fron actavitles where usen id IN (7168, 18688) and created at > 12026-05-22' order by id desciMer" tron usenswhere tean id = 1 and $id TN (18688, 13934, 7160):select * fron actavitsles where usen 1d = 7168 order by id desc tinit 10.select * fron accounts whereselect * fron users where name Like "XSubrax'; # 31854, 1117select * fron ceanswherdsde147actávity scarches nhere usen $d = 31054:y seanchittens where nctyity seanch.idoi 188882, 88982)# console fiaum045 A1 A41 У 66 4TesTa teredser toust eande-contee tor clasgChumntveleter layoacklnereshand terlestThu 28 May 15:39:17+0.+58 -45ctnuncated 447 Binosxrk/Mock0bfect/Generator/MockClass.php: 5:ockName, false)) ‹+20 -8O docker axer docker lano nhn Artican toct -f4lter TeriRAlaCAricaTasAsk anything (%oL)")Hode swiothRunX+ SkipAcceot allKtwodeurlaime"eiireht4 spad...
|
85478
|
NULL
|
NULL
|
NULL
|
|
85479
|
2928
|
9
|
2026-05-28T12:39:18.026851+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971958026_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
1359069580965570500
|
1744564719952544192
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"app/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php-84348-zsh+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976+++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec-it docker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|X5ec2-user@ip-10-30-129-...100% <78• Thu 28 May 15:39:17181ec2-user@ip-10-30-140-...₴7...
|
85477
|
NULL
|
NULL
|
NULL
|
|
85478
|
2929
|
9
|
2026-05-28T12:39:16.436083+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971956436_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.019946808,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-3833227130500100475
|
-816168209280222298
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85477
|
2928
|
8
|
2026-05-28T12:39:16.319896+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971956319_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.041666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-8571759783874250499
|
-816168209280222298
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85476
|
2929
|
8
|
2026-05-28T12:38:49.625087+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971929625_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.019946808,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41589096,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.43550533,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.44414893,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.45279256,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.4637633,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.47473404,"top":0.09896249,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.5013298,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.51230055,"top":0.09896249,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.7237367,"top":0.09896249,"width":0.02825798,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"45","depth":4,"bounds":{"left":0.6938165,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.70611703,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"41","depth":4,"bounds":{"left":0.71542555,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"}]...
|
8022527347806293029
|
-798154910284465274
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41...
|
85474
|
NULL
|
NULL
|
NULL
|
|
85475
|
2928
|
7
|
2026-05-28T12:38:47.088587+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971927088_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41
66
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01';
and id IN (32415, 32416);
# and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
SELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses
FROM text_relays
WHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')
GROUP BY email_provider_id;
SELECT id, status, telephony_provider_id, created_at
FROM activities
WHERE id IN (80028719, 80028846);
SELECT id, status, code, email_sent_at, created_at, updated_at
FROM text_relays
WHERE id IN (32415, 32416);
SELECT id, status, code, sender, recipient, created_at
FROM text_relays
WHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'
ORDER BY created_at DESC
LIMIT 10;
SELECT id, uuid, status, code, sender, recipient, created_at, updated_at
FROM text_relays
WHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');
# [PASSWORD_DOTS]
SELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count
FROM users u
INNER JOIN activities a ON u.id = .user_id
WHERE a.type LIKE 'sms%'
AND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY u.id, u.email, u.name, u.softphone_number
ORDER BY sms_count DESC;
select * from teams where id = 1;
select * from roles;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1117 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES
SELECT * FROM activities WHERE uuid_to_bin('[CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NO
SELECT * FROM crm_configurations WHERE id = 1053;
SELECT * FROM teams WHERE id = 1117;
select * from users where id = 30249;
select * from playbooks where id = 5473;
select * from playbook_categories where id = 43783;
select * from playbook_categories where playbook_id = 5473;
select * from crm_fields where id = 659242;
select * from crm_field_values where crm_field_id = 659242;
SELECT * FROM crm_field_data fd
# JOIN crm_fields f ON fd.crm_field_id = f.id
# JOIN activities a ON fd.activity_id = a.id
WHERE activity_id = 79933459
# AND f.crm_provider_id = 'hs_activity_type';
SELECT * FROM activity_messages;
select * from text_relays where created_at > '2026-05-01';
select * from activities where user_id IN (7160, 18608) and created_at > '2026-...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.041666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"45","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"41","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"66","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01';\nand id IN (32415, 32416);\n# and id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436\n\nSELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses\nFROM text_relays\nWHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')\nGROUP BY email_provider_id;\nSELECT id, status, telephony_provider_id, created_at\nFROM activities\nWHERE id IN (80028719, 80028846);\nSELECT id, status, code, email_sent_at, created_at, updated_at\nFROM text_relays\nWHERE id IN (32415, 32416);\nSELECT id, status, code, sender, recipient, created_at\nFROM text_relays\nWHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'\nORDER BY created_at DESC\nLIMIT 10;\n\nSELECT id, uuid, status, code, sender, recipient, created_at, updated_at\nFROM text_relays\nWHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');\n\n# ***************\nSELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count\nFROM users u\nINNER JOIN activities a ON u.id = .user_id\nWHERE a.type LIKE 'sms%'\nAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)\nGROUP BY u.id, u.email, u.name, u.softphone_number\nORDER BY sms_count DESC;\n\nselect * from teams where id = 1;\n\nselect * from roles;\n\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1117 and sa.provider = 'hubspot';\nSELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES\nSELECT * FROM activities WHERE uuid_to_bin('25529043-8094-4781-927f-4f4da2a8185c') = uuid; # 80186192 NO\nSELECT * FROM crm_configurations WHERE id = 1053;\nSELECT * FROM teams WHERE id = 1117;\nselect * from users where id = 30249;\nselect * from playbooks where id = 5473;\nselect * from playbook_categories where id = 43783;\nselect * from playbook_categories where playbook_id = 5473;\nselect * from crm_fields where id = 659242;\nselect * from crm_field_values where crm_field_id = 659242;\n\nSELECT * FROM crm_field_data fd\n# JOIN crm_fields f ON fd.crm_field_id = f.id\n# JOIN activities a ON fd.activity_id = a.id\nWHERE activity_id = 79933459\n# AND f.crm_provider_id = 'hs_activity_type';\n\n\nSELECT * FROM activity_messages;\nselect * from text_relays where created_at > '2026-05-01';\nselect * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;\nselect * from users where team_id = 1 and id IN (18608, 13934, 7160);\nselect * from activities where user_id = 7160 order by id desc limit 10;\n\nselect * from accounts where team_id = 1 and name = 'Column5';\n\nselect * from users where name like '%Subra%'; # 31054, 1117\nselect * from teams where id = 1117;\nselect * from activity_searches where user_id = 31054;\nselect * from activity_search_filters where activity_search_id IN (88882, 88902);","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993\nSELECT * FROM users WHERE id = 25061;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 994;\nSELECT * FROM crm_profiles WHERE user_id = 25061;\n\nselect * from crm_configurations where id = 834;\nSELECT * FROM teams WHERE id = 882;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;\n\nSELECT * FROM contacts where crm_configuration_id = 834;\nSELECT * FROM opportunities WHERE team_id = 933\n# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');\nAND id IN (8482561,18352941,19042734,19232139,19445140,19472541);\nSELECT * FROM opportunity_contacts\nWHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 485; #\nSELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\nselect crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id\nwhere crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')\n# and l.converted_at IS NOT NULL\n;\n\n# ********************************************************************\nSELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')\nand opportunity_id IS NULL\norder by id desc;\n\nSELECT * FROM teams WHERE id = 604; # 598\nSELECT * FROM activities WHERE id = 74410828; # chelseaw@allvoices.co\nSELECT * FROM accounts WHERE id = 20068382;\nSELECT * FROM accounts WHERE id = 35186038;\n\nSELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 559 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;\nselect * from sidekick_settings where team_id = 781;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100\n\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 711;\nSELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL\nand is_internal = 0 and status = 'completed'\norder by id desc;\n\nSELECT * FROM crm_layout_entities\nWHERE crm_layout_id IN (2352, 2353);\n;\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 556 and sa.provider = 'hubspot';\n\nSELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;\nSELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;\nselect * from contacts\nwhere crm_configuration_id = 530\nand crm_provider_id = 872252;\n\nselect * from activities where crm_configuration_id = 530\nand user_id = 14343 and type like '%softphone%'\nand created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';\n\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya\nSELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);\n\n\nSELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t\nJOIN crm_configurations c ON t.id = c.team_id\nWHERE t.status = 'active';\n\nSELECT * FROM teams where id = 1091;\nSELECT * FROM crm_configurations where team_id = 1091;\nSELECT * FROM activity_providers where team_id = 1091;\nSELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT * FROM teams WHERE name LIKE '%Leadventure%';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1091 and sa.provider = 'salesforce';\n\nSELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812\nSELECT * FROM teams where id = 862;\nSELECT * FROM crm_configurations where team_id = 862;\nSELECT * FROM activity_providers where team_id = 862;\nSELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')\nand provider NOT IN ('hubspot', 'aircall')\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by id desc;\n\n\nSELECT t.id, crm.id, crm.provider, ap.* FROM teams t\njoin crm_configurations crm on t.id = crm.team_id\njoin activity_providers ap on t.id = ap.team_id\nwhere t.status = 'active' and ap.is_enabled = 1\nand crm.provider = 'hubspot'\nand ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',\n 'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');\n\nSELECT * FROM teams where id = 1068;\nSELECT * FROM crm_configurations where team_id = 1068;\nSELECT * FROM activity_providers where team_id = 1068;\n\nSELECT * FROM activities a\nwhere crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')\nand a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'\n )\n# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'\norder by a.id desc;\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1068 and sa.provider = 'hubspot';\n\n# ********************************************************************\n# ********************************************************************\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 933 and sa.provider = 'hubspot';\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262\nSELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 882 and sa.provider = 'hubspot';\nselect * from crm_layouts where crm_configuration_id = 834;\nselect * from crm_layout_entities where crm_layout_id = 2780;\nselect * from crm_fields where id IN (321153,321192,321193,321194);\n\nSELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1057 and sa.provider = 'hubspot';\n\nSELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8\n\nSELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20\n\nSELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last\n\nSELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10\n\nSELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2\n\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;\n\nSELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th\n# ********************************************************************\nSELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #\n\nSELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;\nselect * from users where team_id = 51; # 7783\nSELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130\nselect * from activity_searches where user_id = 7783;\nselect * from activity_search_filters where activity_search_id IN (32291, 32292);\n\nSELECT asf.activity_search_id, asf.id, asf.value\nFROM activity_search_filters asf\nWHERE asf.filter = 'group_id'\nAND asf.value IN (\n SELECT CONCAT(\n HEX(SUBSTR(uuid, 5, 4)), '-',\n HEX(SUBSTR(uuid, 3, 2)), '-',\n HEX(SUBSTR(uuid, 1, 2)), '-',\n HEX(SUBSTR(uuid, 9, 2)), '-',\n HEX(SUBSTR(uuid, 11))\n )\n FROM groups\n WHERE deleted_at IS NOT NULL\n);\n\nSELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th\n# ********************************************************************\nSELECT * FROM crm_configurations where provider = 'hubspot';\nSELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133\nSELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;\nSELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null\n# ********************************************************************\n\nselect * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';\nselect\n cp.*\n# DISTINCT t.id\n# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields\nFROM crm_profiles cp\nJOIN crm_configurations crm on crm.id = cp.crm_configuration_id\nJOIN users u on u.id = cp.user_id\nJOIN teams t ON t.id = crm.team_id\nWHERE crm.provider = 'salesforce' and t.status = 'active'\n and cp.archived_at IS NULL and u.deleted_at IS NULL\n and t.id NOT IN (1093)\n and t.id = 2\n and cp.contact_fields IS NULL;\n# and c.crm_provider_id = '003Uu00000ojD4NIAU';\n\nSELECT * FROM users WHERE id = 26484;\nSELECT * FROM crm_profiles WHERE user_id = 26484;\nSELECT * FROM social_accounts WHERE sociable_id = 26484;\nSELECT * FROM crm_configurations where provider = 'salesforce';\nselect * from users where id IN (10022, 10403);\nselect * from users where team_id IN (526);\nselect * from teams where id IN (526, 532);\nselect * from crm_configurations where id IN (500, 516);\nselect * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);\nselect * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 526 and sa.provider = 'salesforce';\nselect * from team_settings where team_id IN (526, 532);\n\nselect * from users where id IN (22824);\nselect * from crm_profiles where crm_configuration_id IN (1026);\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1093 and sa.provider = 'salesforce';\n\nselect * from teams where id = 1099;\nselect * from users where id = 29643\n\nselect * from activity_processing_states;\n\nSELECT * FROM teams where name LIKE '%Fare%'; # 233\nSELECT * FROM opportunities where crm_configuration_id = 215\n# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'\n;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1088 and sa.provider = 'hubspot';\n\nSELECT * FROM teams order by updated_at DESC\nSELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account\n\nselect * from crm_configurations where provider = 'pipedrive';\n\nselect * from teams where id = 957;\nselect * from crm_configurations where id = 957;\n\nSELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743\nSELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;\n\nselect * from users where team_id = 1; # 26726 - Gabriela Dureva\nSELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific\nselect * from activities where user_id = 26726 order by id desc;\nselect * from contacts where crm_configuration_id = 1\nand email IN ('charlotte.ward@prolific.com', 'frankie.bryant@prolific.com'); # 2094416, 2093620\nSELECT * FROM contacts WHERE id = 6284931;\n\nSELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id\nWHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;\n\nselect * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);\nselect * from crm_configurations where id = 1;\n\n43801692-1aeb-32ce-acba-5b80a479701a\n44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b\n405975c0-b3d0-7aaa-821f-09d59cae6dd1\n4caf848d-4bed-2299-b248-7788d41f9fca\n49bedc3f-f196-eef3-89c3-dea6a3b4aa63\n43420989-a09d-b8f8-9806-c8bbf7a02aac\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nSELECT * FROM activities WHERE id = 75461988;\n\nSELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;\n\nselect * from contacts where id = 17900517;\n\nselect * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id\nwhere crm.provider != 'salesforce';\n\nselect * from users where id = 21047;\nSELECT * FROM crm_configurations WHERE id = 892;\nSELECT * FROM teams WHERE id = 942;\nselect * from opportunities where team_id = 942 order by updated_at desc;\nselect * from contacts where team_id = 942 order by updated_at desc;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 942 and sa.provider = 'hubspot';\n\nSELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430\nSELECT * FROM crm_configurations WHERE id = 1;\nSELECT * FROM teams WHERE crm_id = 1;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1 and sa.provider = 'salesforce';\n\nselect id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1\nSELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430\n\nselect * from teams where id = 852;\nselect * from groups where id = 2286;\nselect * from sidekick_settings where team_id = 852;\nselect * from default_activity_types where team_id = 852;\n\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1 AND u.deleted_at IS NULL\nAND u.crm_required = 1\nAND u.team_id = 1\nORDER BY u.team_id;\n\nSELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (\n18481\n );\n\nSELECT cc.provider, cc.id, p.id, u.*\nFROM users u\nLEFT JOIN crm_profiles p ON u.id = p.user_id\nINNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'\nINNER JOIN crm_configurations cc ON t.crm_id = cc.id\nWHERE u.status = 1\n AND u.deleted_at IS NULL\n AND u.crm_required = 1\n# AND u.team_id = 1\n AND p.id IS NULL -- Move this condition to WHERE clause\nORDER BY u.team_id;\n\nSELECT * FROM opportunities WHERE id = 20002609;\nselect * from teams where id = 1122; # Velatir, 29953 - christian@velatir.com\nselect * from crm_configurations where id = 1060;\nselect * from crm_layouts where crm_configuration_id = 1060;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1122 and sa.provider = 'hubspot';\nselect * from opportunities where team_id = 1122 order by updated_at desc;\n\nselect * from crm_field_data where object_type = 'contact';\n\nSELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 248 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS\nSELECT * FROM users where id = 24115;\nSELECT * FROM accounts where id = 4002896;\nSELECT * FROM teams WHERE name LIKE '%adswerve%';\nSELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN (\"0069N000003GIQ9QAO\",\"0061r000019yGP9AAM\",\"0066900001S2KWlAAN\",\"0066900001TDpj2AAD\",\"0066900001b8uEwAAI\",\"0069N000001rQi0QAE\",\"006QF00000KD40mYAD\",\"006QF00000LzpRJYAZ\",\"0069N000002uomtQAA\",\"0069N000002xlMLQAY\",\"0066900001NV6ubAAD\",\"0061r00001HJp45AAD\",\"006QF00000uTlUoYAK\",\"006QF00000v0bZqYAI\");\nSELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203\n\nSELECT u.id, u.email, ac.name, a.* FROM activities a\nJOIN users u ON a.user_id = u.id\nJOIN accounts ac ON a.account_id = ac.id\nWHERE\nuuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or\nuuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or\nuuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;\n\nselect * from users where id = 5825;\nSELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;\n\nselect * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;\n19594, 862\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 862 and sa.provider = 'salesforce';\n\nselect * from automated_reports where id = 36;\nselect ar.frequency, r.*, ar.* from automated_report_results r\njoin automated_reports ar on r.report_id = ar.id\nwhere ar.frequency != 'one_off';\n\nselect s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;\nselect * from nudges n where n.activity_search_id\n\nselect * from teams where created_at > '2026-03-09';\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;\n\nselect * from users where team_id = 1 and name like '%Lukas%'; # 7160\n\nSELECT * FROM teams WHERE id = 575;\nselect * from opportunities where team_id = 575;\nSELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,\nselect * from opportunities where team_id = 1126;\nSELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,\nselect * from opportunities where team_id = 1125;\nselect * from contacts c\nwhere c.team_id = 882;\n\nSELECT * FROM activities WHERE id = 76822967;\nSELECT * FROM crm_profiles WHERE user_id = 15440;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 555;\nSELECT * FROM crm_configurations WHERE id = 555;\nSELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 581 and sa.provider = 'salesforce';\n\nSELECT * FROM automated_report_results order by id desc;\n\nselect * from features;\nselect * from team_features where feature_id = 40;\n\nselect * from teams where id = 556;\n\nselect * from automated_reports;\nwhere id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , [\"pdf\",\"podcast\"]\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\nselect * from automated_report_results order by id desc;\nSELECT * FROM automated_report_results WHERE id = 1919;\n\nselect * from automated_report_results WHERE report_id = 54;\n\nselect * from opportunities where id = 7594349;\n\nSELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - jiminnyintegration@lesmills.com\nselect * from playbooks where team_id = 711; # event 226147\nSELECT * FROM playbook_categories WHERE playbook_id = 5515;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';\nSELECT * FROM crm_fields WHERE id = 226147;\nSELECT * FROM crm_field_values WHERE crm_field_id = 226147;\n\nSELECT * FROM crm_configurations WHERE id = 692;\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 711 and sa.provider = 'salesforce';\n\nSELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;\n\nselect * from leads;\n\nselect * from calendars;\n\nSELECT\n t.id AS team_id,\n t.name,\n LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain\nFROM teams t\nJOIN users u ON u.team_id = t.id\nJOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'\nLEFT JOIN team_domains td\n ON td.team_id = t.id\n AND td.deleted_at IS NULL\n AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))\nGROUP BY t.id, t.name, calendar_domain\nORDER BY t.name, calendar_domain;\n\nselect * from users u join calendars c on c.user_id = u.id\nwhere u.team_id = 882;\n\n\nselect * from activities where id = 74049485; # team 563 crm 537\nselect * from activities where id = 73272382; # team 563 crm 537\nselect * from activities where id = 64400389; # team 563 crm 537\nselect * from activities where id = 58081273; # team 563 crm 537\nselect * from activities where id = 54520297; # team 563 crm 537\nselect * from participants where activity_id = 58081273;\n\nselect * from activities where crm_configuration_id = 537 and provider = 'aircall'\nand account_id = 19003658 order by updated_at desc;\n\nselect * from contacts where crm_configuration_id = 537 and id = 35957759;\nselect * from accounts where crm_configuration_id = 537 and id = 19003658;\n\nselect * from automated_report_results where id = 1976;\nselect * from automated_reports where id = 583;\nselect * from activity_searches where id = 87714;\nselect * from activity_search_filters where activity_search_id = 87714;\n\nSELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid\nor uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;\n\nSELECT * FROM crm_configurations WHERE provider = 'hubspot';\nselect * from rate_limits;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2\nand id IN (18, 1872);\nselect * from automated_reports where id = 54;\nSELECT * FROM users WHERE id IN (24623,29443,29613);\n\nSELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;\n\nselect * from text_relays where created_at > '2026-05-01';\nand id IN (32415, 32416);\n# and id = 32412;\n\nselect * from users where team_id = 2 and email like '%scott%' and id = 29510;\n\nSELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436\n\nSELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses\nFROM text_relays\nWHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')\nGROUP BY email_provider_id;\nSELECT id, status, telephony_provider_id, created_at\nFROM activities\nWHERE id IN (80028719, 80028846);\nSELECT id, status, code, email_sent_at, created_at, updated_at\nFROM text_relays\nWHERE id IN (32415, 32416);\nSELECT id, status, code, sender, recipient, created_at\nFROM text_relays\nWHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'\nORDER BY created_at DESC\nLIMIT 10;\n\nSELECT id, uuid, status, code, sender, recipient, created_at, updated_at\nFROM text_relays\nWHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');\n\n# ***************\nSELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count\nFROM users u\nINNER JOIN activities a ON u.id = .user_id\nWHERE a.type LIKE 'sms%'\nAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)\nGROUP BY u.id, u.email, u.name, u.softphone_number\nORDER BY sms_count DESC;\n\nselect * from teams where id = 1;\n\nselect * from roles;\n\n\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1117 and sa.provider = 'hubspot';\nSELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES\nSELECT * FROM activities WHERE uuid_to_bin('25529043-8094-4781-927f-4f4da2a8185c') = uuid; # 80186192 NO\nSELECT * FROM crm_configurations WHERE id = 1053;\nSELECT * FROM teams WHERE id = 1117;\nselect * from users where id = 30249;\nselect * from playbooks where id = 5473;\nselect * from playbook_categories where id = 43783;\nselect * from playbook_categories where playbook_id = 5473;\nselect * from crm_fields where id = 659242;\nselect * from crm_field_values where crm_field_id = 659242;\n\nSELECT * FROM crm_field_data fd\n# JOIN crm_fields f ON fd.crm_field_id = f.id\n# JOIN activities a ON fd.activity_id = a.id\nWHERE activity_id = 79933459\n# AND f.crm_provider_id = 'hs_activity_type';\n\n\nSELECT * FROM activity_messages;\nselect * from text_relays where created_at > '2026-05-01';\nselect * from activities where user_id IN (7160, 18608) and created_at > '2026-05-22' order by id desc;\nselect * from users where team_id = 1 and id IN (18608, 13934, 7160);\nselect * from activities where user_id = 7160 order by id desc limit 10;\n\nselect * from accounts where team_id = 1 and name = 'Column5';\n\nselect * from users where name like '%Subra%'; # 31054, 1117\nselect * from teams where id = 1117;\nselect * from activity_searches where user_id = 31054;\nselect * from activity_search_filters where activity_search_id IN (88882, 88902);","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Project","depth":3,"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Project","depth":3,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2969018736326282442
|
2218635325254022983
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45
1
41
66
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE name LIKE '%litify%'; # 1069, 994, 24993
SELECT * FROM users WHERE id = 25061;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 994;
SELECT * FROM crm_profiles WHERE user_id = 25061;
select * from crm_configurations where id = 834;
SELECT * FROM teams WHERE id = 882;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations WHERE provider = 'hubspot' and crm_provider_id = 7270388;
SELECT * FROM contacts where crm_configuration_id = 834;
SELECT * FROM opportunities WHERE team_id = 933
# AND crm_provider_id IN ('20131586060','46017317898','52543911090','53451356564','54101251892','54323768459');
AND id IN (8482561,18352941,19042734,19232139,19445140,19472541);
SELECT * FROM opportunity_contacts
WHERE opportunity_id IN (8482561,18352941,19042734,19232139,19445140,19472541);
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 485; #
SELECT * FROM opportunities WHERE team_id = 933 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
select crm.provider, l.* from leads l join crm_configurations crm on l.crm_configuration_id = crm.id
where crm.provider NOT IN ('salesforce', 'integration-app', 'bullhorn', 'copper')
# and l.converted_at IS NOT NULL
;
# [PASSWORD_DOTS]
SELECT * FROM activities a WHERE type IN ('email-inbound', 'email-outbound')
and opportunity_id IS NULL
order by id desc;
SELECT * FROM teams WHERE id = 604; # 598
SELECT * FROM activities WHERE id = 74410828; # [EMAIL]
SELECT * FROM accounts WHERE id = 20068382;
SELECT * FROM accounts WHERE id = 35186038;
SELECT * FROM contacts WHERE team_id = 852 and updated_at > '2026-01-23 12:30:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 559 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('cb6342b6-a183-401c-b0af-ede92b2ae763') = uuid;
select * from sidekick_settings where team_id = 781;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 26651871; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 7562435;
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8420347; # opflit 2100
SELECT * FROM crm_layouts WHERE crm_configuration_id = 711;
SELECT * FROM activities where crm_configuration_id = 711 and crm_provider_id IS NULL
and is_internal = 0 and status = 'completed'
order by id desc;
SELECT * FROM crm_layout_entities
WHERE crm_layout_id IN (2352, 2353);
;
SELECT * FROM crm_configurations where provider = 'hubspot' and id = 530;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 556 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('c6ca4b22-7738-4563-a95d-b8a9598924ae') = uuid;
SELECT * FROM activities WHERE uuid_to_bin('442abb2b-28bd-4be8-9c25-19e9bf02766d') = uuid;
select * from contacts
where crm_configuration_id = 530
and crm_provider_id = 872252;
select * from activities where crm_configuration_id = 530
and user_id = 14343 and type like '%softphone%'
and created_at between '2026-01-28 15:00:00' and '2026-01-28 15:10:00';
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 25666868; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id = 8646335; # Teya
SELECT * FROM crm_configurations where provider = 'hubspot' and crm_provider_id IN (5933397);
SELECT t.name, t.id, t.owner_id, c.id, c.provider, c.crm_base_url FROM teams t
JOIN crm_configurations c ON t.id = c.team_id
WHERE t.status = 'active';
SELECT * FROM teams where id = 1091;
SELECT * FROM crm_configurations where team_id = 1091;
SELECT * FROM activity_providers where team_id = 1091;
SELECT * FROM activities where crm_configuration_id = 1024 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT * FROM teams WHERE name LIKE '%Leadventure%';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1091 and sa.provider = 'salesforce';
SELECT * FROM teams WHERE name LIKE '%Wilson%'; # 862, 812
SELECT * FROM teams where id = 862;
SELECT * FROM crm_configurations where team_id = 862;
SELECT * FROM activity_providers where team_id = 862;
SELECT * FROM activities where crm_configuration_id = 812 and type IN ('softphone', 'softphone-outbound')
and provider NOT IN ('hubspot', 'aircall')
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by id desc;
SELECT t.id, crm.id, crm.provider, ap.* FROM teams t
join crm_configurations crm on t.id = crm.team_id
join activity_providers ap on t.id = ap.team_id
where t.status = 'active' and ap.is_enabled = 1
and crm.provider = 'hubspot'
and ap.provider NOT IN ('hubspot', 'aircall', 'uploader', 'gong', 'twilio', 'zoom-bot', 'google-meet', 'ms-teams',
'outreach', 'close', 'ringcentral', 'dialpad', 'zoom-phone');
SELECT * FROM teams where id = 1068;
SELECT * FROM crm_configurations where team_id = 1068;
SELECT * FROM activity_providers where team_id = 1068;
SELECT * FROM activities a
where crm_configuration_id = 993 and type IN ('softphone', 'softphone-outbound')
and a.provider NOT IN ('hubspot', 'uploader', 'gong', 'twilio', 'google-meet', 'ms-teams','close'
)
# and telephony_provider_id = '019c1131-a22f-4792-b9ea-20adf6a02ed0'
order by a.id desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1068 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 882; # 933 - GoGlobal , portalId: 6017093
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 933 and updated_at > '2026-02-06 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 933 and sa.provider = 'hubspot';
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 834; # 882 - AnyVan , portalId: 5468262
SELECT * FROM contacts WHERE crm_configuration_id = 834 and updated_at > '2026-03-30 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and updated_at > '2026-03-04 08:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 882 and sa.provider = 'hubspot';
select * from crm_layouts where crm_configuration_id = 834;
select * from crm_layout_entities where crm_layout_id = 2780;
select * from crm_fields where id IN (321153,321192,321193,321194);
SELECT * FROM opportunities WHERE crm_configuration_id = 834 and id = 10993426;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 988; # 1057 - Teya (543ce4f4-168c-4571-91ea-5b35c253f06f) , portalId: 26651871
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1057 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1057 and sa.provider = 'hubspot';
SELECT * FROM crm_configurations where id = 533; # 559 - Connectd , portalId: 6710988
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 559 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 801; # 852 - Rise Vision , portalId: 2700250
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 852 and updated_at > '2026-02-04 00:00:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 962; # 1034 - evergrowth.io , portalId: 143180990
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1034 and updated_at > '2026-02-04 00:00:00' order by updated_at desc;
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 1037; # 1102 - Jibble , portalId: 6649755
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1102 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 8
SELECT * FROM crm_configurations where id = 1015; # 1049 - Travefy , portalId: 48904401
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1049 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 20
SELECT * FROM crm_configurations where id = 64; # 70 - SalaryFinance , portalId: 3404115
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 70 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 6th last
SELECT * FROM crm_configurations where id = 802; # 853 - Street Group , portalId: 7658438
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 853 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 10
SELECT * FROM crm_configurations where id = 872; # 921 - In Professional Development , portalId: 9238273
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 921 and updated_at > '2026-02-04 12:30:00' order by updated_at desc; # 2
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 550; # 576 - SeedLegals , portalId: 3028661
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 576 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 989; # 1058 - rtaoutdoor.com , portalId: 22371204
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1058 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 896; # 946 - Mintago , portalId: 6621281
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 946 and updated_at > '2026-02-05 14:00:00' order by updated_at desc;
SELECT * FROM crm_configurations where id = 617; # 641 - PCS , portalId: 5244937
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 641 and updated_at > '2026-02-05 14:00:00' order by updated_at desc; # 7th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where id = 649; # 670 - Eventeny , portalId: 4492849
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-18 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 670 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; #
SELECT * FROM crm_configurations where id = 48; # 51 - CleanCloud , portalId: 4373137
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-03-04 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 51 and updated_at > '2026-02-09 08:00:00' order by updated_at desc;
select * from users where team_id = 51; # 7783
SELECT * FROM groups WHERE uuid_to_bin('8a8d2cb6-8b55-4fa3-8b5c-5f0e3d8de59a') = uuid; # 1130
select * from activity_searches where user_id = 7783;
select * from activity_search_filters where activity_search_id IN (32291, 32292);
SELECT asf.activity_search_id, asf.id, asf.value
FROM activity_search_filters asf
WHERE asf.filter = 'group_id'
AND asf.value IN (
SELECT CONCAT(
HEX(SUBSTR(uuid, 5, 4)), '-',
HEX(SUBSTR(uuid, 3, 2)), '-',
HEX(SUBSTR(uuid, 1, 2)), '-',
HEX(SUBSTR(uuid, 9, 2)), '-',
HEX(SUBSTR(uuid, 11))
)
FROM groups
WHERE deleted_at IS NOT NULL
);
SELECT * FROM crm_configurations where id = 272; # 290 - Bonham & Brook , portalId: 5705856
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-05 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 290 and updated_at > '2026-02-09 08:00:00' order by updated_at desc; # 6th
# [PASSWORD_DOTS]
SELECT * FROM crm_configurations where provider = 'hubspot';
SELECT * FROM crm_configurations where id = 1056; # 1119 - Chromatic , portalId: 45602133
SELECT * FROM opportunities WHERE team_id = 1119 and remotely_created_at > '2026-02-01 00:00:00' order by updated_at desc;
SELECT * FROM opportunities WHERE team_id = 1119 and updated_at > '2026-02-09 09:00:00' order by updated_at desc; # null
# [PASSWORD_DOTS]
select * from contacts where crm_provider_id = '003Uu00000ojD4NIAU';
select
cp.*
# DISTINCT t.id
# cp.id, cp.user_id, t.id, cp.crm_configuration_id, cp.contact_fields
FROM crm_profiles cp
JOIN crm_configurations crm on crm.id = cp.crm_configuration_id
JOIN users u on u.id = cp.user_id
JOIN teams t ON t.id = crm.team_id
WHERE crm.provider = 'salesforce' and t.status = 'active'
and cp.archived_at IS NULL and u.deleted_at IS NULL
and t.id NOT IN (1093)
and t.id = 2
and cp.contact_fields IS NULL;
# and c.crm_provider_id = '003Uu00000ojD4NIAU';
SELECT * FROM users WHERE id = 26484;
SELECT * FROM crm_profiles WHERE user_id = 26484;
SELECT * FROM social_accounts WHERE sociable_id = 26484;
SELECT * FROM crm_configurations where provider = 'salesforce';
select * from users where id IN (10022, 10403);
select * from users where team_id IN (526);
select * from teams where id IN (526, 532);
select * from crm_configurations where id IN (500, 516);
select * from crm_profiles where crm_configuration_id IN (500, 516) and user_id IN (10022, 10403);
select * from contacts where crm_configuration_id IN (500, 516) and crm_provider_id = '003Uu00000ojD4NIAU';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 526 and sa.provider = 'salesforce';
select * from team_settings where team_id IN (526, 532);
select * from users where id IN (22824);
select * from crm_profiles where crm_configuration_id IN (1026);
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1093 and sa.provider = 'salesforce';
select * from teams where id = 1099;
select * from users where id = 29643
select * from activity_processing_states;
SELECT * FROM teams where name LIKE '%Fare%'; # 233
SELECT * FROM opportunities where crm_configuration_id = 215
# and crm_provider_id = 'oppo_ogESZf2P50nDrd1nGPvKDXeA6sSaTN5v51Lp4ayVzKR'
;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1088 and sa.provider = 'hubspot';
SELECT * FROM teams order by updated_at DESC
SELECT * FROM crm_configurations WHERE id = 1019; # SimpleConsign 1088 - no social account
select * from crm_configurations where provider = 'pipedrive';
select * from teams where id = 957;
select * from crm_configurations where id = 957;
SELECT * FROM teams WHERE name LIKE '%Prolific%'; # 544, 518, 10743
SELECT * FROM opportunities where crm_configuration_id = 518 order by id desc;
select * from users where team_id = 1; # 26726 - Gabriela Dureva
SELECT * FROM opportunities where user_id = 26726; # 16834447 - Prolific
select * from activities where user_id = 26726 order by id desc;
select * from contacts where crm_configuration_id = 1
and email IN ('[EMAIL]', '[EMAIL]'); # 2094416, 2093620
SELECT * FROM contacts WHERE id = 6284931;
SELECT p.* FROM activities a JOIN participants p ON a.id = p.activity_id
WHERE a.user_id = 26726 and p.lead_id IN (2094416, 2093620) and a.created_at > '2026-01-01 00:00:00' order by p.email;
select * from activities where id IN (75509259,75509261,75509261,75511034,75026464,75517602,75517605);
select * from crm_configurations where id = 1;
43801692-1aeb-32ce-acba-5b80a479701a
44c3c9cf-6f5e-75f3-8179-bc9f75dd2b1b
405975c0-b3d0-7aaa-821f-09d59cae6dd1
4caf848d-4bed-2299-b248-7788d41f9fca
49bedc3f-f196-eef3-89c3-dea6a3b4aa63
43420989-a09d-b8f8-9806-c8bbf7a02aac
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
SELECT * FROM activities WHERE id = 75461988;
SELECT * FROM activities WHERE uuid_to_bin('d6c5052e-e972-49e9-8912-26f2f7d6c5f6') = uuid;
select * from contacts where id = 17900517;
select * from contact_roles cr join crm_configurations crm on cr.crm_configuration_id = crm.id
where crm.provider != 'salesforce';
select * from users where id = 21047;
SELECT * FROM crm_configurations WHERE id = 892;
SELECT * FROM teams WHERE id = 942;
select * from opportunities where team_id = 942 order by updated_at desc;
select * from contacts where team_id = 942 order by updated_at desc;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 942 and sa.provider = 'hubspot';
SELECT * FROM opportunities where team_id = 1 and crm_provider_id IN ('006Pq00000NeH6XIAV', '006Pq000007z8kdIAA'); # 10697889, 6621430
SELECT * FROM crm_configurations WHERE id = 1;
SELECT * FROM teams WHERE crm_id = 1;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1 and sa.provider = 'salesforce';
select id, user_id, opportunity_fields from crm_profiles where crm_configuration_id = 1
SELECT * FROM opportunities where team_id = 1 order by updated_at desc; # 10697889, 6621430
select * from teams where id = 852;
select * from groups where id = 2286;
select * from sidekick_settings where team_id = 852;
select * from default_activity_types where team_id = 852;
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id AND p.id IS NULL -- no profile
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active' -- team is active
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1 AND u.deleted_at IS NULL
AND u.crm_required = 1
AND u.team_id = 1
ORDER BY u.team_id;
SELECT * FROM crm_profiles cp where cp.crm_configuration_id = 1 and cp.user_id IN (
18481
);
SELECT cc.provider, cc.id, p.id, u.*
FROM users u
LEFT JOIN crm_profiles p ON u.id = p.user_id
INNER JOIN teams t ON u.team_id = t.id AND t.status = 'active'
INNER JOIN crm_configurations cc ON t.crm_id = cc.id
WHERE u.status = 1
AND u.deleted_at IS NULL
AND u.crm_required = 1
# AND u.team_id = 1
AND p.id IS NULL -- Move this condition to WHERE clause
ORDER BY u.team_id;
SELECT * FROM opportunities WHERE id = 20002609;
select * from teams where id = 1122; # Velatir, 29953 - [EMAIL]
select * from crm_configurations where id = 1060;
select * from crm_layouts where crm_configuration_id = 1060;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3596;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1122 and sa.provider = 'hubspot';
select * from opportunities where team_id = 1122 order by updated_at desc;
select * from crm_field_data where object_type = 'contact';
SELECT * FROM activities WHERE uuid_to_bin('374fc8ed-3315-4c9f-9b25-318b7fd2928f') = uuid; # 76584262
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 248 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles where user_id = 24115; # 005QF000002CswMYAS
SELECT * FROM users where id = 24115;
SELECT * FROM accounts where id = 4002896;
SELECT * FROM teams WHERE name LIKE '%adswerve%';
SELECT * FROM opportunities where crm_configuration_id = 230 AND crm_provider_id IN ("0069N000003GIQ9QAO","0061r000019yGP9AAM","0066900001S2KWlAAN","0066900001TDpj2AAD","0066900001b8uEwAAI","0069N000001rQi0QAE","006QF00000KD40mYAD","006QF00000LzpRJYAZ","0069N000002uomtQAA","0069N000002xlMLQAY","0066900001NV6ubAAD","0061r00001HJp45AAD","006QF00000uTlUoYAK","006QF00000v0bZqYAI");
SELECT * FROM opportunities WHERE crm_configuration_id = 230 AND crm_provider_id = '0069N000003GIQ9QAO'; # 6272203
SELECT u.id, u.email, ac.name, a.* FROM activities a
JOIN users u ON a.user_id = u.id
JOIN accounts ac ON a.account_id = ac.id
WHERE
uuid_to_bin('e3269598-b562-44fb-b5e9-9d2694dc63e0') = a.uuid or
uuid_to_bin('66ddc3ab-4e15-45aa-af0c-248c1eece593') = a.uuid or
uuid_to_bin('826bd328-e1cc-4213-b8d8-572454cacc07') = a.uuid;
select * from users where id = 5825;
SELECT * FROM activities WHERE uuid_to_bin('e56aa2e8-231a-421b-ab1f-cb38ed2bf573') = uuid;
select * from activities where uuid_to_bin('91e13b2f-2d1b-45f8-b1fd-1141b6563782') = uuid;
19594, 862
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 862 and sa.provider = 'salesforce';
select * from automated_reports where id = 36;
select ar.frequency, r.*, ar.* from automated_report_results r
join automated_reports ar on r.report_id = ar.id
where ar.frequency != 'one_off';
select s.* from activity_searches s join users u ON s.user_id = u.id where u.team_id = 882;
select * from nudges n where n.activity_search_id
select * from teams where created_at > '2026-03-09';
SELECT * FROM crm_layouts WHERE crm_configuration_id = 1065; # 1065
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 3617;
select * from users where team_id = 1 and name like '%Lukas%'; # 7160
SELECT * FROM teams WHERE id = 575;
select * from opportunities where team_id = 575;
SELECT * FROM teams WHERE name LIKE '%Integrum ESG%'; # 1126, 1065,
select * from opportunities where team_id = 1126;
SELECT * FROM teams WHERE name LIKE '%Base%'; # 1125, 1063,
select * from opportunities where team_id = 1125;
select * from contacts c
where c.team_id = 882;
SELECT * FROM activities WHERE id = 76822967;
SELECT * FROM crm_profiles WHERE user_id = 15440;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 555;
SELECT * FROM crm_configurations WHERE id = 555;
SELECT * FROM users WHERE id = 15440; # team. 581, gr. 15440, pl. 3911, act. field 162182
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 581 and sa.provider = 'salesforce';
SELECT * FROM automated_report_results order by id desc;
select * from features;
select * from team_features where feature_id = 40;
select * from teams where id = 556;
select * from automated_reports;
where id = 54; # 4fdd41f6-dcf0-30d0-b339-7345381b6044 , ["pdf","podcast"]
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from automated_report_results order by id desc;
SELECT * FROM automated_report_results WHERE id = 1919;
select * from automated_report_results WHERE report_id = 54;
select * from opportunities where id = 7594349;
SELECT * FROM teams WHERE name LIKE '%Les%'; # 711, 692, 16067 - [EMAIL]
select * from playbooks where team_id = 711; # event 226147
SELECT * FROM playbook_categories WHERE playbook_id = 5515;
SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event';
SELECT * FROM crm_fields WHERE id = 226147;
SELECT * FROM crm_field_values WHERE crm_field_id = 226147;
SELECT * FROM crm_configurations WHERE id = 692;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 711 and sa.provider = 'salesforce';
SELECT * FROM crm_profiles cp JOIN users u on u.id = cp.user_id WHERE u.team_id = 711;
select * from leads;
select * from calendars;
SELECT
t.id AS team_id,
t.name,
LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1)) AS calendar_domain
FROM teams t
JOIN users u ON u.team_id = t.id
JOIN calendars c ON c.user_id = u.id AND c.status = 'active' AND c.calendar_provider_id LIKE '%@%'
LEFT JOIN team_domains td
ON td.team_id = t.id
AND td.deleted_at IS NULL
AND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))
GROUP BY t.id, t.name, calendar_domain
ORDER BY t.name, calendar_domain;
select * from users u join calendars c on c.user_id = u.id
where u.team_id = 882;
select * from activities where id = 74049485; # team 563 crm 537
select * from activities where id = 73272382; # team 563 crm 537
select * from activities where id = 64400389; # team 563 crm 537
select * from activities where id = 58081273; # team 563 crm 537
select * from activities where id = 54520297; # team 563 crm 537
select * from participants where activity_id = 58081273;
select * from activities where crm_configuration_id = 537 and provider = 'aircall'
and account_id = 19003658 order by updated_at desc;
select * from contacts where crm_configuration_id = 537 and id = 35957759;
select * from accounts where crm_configuration_id = 537 and id = 19003658;
select * from automated_report_results where id = 1976;
select * from automated_reports where id = 583;
select * from activity_searches where id = 87714;
select * from activity_search_filters where activity_search_id = 87714;
SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuid
or uuid_to_bin('47842446-af51-4bcb-854f-cc6560290101') = uuid;
SELECT * FROM crm_configurations WHERE provider = 'hubspot';
select * from rate_limits;
select * from automated_report_results where media_type = 'pdf' and status = 2
and id IN (18, 1872);
select * from automated_reports where id = 54;
SELECT * FROM users WHERE id IN (24623,29443,29613);
SELECT * FROM automated_report_results WHERE uuid_to_bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid;
select * from text_relays where created_at > '2026-05-01';
and id IN (32415, 32416);
# and id = 32412;
select * from users where team_id = 2 and email like '%scott%' and id = 29510;
SELECT * FROM activities WHERE uuid_to_bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid; # 79763436
SELECT email_provider_id, COUNT(*) as count, GROUP_CONCAT(id) as ids, GROUP_CONCAT(status) as statuses
FROM text_relays
WHERE email_provider_id IN ('19e2027868a64b42', '19e2033ed8ea6b10')
GROUP BY email_provider_id;
SELECT id, status, telephony_provider_id, created_at
FROM activities
WHERE id IN (80028719, 80028846);
SELECT id, status, code, email_sent_at, created_at, updated_at
FROM text_relays
WHERE id IN (32415, 32416);
SELECT id, status, code, sender, recipient, created_at
FROM text_relays
WHERE sender LIKE '%mario.georgiev%' OR sender LIKE '%stoyan.tomov%'
ORDER BY created_at DESC
LIMIT 10;
SELECT id, uuid, status, code, sender, recipient, created_at, updated_at
FROM text_relays
WHERE uuid = uuid_to_bin('0626141c-27a6-4d8c-aff8-7c8020a2c656');
# [PASSWORD_DOTS]
SELECT DISTINCT u.id, u.email, u.name, u.softphone_number, COUNT(a.id) as sms_count
FROM users u
INNER JOIN activities a ON u.id = .user_id
WHERE a.type LIKE 'sms%'
AND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)
GROUP BY u.id, u.email, u.name, u.softphone_number
ORDER BY sms_count DESC;
select * from teams where id = 1;
select * from roles;
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1117 and sa.provider = 'hubspot';
SELECT * FROM activities WHERE uuid_to_bin('8024fffb-2df7-4017-91f4-d9f896050248') = uuid; # 79933459 YES
SELECT * FROM activities WHERE uuid_to_bin('[CREDIT_CARD]-927f-4f4da2a8185c') = uuid; # 80186192 NO
SELECT * FROM crm_configurations WHERE id = 1053;
SELECT * FROM teams WHERE id = 1117;
select * from users where id = 30249;
select * from playbooks where id = 5473;
select * from playbook_categories where id = 43783;
select * from playbook_categories where playbook_id = 5473;
select * from crm_fields where id = 659242;
select * from crm_field_values where crm_field_id = 659242;
SELECT * FROM crm_field_data fd
# JOIN crm_fields f ON fd.crm_field_id = f.id
# JOIN activities a ON fd.activity_id = a.id
WHERE activity_id = 79933459
# AND f.crm_provider_id = 'hs_activity_type';
SELECT * FROM activity_messages;
select * from text_relays where created_at > '2026-05-01';
select * from activities where user_id IN (7160, 18608) and created_at > '2026-...
|
85473
|
NULL
|
NULL
|
NULL
|
|
85474
|
2929
|
7
|
2026-05-28T12:38:19.232595+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971899232_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.019946808,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41589096,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.43550533,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.44414893,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.45279256,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.4637633,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.47473404,"top":0.09896249,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.5013298,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.51230055,"top":0.09896249,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-2096255366270503273
|
-816169308791850106
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85473
|
2928
|
6
|
2026-05-28T12:38:16.816030+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971896816_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.041666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
7169796927162592988
|
-816168209280222298
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85472
|
2929
|
6
|
2026-05-28T12:37:48.858291+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971868858_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.019946808,"height":0.0},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.00731383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.006981383,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"bounds":{"left":0.41589096,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"bounds":{"left":0.4245346,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"bounds":{"left":0.43550533,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"bounds":{"left":0.44414893,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"bounds":{"left":0.45279256,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"bounds":{"left":0.4637633,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Tx: Auto","depth":4,"bounds":{"left":0.47473404,"top":0.09896249,"width":0.024268618,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Cancel Running Statements","depth":4,"bounds":{"left":0.5013298,"top":0.09896249,"width":0.008643617,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Playground","depth":4,"bounds":{"left":0.51230055,"top":0.09896249,"width":0.029587766,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"jiminny","depth":4,"bounds":{"left":0.7237367,"top":0.09896249,"width":0.02825798,"height":0.01915403},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"45","depth":4,"bounds":{"left":0.6938165,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"}]...
|
-5840278407609921850
|
-798154910284465274
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Sync Changes
Hide This Notification
Code changed:
Hide
45...
|
85470
|
NULL
|
NULL
|
NULL
|
|
85471
|
2928
|
5
|
2026-05-28T12:37:46.321168+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971866321_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.088194445,"height":0.027777778},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.018055556,"height":0.026666667},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Analyzing…","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.041666668,"height":0.02111111},"on_screen":false,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.015277778,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Next Highlighted Error","depth":4,"bounds":{"left":0.0,"top":0.0,"width":0.014583333,"height":0.025555555},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Tests\\Unit\\Services\\Mail;\n\nuse Google\\Service\\Gmail as GoogleGmail;\nuse Google\\Service\\Gmail\\Message as GmailMessage;\nuse Google\\Service\\Gmail\\MessagePart;\nuse Google\\Service\\Gmail\\MessagePartHeader;\nuse Illuminate\\Support\\Facades\\Config;\nuse Jiminny\\Services\\Mail\\TextRelayService;\nuse PHPUnit\\Framework\\Attributes\\CoversClass;\nuse PHPUnit\\Framework\\Attributes\\DataProvider;\nuse Tests\\TestCase;\nuse ReflectionClass;\nuse Mockery;\n\n#[CoversClass(TextRelayService::class)]\nclass TextRelayServiceTest extends TestCase\n{\n public static function environmentProvider(): array\n {\n return [\n 'eu_environment' => ['eu', 'catch-all-eu@txt.jiminny.com'],\n 'us_environment' => ['us', 'catch-all@txt.jiminny.com'],\n 'other_environment_defaults_to_us' => ['other', 'catch-all@txt.jiminny.com'],\n ];\n }\n\n protected function setUp(): void\n {\n parent::setUp();\n }\n\n protected function tearDown(): void\n {\n Mockery::close();\n parent::tearDown();\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = $expectedRecipient;\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertTrue($result);\n }\n\n #[DataProvider('environmentProvider')]\n public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'X-Gm-Original-To';\n $header->value = 'other@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentIgnoresToHeader(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n $header = $this->createMock(MessagePartHeader::class);\n\n $header->name = 'To';\n $header->value = 'catch-all@txt.jiminny.com';\n\n $payload->method('getHeaders')->willReturn([$header]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithEmptyHeaders(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $message = $this->createMock(GmailMessage::class);\n $payload = $this->createMock(MessagePart::class);\n\n $payload->method('getHeaders')->willReturn([]);\n $message->method('getPayload')->willReturn($payload);\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')->willReturn($message);\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testIsForCurrentEnvironmentWithException(): void\n {\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n\n $usersMessages = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersMessages::class);\n $usersMessages->method('get')\n ->willThrowException(new \\Exception('Gmail API error'));\n\n $gmailService = $this->createMock(GoogleGmail::class);\n $gmailService->users_messages = $usersMessages;\n\n $service = $this->createTextRelayService();\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('isForCurrentEnvironment');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', 'catch-all@txt.jiminny.com');\n\n $this->assertFalse($result);\n }\n\n public function testSyncUsesEuAliasForEuRegion(): void\n {\n Config::set('jiminny.deploy_region', 'eu');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n public function testSyncUsesUsAliasForUsRegion(): void\n {\n Config::set('jiminny.deploy_region', 'us');\n Config::set('jiminny.google_text_host', 'txt.jiminny.com');\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $syncMethod = $reflection->getMethod('sync');\n $syncMethod->setAccessible(true);\n\n $result = $syncMethod->invoke($service);\n\n $this->assertIsArray($result);\n }\n\n\n public function testGetHistoryWithPagination(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $historyResponse1 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse1->historyId = 12345;\n $historyResponse1->method('getHistory')->willReturn([]);\n $historyResponse1->method('getNextPageToken')->willReturn('next-page-token');\n\n $historyResponse2 = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse2->historyId = 12346;\n $historyResponse2->method('getHistory')->willReturn([]);\n $historyResponse2->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')\n ->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12346, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $mockService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $mockService->users = $users;\n\n $historyResponse = $this->createMock(\\Google\\Service\\Gmail\\ListHistoryResponse::class);\n $historyResponse->historyId = 12345;\n $historyResponse->method('getHistory')->willReturn([]);\n $historyResponse->method('getNextPageToken')->willReturn(null);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willReturn($historyResponse);\n $mockService->users_history = $usersHistory;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $mockService;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->getHistory($mockService);\n\n $this->assertIsArray($result);\n }\n\n public function testGetHistoryHandlesException(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n Config::set('jiminny.google_text_relay_topic', 'test-topic');\n\n $service = $this->createTextRelayService();\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $usersHistory = $this->createMock(\\Google\\Service\\Gmail\\Resource\\UsersHistory::class);\n $usersHistory->method('listUsersHistory')->willThrowException(new \\Exception('API error'));\n $gmailService->users_history = $usersHistory;\n\n \\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);\n \\Sentry::shouldReceive('captureException')->once();\n\n $result = $service->getHistory($gmailService);\n\n $this->assertIsArray($result);\n $this->assertEmpty($result);\n }\n\n public function testSetHistoryPoint(): void\n {\n $service = $this->createTextRelayService();\n\n \\Cache::shouldReceive('put')->with('test-topic', 12345, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $reflection = new ReflectionClass($service);\n $method = $reflection->getMethod('setHistoryPoint');\n $method->setAccessible(true);\n\n $result = $method->invoke($service, 'test-topic', 12345);\n\n $this->assertInstanceOf(\\Carbon\\Carbon::class, $result);\n }\n\n public function testRefreshHistoryPoint(): void\n {\n Config::set('jiminny.google_text_user', 'test@example.com');\n\n $gmailService = $this->createMock(GoogleGmail::class);\n\n $watchResponse = $this->createMock(\\Google\\Service\\Gmail\\WatchResponse::class);\n $watchResponse->historyId = 99999;\n\n $users = $this->createMock(\\Google\\Service\\Gmail\\Resource\\Users::class);\n $users->method('watch')->willReturn($watchResponse);\n $gmailService->users = $users;\n\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n\n public function getService(string $mailbox): GoogleGmail\n {\n return $this->mockService;\n }\n\n public GoogleGmail $mockService;\n };\n $service->mockService = $gmailService;\n\n \\Cache::shouldReceive('put')->with('test-topic', 99999, \\Mockery::on(fn ($expires) => $expires instanceof \\Carbon\\Carbon));\n\n $result = $service->refreshHistoryPoint('test-topic');\n\n $this->assertSame(99999, $result);\n }\n\n public function testGetService(): void\n {\n $service = $this->createTextRelayService();\n\n $result = $service->getService('test@example.com');\n\n $this->assertInstanceOf(GoogleGmail::class, $result);\n }\n\n private function createTextRelayService(): TextRelayService\n {\n $service = new class () extends TextRelayService {\n public function __construct()\n {\n }\n };\n\n return $service;\n }\n\n public function testConstructorThrowsWhenCredentialsMissing(): void\n {\n $this->expectException(\\Illuminate\\Contracts\\Container\\BindingResolutionException::class);\n $this->expectExceptionCode(422);\n\n new TextRelayService();\n }\n\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Execute","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Explain Plan","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Browse Query History","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"View Parameters","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Open Query Execution Settings…","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"In-Editor Results","depth":4,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
3749704438949665158
|
-816169308791850074
|
idle
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
Analyzing…
Previous Highlighted Error
Next Highlighted Error
<?php
declare(strict_types=1);
namespace Tests\Unit\Services\Mail;
use Google\Service\Gmail as GoogleGmail;
use Google\Service\Gmail\Message as GmailMessage;
use Google\Service\Gmail\MessagePart;
use Google\Service\Gmail\MessagePartHeader;
use Illuminate\Support\Facades\Config;
use Jiminny\Services\Mail\TextRelayService;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\DataProvider;
use Tests\TestCase;
use ReflectionClass;
use Mockery;
#[CoversClass(TextRelayService::class)]
class TextRelayServiceTest extends TestCase
{
public static function environmentProvider(): array
{
return [
'eu_environment' => ['eu', '[EMAIL]'],
'us_environment' => ['us', '[EMAIL]'],
'other_environment_defaults_to_us' => ['other', '[EMAIL]'],
];
}
protected function setUp(): void
{
parent::setUp();
}
protected function tearDown(): void
{
Mockery::close();
parent::tearDown();
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = $expectedRecipient;
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertTrue($result);
}
#[DataProvider('environmentProvider')]
public function testIsForCurrentEnvironmentWithNonMatchingXGmOriginalToHeader(string $deployRegion, string $expectedRecipient): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'X-Gm-Original-To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', $expectedRecipient);
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentIgnoresToHeader(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$header = $this->createMock(MessagePartHeader::class);
$header->name = 'To';
$header->value = '[EMAIL]';
$payload->method('getHeaders')->willReturn([$header]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithEmptyHeaders(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$message = $this->createMock(GmailMessage::class);
$payload = $this->createMock(MessagePart::class);
$payload->method('getHeaders')->willReturn([]);
$message->method('getPayload')->willReturn($payload);
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')->willReturn($message);
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testIsForCurrentEnvironmentWithException(): void
{
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
$usersMessages = $this->createMock(\Google\Service\Gmail\Resource\UsersMessages::class);
$usersMessages->method('get')
->willThrowException(new \Exception('Gmail API error'));
$gmailService = $this->createMock(GoogleGmail::class);
$gmailService->users_messages = $usersMessages;
$service = $this->createTextRelayService();
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('isForCurrentEnvironment');
$method->setAccessible(true);
$result = $method->invoke($service, $gmailService, 'catch-all', 'msg123', '[EMAIL]');
$this->assertFalse($result);
}
public function testSyncUsesEuAliasForEuRegion(): void
{
Config::set('jiminny.deploy_region', 'eu');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testSyncUsesUsAliasForUsRegion(): void
{
Config::set('jiminny.deploy_region', 'us');
Config::set('jiminny.google_text_host', 'txt.jiminny.com');
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$syncMethod = $reflection->getMethod('sync');
$syncMethod->setAccessible(true);
$result = $syncMethod->invoke($service);
$this->assertIsArray($result);
}
public function testGetHistoryWithPagination(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$historyResponse1 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse1->historyId = 12345;
$historyResponse1->method('getHistory')->willReturn([]);
$historyResponse1->method('getNextPageToken')->willReturn('next-page-token');
$historyResponse2 = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse2->historyId = 12346;
$historyResponse2->method('getHistory')->willReturn([]);
$historyResponse2->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')
->willReturnOnConsecutiveCalls($historyResponse1, $historyResponse2);
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12346, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
}
public function testGetHistoryCallsRefreshHistoryPointWhenNoHistory(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$mockService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$mockService->users = $users;
$historyResponse = $this->createMock(\Google\Service\Gmail\ListHistoryResponse::class);
$historyResponse->historyId = 12345;
$historyResponse->method('getHistory')->willReturn([]);
$historyResponse->method('getNextPageToken')->willReturn(null);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willReturn($historyResponse);
$mockService->users_history = $usersHistory;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $mockService;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(false);
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->getHistory($mockService);
$this->assertIsArray($result);
}
public function testGetHistoryHandlesException(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
Config::set('jiminny.google_text_relay_topic', 'test-topic');
$service = $this->createTextRelayService();
$gmailService = $this->createMock(GoogleGmail::class);
$usersHistory = $this->createMock(\Google\Service\Gmail\Resource\UsersHistory::class);
$usersHistory->method('listUsersHistory')->willThrowException(new \Exception('API error'));
$gmailService->users_history = $usersHistory;
\Cache::shouldReceive('get')->with('test-topic')->andReturn(10000);
\Sentry::shouldReceive('captureException')->once();
$result = $service->getHistory($gmailService);
$this->assertIsArray($result);
$this->assertEmpty($result);
}
public function testSetHistoryPoint(): void
{
$service = $this->createTextRelayService();
\Cache::shouldReceive('put')->with('test-topic', 12345, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$reflection = new ReflectionClass($service);
$method = $reflection->getMethod('setHistoryPoint');
$method->setAccessible(true);
$result = $method->invoke($service, 'test-topic', 12345);
$this->assertInstanceOf(\Carbon\Carbon::class, $result);
}
public function testRefreshHistoryPoint(): void
{
Config::set('jiminny.google_text_user', '[EMAIL]');
$gmailService = $this->createMock(GoogleGmail::class);
$watchResponse = $this->createMock(\Google\Service\Gmail\WatchResponse::class);
$watchResponse->historyId = 99999;
$users = $this->createMock(\Google\Service\Gmail\Resource\Users::class);
$users->method('watch')->willReturn($watchResponse);
$gmailService->users = $users;
$service = new class () extends TextRelayService {
public function __construct()
{
}
public function getService(string $mailbox): GoogleGmail
{
return $this->mockService;
}
public GoogleGmail $mockService;
};
$service->mockService = $gmailService;
\Cache::shouldReceive('put')->with('test-topic', 99999, \Mockery::on(fn ($expires) => $expires instanceof \Carbon\Carbon));
$result = $service->refreshHistoryPoint('test-topic');
$this->assertSame(99999, $result);
}
public function testGetService(): void
{
$service = $this->createTextRelayService();
$result = $service->getService('[EMAIL]');
$this->assertInstanceOf(GoogleGmail::class, $result);
}
private function createTextRelayService(): TextRelayService
{
$service = new class () extends TextRelayService {
public function __construct()
{
}
};
return $service;
}
public function testConstructorThrowsWhenCredentialsMissing(): void
{
$this->expectException(\Illuminate\Contracts\Container\BindingResolutionException::class);
$this->expectExceptionCode(422);
new TextRelayService();
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results...
|
85469
|
NULL
|
NULL
|
NULL
|
|
85470
|
2929
|
5
|
2026-05-28T12:37:16.249381+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971836249_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
rapstomEV favscojs ~v Salesforc> Fields• Opport rapstomEV favscojs ~v Salesforc> Fields• OpportunityMatcherOpportunitySyncStrateProspectSearchStrateg• 5 ServiceTraits© ClientTest.phpC DecorateActivityTest.pC DeleteObjects TraitTestC FieldDefinitionsTest.ph© GetActivityFieldNamet@ PayloadBullder Test.ph/@ QueryBullderTest.phpQueryHandlerTest.phoC QueryiteratorTest.phpTAQYc Querykcsu stesione© ServiceTest.php181 %, )c) Suncta chredk Servic© BaseServiceTest.php@ CachedCrmSenvice Dacor 212 €243 €C FadV. tacouererte© LayoutManagerTest.phpC MigrateProviderServiceTeC OpportunityActivityMatchyC OpportunitySyncStrategyf© ProspectCacheTest.php© ProspectSearchStrategye:G ProviderRegistryTest.php© RecordSelectorTest.pho© ResolveCompanyNameByl© TimePerioditeratorTest.ph© UpdateCrmDataResclverT>Ea Internal> •Kioskwiewar› @Actions› @Office› E Resolvers→D traits› E Validators© BatchServiceTest.php26%.©EmailActivityServiceTest.f268C inboxServiceTest.phpo meytcalavsemceltestood› MeetingGenerator>M NotificationOAeindi.oneE customlogA console (STAGING)E Iaravel.logA SF (iminny@localhost)HS.Jocal ([iminny@localhost)A console (PROD) x © Service,phpA console (EU?TXAutoAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numbenORDER BY sns_count DESC;701public function testIsForCurrentEnvironnentWithMatchingXGn0riginalToHeader(string $deployRegion, string 702#[DataProvider('environmentProvider')]public function testIsForCurrentEnvironnentWithNonMatchingX6n0riginalToHeader(string SdeployRegion,select * fron teans where id = 1;select x fron roles;public function testIsForCurrentEnvironnentIgnoresToHeader(): void{...}public function testIsForCurrentEnvironnentWithEnptyHeaders(): voidf...}public function testIsForCurrentEnvironnentWithException(): voidf...045 A1 A41 У 66 4Tomorsert my coooleencnoswexteehyconvonmorseomyooodleeneinevooSgnailService = Sthis-›createMock( originalClassName: G00gLeGmail::class);\6oogle\Service\Gnat2 Message: :class);Shistory-›nessagesAdded = [(object) ['nessage' => Snessage]]:730731ShistoryResponse = Sthis-›createMock( originalClassName:16oogi01Soryice \6nast1| L/6thstoryßesponse: /6/2753ShistoryResponse-method( constraint: "getHistory*)-›willReturn([ShistoryD)=ShistoryResponse->method(con*getNextPageToken')->wil1Return( value: nutl);SusersHistory = Sthis->createMock( origina/ClassName:\600gle\Service\Gmail\Resource\UsersHistory::0)SusersHistory->method( constraint: 'ListUsersHistory')->willReturn(ShistoryResponse);SusersMessages = Sthis->createMock( origina/ClassName: \600gLe\Service\Gmail\Resource\UsersMessages::011743SgnailMessage = Sthis->createMock( originalClassName: GnailMessage::class);Spayload = Sthis->createMock( originalClassName: MessagePart::class);Sheader = Sthis->createMock( originalClassName: MessagePartHeader::class):Sheader-›value = 'cttchokQaBtxtJ1 e Accept Fle x~Spayload->nethod( const# JOIN activities a ON fd.activity id = a.idWHERE activity_id = 79933459# AND f.crn_provider_id = 'hs_activity_type':SELECT * FROM activity_messages;select * fron text_relays where created_at > '2826-85-01':select * fron activities where user_id IN (7160, 18688) and created_at > '2026-05-22' order by id desc:select * fron userswhere tean_id = 1 and id IN (18688, 13934, 7160);select * fron activities where user_id = 7160 order by id desc linit 10;select * fron users where name Like "XSubraX"; # 31854, 1117select * fron teans where id = 1117;select x fron activity_searches where user_id = 31854;ps100%LXThu 28 May 15:37:15axineainealieir+0.continue© docker exec docker_lamp_1 php artisan test -filter TextRelayServiceTestctruncated 208 lines>turedservices Teate-coelete and ers ChurnlDeleteTnboxesHand erTest. MetadotaIwill no longer be supported in PHPUnit 12. Update yourTestau Meredstr found ea doe-content tor Clsschurn|DeleteMonentsHand lerTest, MetadataThought for 1sD TextRelayServiceTest.php418-o oocker exec docker lahooho dresineseeexkwwees«truncated 210 lines>Tor Classe dattaotoet Mtador!ents is deprecated and wili no longer be supported in PHPUnit 12. Update yourtest code to use attributes instead.TestA Metfound en doc-comment for ClasshurmlDeletePlaybsckThenesHondlerTestThought for 1sD TextRelayServiceTest.php+58 -43o docker exec docker lano sl ono artasian test etilter TextRelavservice rest<truncated 447 lines>vendor/phpunit/phpuntt/SrC/Franevork/Mock0bject/Generator/MockClass.php:51члn!public function generatel): stringexists(Sthis-snockNane, false)) ‹TextRelayServicotest.ohgThought for 3s1tile +234>Accept allAsk anything (XOL)"PodswiothKowodeu Taimeehi.%2 4 spac...
|
NULL
|
-3158651498774593575
|
NULL
|
idle
|
ocr
|
NULL
|
rapstomEV favscojs ~v Salesforc> Fields• Opport rapstomEV favscojs ~v Salesforc> Fields• OpportunityMatcherOpportunitySyncStrateProspectSearchStrateg• 5 ServiceTraits© ClientTest.phpC DecorateActivityTest.pC DeleteObjects TraitTestC FieldDefinitionsTest.ph© GetActivityFieldNamet@ PayloadBullder Test.ph/@ QueryBullderTest.phpQueryHandlerTest.phoC QueryiteratorTest.phpTAQYc Querykcsu stesione© ServiceTest.php181 %, )c) Suncta chredk Servic© BaseServiceTest.php@ CachedCrmSenvice Dacor 212 €243 €C FadV. tacouererte© LayoutManagerTest.phpC MigrateProviderServiceTeC OpportunityActivityMatchyC OpportunitySyncStrategyf© ProspectCacheTest.php© ProspectSearchStrategye:G ProviderRegistryTest.php© RecordSelectorTest.pho© ResolveCompanyNameByl© TimePerioditeratorTest.ph© UpdateCrmDataResclverT>Ea Internal> •Kioskwiewar› @Actions› @Office› E Resolvers→D traits› E Validators© BatchServiceTest.php26%.©EmailActivityServiceTest.f268C inboxServiceTest.phpo meytcalavsemceltestood› MeetingGenerator>M NotificationOAeindi.oneE customlogA console (STAGING)E Iaravel.logA SF (iminny@localhost)HS.Jocal ([iminny@localhost)A console (PROD) x © Service,phpA console (EU?TXAutoAND a.created_at > DATE_SUB(NOW(), INTERVAL 30 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numbenORDER BY sns_count DESC;701public function testIsForCurrentEnvironnentWithMatchingXGn0riginalToHeader(string $deployRegion, string 702#[DataProvider('environmentProvider')]public function testIsForCurrentEnvironnentWithNonMatchingX6n0riginalToHeader(string SdeployRegion,select * fron teans where id = 1;select x fron roles;public function testIsForCurrentEnvironnentIgnoresToHeader(): void{...}public function testIsForCurrentEnvironnentWithEnptyHeaders(): voidf...}public function testIsForCurrentEnvironnentWithException(): voidf...045 A1 A41 У 66 4Tomorsert my coooleencnoswexteehyconvonmorseomyooodleeneinevooSgnailService = Sthis-›createMock( originalClassName: G00gLeGmail::class);\6oogle\Service\Gnat2 Message: :class);Shistory-›nessagesAdded = [(object) ['nessage' => Snessage]]:730731ShistoryResponse = Sthis-›createMock( originalClassName:16oogi01Soryice \6nast1| L/6thstoryßesponse: /6/2753ShistoryResponse-method( constraint: "getHistory*)-›willReturn([ShistoryD)=ShistoryResponse->method(con*getNextPageToken')->wil1Return( value: nutl);SusersHistory = Sthis->createMock( origina/ClassName:\600gle\Service\Gmail\Resource\UsersHistory::0)SusersHistory->method( constraint: 'ListUsersHistory')->willReturn(ShistoryResponse);SusersMessages = Sthis->createMock( origina/ClassName: \600gLe\Service\Gmail\Resource\UsersMessages::011743SgnailMessage = Sthis->createMock( originalClassName: GnailMessage::class);Spayload = Sthis->createMock( originalClassName: MessagePart::class);Sheader = Sthis->createMock( originalClassName: MessagePartHeader::class):Sheader-›value = 'cttchokQaBtxtJ1 e Accept Fle x~Spayload->nethod( const# JOIN activities a ON fd.activity id = a.idWHERE activity_id = 79933459# AND f.crn_provider_id = 'hs_activity_type':SELECT * FROM activity_messages;select * fron text_relays where created_at > '2826-85-01':select * fron activities where user_id IN (7160, 18688) and created_at > '2026-05-22' order by id desc:select * fron userswhere tean_id = 1 and id IN (18688, 13934, 7160);select * fron activities where user_id = 7160 order by id desc linit 10;select * fron users where name Like "XSubraX"; # 31854, 1117select * fron teans where id = 1117;select x fron activity_searches where user_id = 31854;ps100%LXThu 28 May 15:37:15axineainealieir+0.continue© docker exec docker_lamp_1 php artisan test -filter TextRelayServiceTestctruncated 208 lines>turedservices Teate-coelete and ers ChurnlDeleteTnboxesHand erTest. MetadotaIwill no longer be supported in PHPUnit 12. Update yourTestau Meredstr found ea doe-content tor Clsschurn|DeleteMonentsHand lerTest, MetadataThought for 1sD TextRelayServiceTest.php418-o oocker exec docker lahooho dresineseeexkwwees«truncated 210 lines>Tor Classe dattaotoet Mtador!ents is deprecated and wili no longer be supported in PHPUnit 12. Update yourtest code to use attributes instead.TestA Metfound en doc-comment for ClasshurmlDeletePlaybsckThenesHondlerTestThought for 1sD TextRelayServiceTest.php+58 -43o docker exec docker lano sl ono artasian test etilter TextRelavservice rest<truncated 447 lines>vendor/phpunit/phpuntt/SrC/Franevork/Mock0bject/Generator/MockClass.php:51члn!public function generatel): stringexists(Sthis-snockNane, false)) ‹TextRelayServicotest.ohgThought for 3s1tile +234>Accept allAsk anything (XOL)"PodswiothKowodeu Taimeehi.%2 4 spac...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85469
|
2928
|
4
|
2026-05-28T12:37:13.906468+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971833906_m1.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
6423983795013307969
|
-3852565242246887264
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
iTerm2• • 0ShellEditViewSessionScripts|ProfilesWindowHelp-zshDOCKERO ₴1DEV (docker)₴82-zshN3screenpipe"O ₴4-zshapp/Component/ES/Repositories/EsResetActivityRepository.phpapp/Component/KeyPoints/Services/KeyPointsIndexingService.php348+++app/Component/TranscriptionSummary/Services/GetTranscriptionSummaryService.phpapp/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpapp/Models/Activity/Moment.phpapp/Models/Activity/Note.php402116app/Models/CommentAbstract.php++++app/Models/Crm/FieldData.phpapp/Models/ElasticSearch/ActivityElasticSearchTrait.php651+++++++=app/Models/Participant.phpapp/Traits/RequiresUUID.php5scripts/run_command_stagetests/Unit/Component/ActionItems/Services/ActionItemsIndexingServiceTest.phptests/Unit/Component/KeyPoints/Services/GetKeyPointsServiceTest.phptests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phptests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.php71346976++++++++++17 files changed, 472 insertions(+), 22 deletions(-)create mode 100644 app/Component/ActionItems/Services/ActionItemsIndexingService.phpcreate mode 100644 app/Component/KeyPoints/Services/KeyPointsIndexingService.phpcreate mode 100644 app/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingService.phpcreate mode 100644 tests/Unit/Component/ActionItems/Services/ActionItemsIndexingServicelest.phpcreate mode 100644 tests/Unit/Component/KeyPoints/Services/KeyPointsIndexingServiceTest.phpcreate mode 100644 tests/Unit/Component/TranscriptionSummary/Services/TranscriptionSummaryIndexingServiceTest.phplukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~/jiminny/app (master) $ ;xddocker exec-it docker_lamp_1 bash -c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"What's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity) $ ;xddockerexec-it docker_lamp_1 bash-c "mv /usr/local/etc/php/conf.d/xdebug.ini ~/xdebug.ini"mv: cannot stat '/usr/local/etc/php/conf.d/xdebug.ini': No such file or directoryWhat's next:Try Docker Debug for seamless, persistent debugging tools in any container or image → docker debug docker_lamp_1Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20963-fix-import-on-deleted-entity)$D‹>0 (|85ec2-user@ip-10-30-129-...100% <78• Thu 28 May 15:37:131₴1ec2-user@ip-10-30-140-...₴7...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
85468
|
2929
|
4
|
2026-05-28T12:36:44.378158+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-28/1779 /Users/lukas/.screenpipe/data/data/2026-05-28/1779971804378_m2.jpg...
|
PhpStorm
|
faVsco.js – TextRelayServiceTest.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"bounds":{"left":0.025930852,"top":0.019952115,"width":0.03856383,"height":0.025538707},"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"#12121 on JY-20963-fix-import-on-deleted-entity, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.11569149,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12121 exists for current branch JY-20963-fix-import-on-deleted-entity","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Start Listening for PHP Debug Connections","depth":5,"bounds":{"left":0.8374335,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"TextRelayServiceTest","depth":6,"bounds":{"left":0.85272604,"top":0.019952115,"width":0.062832445,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9155585,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'TextRelayServiceTest'","depth":6,"bounds":{"left":0.9268617,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"More Actions","depth":6,"bounds":{"left":0.9381649,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"JetBrains AI","depth":5,"bounds":{"left":0.96609044,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Search Everywhere","depth":5,"bounds":{"left":0.9773936,"top":0.019952115,"width":0.011303191,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"IDE and Project Settings","depth":5,"bounds":{"left":0.9886968,"top":0.019952115,"width":0.011303186,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Sync Changes","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide This Notification","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":false,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Code changed:","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.042220745,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Hide","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.008643617,"height":0.0},"on_screen":false,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5091835203192983291
|
-8776159844266423872
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12121 on JY-20963-fix-im Project: faVsco.js, menu
#12121 on JY-20963-fix-import-on-deleted-entity, menu
Start Listening for PHP Debug Connections
TextRelayServiceTest
Run 'TextRelayServiceTest'
Debug 'TextRelayServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
rapstomFV faVsco.|s ~Proinet vv Salestorg>ImFelde• # OpportunityMatcherOpportunitySyncStratetprosoicnsudie"# ServiceTraitsClientTest.phpDecorateActivityTest.p© DeleteObiectsTraitTest© FieldDefinitionsTest.ph© GetActivityFieldNameTPayfoadBuilderTest.phgQueryBullderTest.phoQueryHandlerTest.pho© QuerviteratorTest.phoTAQYc) Querykcsu stesioneC ServiceTest.phoc) Suncta chredk Servic@ CachedCrmSenvice Dacor 212 €243 €C FadV. tacouererte© LayoutManagerTest.phpMiarateProv derSendcaleOnnortun tvA chivirlatchOnnortun tSwncStrateovtProsnactCachatast ohoProsnaetSaarchStrataaufProvida Pacistr Tast nhoRacoriSalactorTast oho2 pasolucComoanyNameBylTim/OheatAetateAh© UpdateCrmDataResolverTwlathrndsha Kioskwiewar>bActions>& Office› Ea Resolvers>&a Traits› Ea Validators© BatchServiceTest.cho@ EmailActivitvServiceTestC InboxServiceTest.cho@ TeytRelavSerdceTest.ohol>M MeetinaGeneraton>M Notification266TextRelayServiceTestActivityController.php=custom.loglaravel.logA SF fiminny@localhost)HSJocal (jiminny@blocalhost)d console (PROD) x C Service.php# console fiaumOAeindi.oneA console (STAGING)Cass exkelayseru celes exteno701public function testisForcurrentenvironnentasthHatchingx6n0riginalToHeader(string SdeployRegion, string 780#[DataProvider('environmentProvider")public function testisForcurrentenvironnent#_thNonMatchingX6n0riginalToHeader(string SdeployRegion,— 78%786public function testisForcurrentenvironnent.gnoresToHeader: voidt....public function testisForCurrentenvironnent@ithEnptyHeaders: voidt...,public function testisForCurrentenvironnent#ithexception: void...public function testSyncUsesUsALiasForUsRegion: voidi...;RejectConfio::set("jiminny, aoogle text hostwexteehyconconorseormny.0000l0xSservice = Sthis->createTextRelayServiceSoogle Serusicel ohael Mesgage:sclass).Shistory & Sthis->eresrelackl ondClassName: \Gooale| Service| Gaaf1A Historvesclase):Shistonv->nessngosAdded = f(obfect) ('nessnac' => Seassaoel1:ShistoryResponse = Sthis-›createMock( origina)ShistorvResponse-shistorvld = 12345:N6oost.01 Servite 6est1) ListHstoryßespons: 10 /8 753'getHistory")-›willReturn( ShistoryD:getNextPageToken')->wilPetuen( values hia).737SusersHistory = Sthis-›createMock( originalClassName: \G00gle\Service|Gmail\Resource\ UsersHistory::clasi7"ListUsersHistory')-›willReturn(ShistoryResponse);SqnailMessage = Sthis->createMock( originalClassName: 6nai(Message::class):Cneulhod - Cthle, Sanootolaaut ohinsioisclamy MoccanaDonterAloGe)Sheader = Sthis->createMock( orig)Shoadon, Shond C ly.A nelhiantoAND a.created_at > DATE_SUB(NOW), INTERVAL 38 DAY)GROUP BY u.id, u.email, u.name, u.softphone_numbenORDER BY sns_count DESC:045 A1 A41 У 66 4select * fron teans where id = 1select * fron roles.SELECTCONCAT(u.id, CASE WHEN u.id = t.ouner_id THEN ' (ouner)' ELSE "* END) AS user_id,sa.*,SELECT * FROM CM,field_data fdIGYM eon fiolde & AM Gilone Giold 1d=61.aiM netusthe nu Eh nAtdudtudasWHERE activity_id = 79933459= AND f.crn_provider id = 'hs activity type':SELECT * FROM activity_messages;select * fron text relavs where created at > :2826-85-81*:select * fron actavitles where usen id IN (7168, 18688) and created at > 12026-05-22' order by id desciselect * fron users.where tean id = 1 and $id TN (18688, 13934, 7160):usen 1d = 7168 order by id desc tinit 10.select * fron users where nane like "XSubrax"; # 31854, 1117select * fron teans where $d = 1117:select * fron actávity scanches nhere user $d = 316541O0% LXThu 28 May 15:36:44+0•continuraxineainealieir@ docker exec docker lamp 1 php artisan test -filter TextRelayServiceTestctruncated 208 lines>Testau Meredstr found ea doe-content tor Clsschurn|DeleteMonentsHand lerTest, MetadataThought for 1sTextRelayServiceTest.php418-ooocker exec docker lanoono dreSaneseeexwwweesCrineateirloinessTests|Featurelasse ectlafatoet Mtoiorand will no longer be supported in PHPUnit 12. Uodate youteet code to use attributee sinstendiTesta e turedstrcusteamtoe-coetentrfor.eFrChurn/DeteteP1aybockThonesHondlerTest.Thought for 1sTextRelayServiceTest.phpARA.AO docker exec docker ano s oho artasan test enilter TextRe avservice esses oata no Ae ia doceyeiet ser eactivityana tyciesservicelest: ;testcalculasupported in PHPloit 12. Hlodate vour test code to use attributes SosteadTests UnitiCodponenovActin tysearcNAc ty dosesrch Ei tor elinition\TalkTimeRatioTest, Motadata in doc-1 tile +222Accept allack snuthine (XoLo PodeswiettKtwodeutasmet4 spl...
|
85466
|
NULL
|
NULL
|
NULL
|