|
34057
|
1283
|
25
|
2026-05-13T10:52:20.897627+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778669540897_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error...
|
[{"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":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","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":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","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}]...
|
-450465925813430775
|
-8204428040203031614
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
FinderFileEditViewGoWindowHelp•DOCKERX t1DOCKER (docker-compose)docker_lamp_1'/proc/1/fd/1'docker_1amp_1181DEV (docker)₴82'/usr/local/bin/php' 'artisan'jiminny:transcription:retry-failed >2026-05-13 10:51:32 Running['artisan'crm: reset-governor]docker_lamp_1 |L '/usr/local/bin/php' 'artisan2>&1crm: reset-governor>*/proc/1/fd/1docker_lamp_10 social2026-05-13 10:51:42 Running ['artisan'account(s) to be processedcrm:bullhorn:ping--heartbeat]docker_lamp_1docker_lamp_1docker_lamp_11 Done!5s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' crm:bullhorn:ping --heartbeat › '/proc/1/fd/1'2>&1docker_lamp_1docker_lamp_1run_artisan_schedule: Done waiting for schedule:rundocker_lamp_1docker_lamp_12026-05-13 10:52:02 Running ['artisan' meeting-bot:schedule-bot]4s DONEdocker_lamp_1 | '/usr/local/bin/php' 'artisan'meeting-bot: schedule-bot › '/proc/1/fd/1'2>&1docker_lamp_12026-05-13 10:52:07 Running ['artisan' dialers:monitor-activities].2S DONEdocker_1amp_11 '/usr/local/bin/php' 'artisan' dialers:monitor-activities › */proc/1/fd/1'docker_lamp_12026-05-13 10:52:10 Running ['artisan' jiminny:monitor-social-accounts]2s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > */proc/1/fd/1'2>&1docker_lamp_12026-05-13 10:52:13 Running ['artisan' mailbox:skip-lists:refresh] •2S DONEdocker_lamp_11 l '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh › */proc/1/fd/1' 2>&1docker_1amp_12026-05-13 10:52:16 Running ['artisan'mailbox:batch:process --max-batches=15]2sDONEdocker_lamp_11 '/usr/local/bin/php' 'artisan'mailbox:batch:process --max-batches=15 >*/proc/1/fd/1' 2>&1docker_lamp_112026-05-13 10:52:18 Running ['artisan'conference:monitor: count]IS DONEdocker_lamp_11 l '/usr/local/bin/php' 'artisan' conference:monitor:count › '/proc/1/fd/1' 2>&1.PROD (ssh)APP (-zsh)> 0lth)Support Daily • in 1h 8 mA-zsh84PROD (ssh)'do-release-upgrade' to upgrade to it.100% <78• Wed 13 May13:52:20181screenpipe"О ₴5PRODView in Docker Desktopo View Configw Enable Watch*** System restart required ***Last login: Tue May 12 07:53:08 2026 from 212.5.153.87lukas@jiminny-prod-bastion:~$ 0X T3 EU (-zsh)Last login: Tue May 12 17:54:40on consolePoetry could not find a pyproject.toml file in /Users/lukas or its parentsPoetry could not find a pyproject.tomlfile in /Users/lukas or its parentsukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|T4STAGE (-zsh)Last login: Tue May 12 17:54:40 on consolePoetry could not find a pyproject.toml file in /Users/lukas or its parentsSTAGEPoetry could not find a pyproject.toml file in /Users/lukas or its parentslukas@Lukas-Kovaliks-MacBook-Pro-Jiminny|$T5 QA (-zsh)Last login: Tue May 12 20:12:05 on ttys001Poetry could not find a pyproject.toml file in /Users/lukas or its parentsPoetry could not find a pyproject.toml file in /Users/lukas or its parents$ 016FE (-zsh)Last login: Tue May 12 20:12:05 on ttys001Poetry could not find a pyproject.tomlfile in /Users/lukas or its parentsFRONTENDPoetry could notfind a pyproject.toml file in /Users/lukas or its parentsLukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lX 27 EXT (-zsh)Poetry could not find a pyproject.toml file in /Users/lukas or its parentsEXTENSIONPoetrycould not find a pyproject.tomlfile in /Users/lukas or its parentsLukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ l...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
34058
|
1284
|
19
|
2026-05-13T10:52:20.897668+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778669540897_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
master, 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":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-7673782238848625796
|
-8646559087753982588
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
master, menu
PhostormVIew Project: faVsco.js, menu
master, menu
PhostormVIewINavigareCodeLaravelKeractorFV faVsco.js?9 master kProiectC CreateTeam.pnp7 CalendarsC) TextRelayService.onp© EmailTextRelay.phpD Crmclass Smsrelayralled extends Mallable 1mpleDealRisksD ElasticSearchDoroups> @ Import> @ Mailbox|v @ Nudges>@ UserPilot© CreateNudgeCreatedE> C Opportunitiesv _ Playbooks© AttachLayout.phpc) Changesidekickseuingv D Plavlists> Activitiesv Planhat© CreateActivitvAdde 20→hUserPilot@ ImportGroupPlavlistSh, M TeamsM Transcritionv MUsers@ ActivitvProviderDiscon© ActivityProviderintegra9 CresteDefaultDlavlistr(C) CroateDefaultSavedSeC) DeleteScheduledllcer/9) NotifvCrmOwnerDiccon NotifuCrml Icorhicconr(G) Cothofault Avntarl ictor© SetupCalendarSync.phseluomallsync.ono© SyncIntercom.php© SyncPlanhat.php© SyncUserPilot.php© ValidateSendingMessal© ValidateSendingNotific> MWebhookEgitkeep© ChangeLoaConteytCorrel 50v D Mailv ActivitiesC) SxoortLink oho@ MailRoyFailed ToConne 54(c) SmcReceived.nhn© SmsRelayFailed.php(C) TrackRectored nhn> M Calendarsits Shoulduueueuse Uueueable:use Ser1alizesmodels:* The Actvitu instance.* @vac TextRelayLusdgespublic StextRelay;public Sreason;public Scode;* SmsRelayFailed constructor.public function construct(TextRelay $textRelay, string Sreason, int Scode = 0)Sth1s->textkelay = stextkelay*sthis->reason = sreason:sthis->code = scode:* surld the message.oublic function buildo: staticSsubiect = "Your text message failed to send'?SorioinActivitv = sthis->textRelav->orioinActivity:if (SoriginActivity) {Sto = SoriainActivitv->nrosnect name 22 SoriainActivitv->to->national nhone number,Ssubject = I to1 Sto:return Sthis->view( view: 'emails.activities.ss-relay-failed')->subject(Ssubject)• Cutront Curound ( = :Donlt Chaw Toolhor(C) MailboxController.ohr=laravel.logA SF (jiminny@localhost]4 HS_local [jiminny@localhost]& console (PROD] X A console [EU]© TextRelay.phpA console [STAGING]A1A3.У Tx: AutoSo jiminnyJOIN calendars c ON c.user_id = V.id AND c.status = 'active' AND c.calendar_provider_id LItmLEFT JOIN team domains td040 A1 A40 V 64 ~ON to.team id = t.idAND td.deleted_at IS NULLAND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))GROUP BY t.id, t.name, calendar_domairORDER RY +.name.calendan domarn.select * from users u join calendars c 1<->1..n: on c.user_id = u.idwhere u.team_id = 882;select * from activities where id = 74049485; # team 563 crm 537select * from activities where id = 73272382: # team 563 crm 537select * from activities where id = 64400389: # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297: # team 563 crm 537select * from participants where activity id = 58081273:select * from activities where crm confiquration id = 537 and provider = 'aircalland account_id = 19003658 order by updated_at desc;select * from contacts where crm_configuration_id = 537 and id = 35957759;select * from accounts where crm confiquration id = 537 and id = 19003658:select * from automated report results where id = 1976:select * from automated_reports where id = 583;select * From activitv searches where 1d = 871144select * fron activity search filters where activity search id = 87714:SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidon uuid to bin'47842446-af51-4bch-854f-cc65602901019) = uuid:SFLECT * FROM com confiqurations WHERE provider = 'hubspot':select * from rate_limits;select * from automated report results where media type = 'pdf' and status = 2and id IN (18select * from automated reports where id = 54SELECT * FROM users WHERE id IN (24623,29443,29613) =Caccade ge 1alCommand 9e!JLECT * FROM automated report_ results WHERE uuid to bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid:colont d Enom tovt nolove whono Anootod od 19004.06,011."suppont Dally • In 1h om100% S2• Wed 13 May 13:52:20U AskJiminnyReportActivityServiceTest vcascadeTrial Owner Role SeleSMS Failure Email Inve+0 ..4. Send SMs via IW1l10Smessage = $messagingService->send($user, Sthis->to, $this->text);Sactivity = $messagingService->buildActivity(...);I/ 6. MarkSthis->textRelay→>update(['status' = TextRelay::STATUS_PROCESSED]):} catch (TextRelayException $e) {Send Tallure emall + Scott received th1sMaile«to(Ssender)-squeue(new SmsRelavFailed(...))•catch Excention Se) <// Log to Sentry onlySentry:: captureException(se:A Validation Iocic (checkTntearitvo))Lines 247-336:phopravate tunctzon checkintegraty(600gLeomaz(Wessagerart Spayload)// Parse email bodySemal = new Emal Parsero)→>oarse(Sbody):steyt = Semail_saetVicibleText().(/ Check empty1t (Stext=1)<throw new TextRelavException('Message body is un-readable or empty.',self:: REASON CODE MESSAGE BODY EMPTY // 4100Svalidator = Validator::make(['data' => Stext]. ['data' = new SmsMessageO))):if (Svalidator→>fails()) {thrownew TextRelayException('Message body is too larae to send as an SMS."..celf.•pFACoN cOnE MECCAGE ROnY TOO LARGE 1/ 1900 ~ Ccottic code was 2000 in the email. bus/ Validate sender exists and has SMS permission5. Conficuration Requiredam iust wandering« Code SWF-1.6wWN Windsurf Teamo•0 (г]io 4 spaces...
|
34055
|
NULL
|
NULL
|
NULL
|
|
34059
|
1283
|
26
|
2026-05-13T10:52:26.043536+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778669546043_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
FinderFileEditViewGoWindowHelpPROD (ssh)APP (-zsh) FinderFileEditViewGoWindowHelpPROD (ssh)APP (-zsh)DOCKER181DEV (docker)₴82DOCKER (docker-compose)0socialaccount(s) to be processeddocker_lamp_1docker_1amp_1docker_lamp_1docker_lamp_1Done!5S DONE1 '/usr/local/bin/php'oc/1/fd/1'2>&1docker_lamp_1docker_1amp_1run_artisan_schedule: Done waiting forschedule:rundocker_lamp_1docker_lamp_12026-05-13 10:52:02 Running ['artisan'meeting-bot:schedule-bot]4s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan'meeting-bot: schedule-bot › */proc/1/fd/1'2>&1docker_1amp_12026-05-13 10:52:07 Running ['artisan' dialers:monitor-activities].2sDONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' dialers:monitor-activities › '/proc/1/fd/1'2>&1docker_lamp_1 | 2026-05-13 10:52:10 Running ['artisan'jiminny:monitor-social-accountdocker_lamp_1 | , '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts › '/proc/1/fd/1' 2>&1docker_lamp_112026-05-13 10:52:13 Running ['artisan'mailbox:skip-lists:refresh]2s DONEdocker_1amp_11 • '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh › '/proc/docker_lamp_1tches=15]1DONE2026-05-13 10:52:16 Running ['artisan'mailbox:batch:process --max-badocker_1amp_11 '/usr/local/bin/php' 'artisan' mailbox:batch:process --max-batches=15 > '/proc/1/fd/1' 2>&1docker_lamp_12026-05-13 10:52:18 Running ['artisan' conference:monitor:count] ...docker_lamp_11 '/usr/local/bin/php' 'artisan'conference:monitor: count > '/proc/1/docker_1amp_12026-05-13 10:52:20 Running ['artisan'mailbox:batch: create]docker_lamp_11 • '/usr/local/bin/php' 'artisan'mailbox:batch: create › '/proc/1/fd/1docker_1amp_12026-05-13 10:52:24 Running ['artisan' activity:sync 'ringcentral' 'avaya' 'telus' 'talkdesk' --from='2026-05-13 10:36:00' --to='2026-05-13 10:52:00']2026-05-13 10:52:25 Jiminny\Jobs\Mailbox\CreateBatchesRUNNING> 0(alo)= Support Daily • in 1h 8 mA&3-zsh84PROD (ssh)Run 'do-release-upgrade' to upgrade to it.100% C8• Wed 13 May13:52:25181screenpipe"О 85PRODView in Docker Desktopo View Configw Enable Watch*** System restart required ***Last login: Tue May 12 07:53:08 2026 from 212.5.153.87lukas@jiminny-prod-bastion:~$ 0X T3 EU (-zsh)Last login: Tue May 12 17:54:40on consolePoetry could not find a pyproject.toml file in /Users/lukas or its parentsPoetry could not find a pyproject.tomlfile in /Users/lukas or its parentsukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|X T4 STAGE (-zsh)Last login: Tue May 12 17:54:40 on consolePoetry could not find a pyproject.toml file in /Users/lukas or its parentsSTAGEPoetry could not find a pyproject.toml file in /Users/lukas or its parentslukas@Lukas-Kovaliks-MacBook-Pro-Jiminny$T5 QA (-zsh)Last login: Tue May 12 20:12:05 on ttys001Poetry could not find a pyproject.toml file in /Users/lukas or its parentsPoetry could not find a pyproject.toml file in /Users/lukas or its parents$ 0XT6FE (-zsh)Last login: Tue May 12 20:12:05 on ttys001Poetry could not find a pyproject.tomlfile in /Users/lukas or its parentsFRONTENDPoetry could notfind a pyproject.toml file in /Users/lukas or its parentsLukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lX 17 EXT (-zsh)Poetry could not find a pyproject.toml file in /Users/lukas or its parentsEXTENSIONPoetrycould not find a pyproject.tomlfile in /Users/lukas or its parentsLukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ l...
|
NULL
|
8983827314307366942
|
NULL
|
click
|
ocr
|
NULL
|
FinderFileEditViewGoWindowHelpPROD (ssh)APP (-zsh) FinderFileEditViewGoWindowHelpPROD (ssh)APP (-zsh)DOCKER181DEV (docker)₴82DOCKER (docker-compose)0socialaccount(s) to be processeddocker_lamp_1docker_1amp_1docker_lamp_1docker_lamp_1Done!5S DONE1 '/usr/local/bin/php'oc/1/fd/1'2>&1docker_lamp_1docker_1amp_1run_artisan_schedule: Done waiting forschedule:rundocker_lamp_1docker_lamp_12026-05-13 10:52:02 Running ['artisan'meeting-bot:schedule-bot]4s DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan'meeting-bot: schedule-bot › */proc/1/fd/1'2>&1docker_1amp_12026-05-13 10:52:07 Running ['artisan' dialers:monitor-activities].2sDONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' dialers:monitor-activities › '/proc/1/fd/1'2>&1docker_lamp_1 | 2026-05-13 10:52:10 Running ['artisan'jiminny:monitor-social-accountdocker_lamp_1 | , '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts › '/proc/1/fd/1' 2>&1docker_lamp_112026-05-13 10:52:13 Running ['artisan'mailbox:skip-lists:refresh]2s DONEdocker_1amp_11 • '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh › '/proc/docker_lamp_1tches=15]1DONE2026-05-13 10:52:16 Running ['artisan'mailbox:batch:process --max-badocker_1amp_11 '/usr/local/bin/php' 'artisan' mailbox:batch:process --max-batches=15 > '/proc/1/fd/1' 2>&1docker_lamp_12026-05-13 10:52:18 Running ['artisan' conference:monitor:count] ...docker_lamp_11 '/usr/local/bin/php' 'artisan'conference:monitor: count > '/proc/1/docker_1amp_12026-05-13 10:52:20 Running ['artisan'mailbox:batch: create]docker_lamp_11 • '/usr/local/bin/php' 'artisan'mailbox:batch: create › '/proc/1/fd/1docker_1amp_12026-05-13 10:52:24 Running ['artisan' activity:sync 'ringcentral' 'avaya' 'telus' 'talkdesk' --from='2026-05-13 10:36:00' --to='2026-05-13 10:52:00']2026-05-13 10:52:25 Jiminny\Jobs\Mailbox\CreateBatchesRUNNING> 0(alo)= Support Daily • in 1h 8 mA&3-zsh84PROD (ssh)Run 'do-release-upgrade' to upgrade to it.100% C8• Wed 13 May13:52:25181screenpipe"О 85PRODView in Docker Desktopo View Configw Enable Watch*** System restart required ***Last login: Tue May 12 07:53:08 2026 from 212.5.153.87lukas@jiminny-prod-bastion:~$ 0X T3 EU (-zsh)Last login: Tue May 12 17:54:40on consolePoetry could not find a pyproject.toml file in /Users/lukas or its parentsPoetry could not find a pyproject.tomlfile in /Users/lukas or its parentsukas-Kovaliks-MacBook-Pro-Jiminny ~ $ [|X T4 STAGE (-zsh)Last login: Tue May 12 17:54:40 on consolePoetry could not find a pyproject.toml file in /Users/lukas or its parentsSTAGEPoetry could not find a pyproject.toml file in /Users/lukas or its parentslukas@Lukas-Kovaliks-MacBook-Pro-Jiminny$T5 QA (-zsh)Last login: Tue May 12 20:12:05 on ttys001Poetry could not find a pyproject.toml file in /Users/lukas or its parentsPoetry could not find a pyproject.toml file in /Users/lukas or its parents$ 0XT6FE (-zsh)Last login: Tue May 12 20:12:05 on ttys001Poetry could not find a pyproject.tomlfile in /Users/lukas or its parentsFRONTENDPoetry could notfind a pyproject.toml file in /Users/lukas or its parentsLukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ lX 17 EXT (-zsh)Poetry could not find a pyproject.toml file in /Users/lukas or its parentsEXTENSIONPoetrycould not find a pyproject.tomlfile in /Users/lukas or its parentsLukas@Lukas-Kovaliks-MacBook-Pro-Jiminny ~ $ l...
|
34057
|
NULL
|
NULL
|
NULL
|
|
34060
|
1284
|
20
|
2026-05-13T10:52:26.003633+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778669546003_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhostormVIewINavigareCodeLaravelKeractorFV faVsco. PhostormVIewINavigareCodeLaravelKeractorFV faVsco.js?9 master kProiectC CreateTeam.pnp© MailboxController.php7 CalendarsC) TextRelayService.onp© EmailTextRelay.php© SmsLength.phpOlextkelay.onpD CrmDealRisksclass Smskelayralled extends Mallable 1mpleits ShoulduueueA1A3 АУD ElasticSearchDoroupsD Import> @ Mailbox|v @ Nudges>@ UserPilot© CreateNudgeCreatedE> C Opportunitiesv _ Playbooks© AttachLayout.phpc) Changesidekickseuingv D Plavlists> Activitiesv Planhat© CreateActivitvAdde 20→hUserPilot@ ImportGroupPlavlistSh, M TeamsM Transcritionv MUsers@ ActivitvProviderDiscon© ActivityProviderintegra9 CresteDefaultDlavlistr(C) CroateDefaultSavedSe(C) CroateGrounCroatedS@ DeleteScheduledlicert 379) NotifvCrmOwnerDicco00 NotifuCrml leorDicconr 39(G) Cothofault Avntarl ictar© SetupCalendarSync.pt© SetupMailSync.php© SyncIntercom.php© SyncPlanhat.php© SyncUserPilot.php© ValidateSendingMessal© ValidateSendingNotific> MWebhookEgitkeep© ChangeLoaContextCorrel 50v D Maillv Activities@ MailRoyFailed ToConne 54(c) SmcReceived.nhn© SmsRelayFailed.php(C) TrackRectored nhnM Calendarsuse Uueueable:use Serializesmodels:* The Actvitu instance.* @vac TextRelayLusdgespublic StextRelay;public Sreason;public Scode:* SmsRelayFailed constructor.public function construct(TextRelay $textRelay, string Sreason, int Scode = 0)Sth1s->textkelay = stextkelay*sthis->reason = sreason:sthis->code = scode:* surLd the messageoublic function buildo: staticSsubiect = "Your text message failed to send'?SorioinActivitv = sthis->textRelav->orioinActivity:if (SoriginActivity) {Sto = SoriainActivitv->nrosnect name 22 SoriainActivitv->to->national nhone numben•Ssubject = I to1 Sto:return Sthis->view( view: 'emails.activities.sms-relay-failed')->subject(Ssubject):= custom.log|aravel.l0gA SF (jiminny@localhost]4 HS_local [jiminny@localhost]& console (PROD] X A console [EU]A console [STAGING]637638-639640- ₴65966€6616626631662Tx: Auto vSo jiminnyJOIN calendars c ON c.user_id = U.id AND c.status = 'active' AND c.calendar_provider_id LIl -mLEFT JOIN team domains to040 A1 A40 V 64 ~ON to.team id = t.idAND to.deleted at IS NULIAND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))GROUP BY t.id, t.name, calendar_domairORDER RY +.name.calendan domoin.ClassesFilesSymbolsActionsTextAll Places vselect * from users u joinWhere U.team 1d = 882•Q- Customize Toolbar…select x Tron acuivitles wiseLect x Tron acclvitles wiseLect x Tron acclvitles wiselect * trom activitles wiselect * trom activitles wiselect * trom parcicipantsUse Find in Siles (4.9ºF) to nerform full-teyt soarchiselect * rrom activitles wìand account id = 19003658 dselect * from contacts whenselect * from accounts whenselect * from automated reiselect * from automated_rerselect * From activitv seanselect * from activity_searSELECT * FROM activities Wion uuid to bin '47842446-91SELSCT * CP0M eom confiaun:select * from rate_limits;select * from automated_.rerand id IN (18, 1872):select * from automated reports where id = 54SELECT * FROM users WHERE id IN (24623,29443,29613) =SELECT * FROM automated_report_ results WHERE uuid to bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid:666 vselect * from text relavs where created at > 2026-05-01º:"suppont Dally • In 1h om100% S2• Wed 13 May 13:52:25U AskJiminnyReportActivityServiceTest vcascadeTrial Owner Role SeleSMS Failure Email Inve+0 ..4. Send SMs via IW1l10Smessage = $messagingService->send($user, $this->to, $this->text);Sactivity = $messagingService->buildActivity(...);1/ 6. MarklSthis->textRelay→>update(['status' = TextRelay::STATUS_PROCESSED]):ch (TextRelayException $e) {Send Tallure email + Scott received thislailo-to(ssender)-squeue(new SmsRelavFailed(...))•thExcention Se)Log to sencry onlysentry::captureException(Se:ition Logic (checkIntegrity())7-336:e tunction checkintegrity googLeGma1l MessagePart Spayload)Parse emall boaymal = new Emal Parsero)→>oarse(Sbody):eyt = Semail_saetVicibleTeyt/)•(stext === *') {throw new TextRelavException('Message body is un-readable or empty.',self:: REASON CODE MESSAGE BODY EMPTY // 4100ralidator = Validator::make(['data' => Stext]. ['data' => new SmsMessage)]):($validator->fails()) {throw new TextRelayException('Message body is too larae to send as an SMS."..celf.•pFACoN cOnE MECCAGE ROnY TOO LARGE 1/ 1900 ~ Ccottic code was 2000 in the email. bus/ Validate sender exists and has SMS permission5. Conficuration Requiredam iust wandering« Code SWF-1.6w•0 (г]W Windsurf Teams20-8io 4 spaces...
|
NULL
|
6442320624934253853
|
NULL
|
click
|
ocr
|
NULL
|
PhostormVIewINavigareCodeLaravelKeractorFV faVsco. PhostormVIewINavigareCodeLaravelKeractorFV faVsco.js?9 master kProiectC CreateTeam.pnp© MailboxController.php7 CalendarsC) TextRelayService.onp© EmailTextRelay.php© SmsLength.phpOlextkelay.onpD CrmDealRisksclass Smskelayralled extends Mallable 1mpleits ShoulduueueA1A3 АУD ElasticSearchDoroupsD Import> @ Mailbox|v @ Nudges>@ UserPilot© CreateNudgeCreatedE> C Opportunitiesv _ Playbooks© AttachLayout.phpc) Changesidekickseuingv D Plavlists> Activitiesv Planhat© CreateActivitvAdde 20→hUserPilot@ ImportGroupPlavlistSh, M TeamsM Transcritionv MUsers@ ActivitvProviderDiscon© ActivityProviderintegra9 CresteDefaultDlavlistr(C) CroateDefaultSavedSe(C) CroateGrounCroatedS@ DeleteScheduledlicert 379) NotifvCrmOwnerDicco00 NotifuCrml leorDicconr 39(G) Cothofault Avntarl ictar© SetupCalendarSync.pt© SetupMailSync.php© SyncIntercom.php© SyncPlanhat.php© SyncUserPilot.php© ValidateSendingMessal© ValidateSendingNotific> MWebhookEgitkeep© ChangeLoaContextCorrel 50v D Maillv Activities@ MailRoyFailed ToConne 54(c) SmcReceived.nhn© SmsRelayFailed.php(C) TrackRectored nhnM Calendarsuse Uueueable:use Serializesmodels:* The Actvitu instance.* @vac TextRelayLusdgespublic StextRelay;public Sreason;public Scode:* SmsRelayFailed constructor.public function construct(TextRelay $textRelay, string Sreason, int Scode = 0)Sth1s->textkelay = stextkelay*sthis->reason = sreason:sthis->code = scode:* surLd the messageoublic function buildo: staticSsubiect = "Your text message failed to send'?SorioinActivitv = sthis->textRelav->orioinActivity:if (SoriginActivity) {Sto = SoriainActivitv->nrosnect name 22 SoriainActivitv->to->national nhone numben•Ssubject = I to1 Sto:return Sthis->view( view: 'emails.activities.sms-relay-failed')->subject(Ssubject):= custom.log|aravel.l0gA SF (jiminny@localhost]4 HS_local [jiminny@localhost]& console (PROD] X A console [EU]A console [STAGING]637638-639640- ₴65966€6616626631662Tx: Auto vSo jiminnyJOIN calendars c ON c.user_id = U.id AND c.status = 'active' AND c.calendar_provider_id LIl -mLEFT JOIN team domains to040 A1 A40 V 64 ~ON to.team id = t.idAND to.deleted at IS NULIAND td.domain = LOWER(SUBSTRING_INDEX(c.calendar_provider_id, '@', -1))GROUP BY t.id, t.name, calendar_domairORDER RY +.name.calendan domoin.ClassesFilesSymbolsActionsTextAll Places vselect * from users u joinWhere U.team 1d = 882•Q- Customize Toolbar…select x Tron acuivitles wiseLect x Tron acclvitles wiseLect x Tron acclvitles wiselect * trom activitles wiselect * trom activitles wiselect * trom parcicipantsUse Find in Siles (4.9ºF) to nerform full-teyt soarchiselect * rrom activitles wìand account id = 19003658 dselect * from contacts whenselect * from accounts whenselect * from automated reiselect * from automated_rerselect * From activitv seanselect * from activity_searSELECT * FROM activities Wion uuid to bin '47842446-91SELSCT * CP0M eom confiaun:select * from rate_limits;select * from automated_.rerand id IN (18, 1872):select * from automated reports where id = 54SELECT * FROM users WHERE id IN (24623,29443,29613) =SELECT * FROM automated_report_ results WHERE uuid to bin('822fa41b-afd3-43a9-a248-86b0e36f3131') = uuid:666 vselect * from text relavs where created at > 2026-05-01º:"suppont Dally • In 1h om100% S2• Wed 13 May 13:52:25U AskJiminnyReportActivityServiceTest vcascadeTrial Owner Role SeleSMS Failure Email Inve+0 ..4. Send SMs via IW1l10Smessage = $messagingService->send($user, $this->to, $this->text);Sactivity = $messagingService->buildActivity(...);1/ 6. MarklSthis->textRelay→>update(['status' = TextRelay::STATUS_PROCESSED]):ch (TextRelayException $e) {Send Tallure email + Scott received thislailo-to(ssender)-squeue(new SmsRelavFailed(...))•thExcention Se)Log to sencry onlysentry::captureException(Se:ition Logic (checkIntegrity())7-336:e tunction checkintegrity googLeGma1l MessagePart Spayload)Parse emall boaymal = new Emal Parsero)→>oarse(Sbody):eyt = Semail_saetVicibleTeyt/)•(stext === *') {throw new TextRelavException('Message body is un-readable or empty.',self:: REASON CODE MESSAGE BODY EMPTY // 4100ralidator = Validator::make(['data' => Stext]. ['data' => new SmsMessage)]):($validator->fails()) {throw new TextRelayException('Message body is too larae to send as an SMS."..celf.•pFACoN cOnE MECCAGE ROnY TOO LARGE 1/ 1900 ~ Ccottic code was 2000 in the email. bus/ Validate sender exists and has SMS permission5. Conficuration Requiredam iust wandering« Code SWF-1.6w•0 (г]W Windsurf Teams20-8io 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
34061
|
1284
|
21
|
2026-05-13T10:52:27.967546+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778669547967_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
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
40
1
40
64
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';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
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":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"bounds":{"left":0.37466756,"top":0.10055866,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.38397607,"top":0.10055866,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39361703,"top":0.09896249,"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.40093085,"top":0.09896249,"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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"bounds":{"left":0.11968085,"top":0.0,"width":0.28823137,"height":0.98324025},"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\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.40957448,"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.41821808,"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.42918882,"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.43783244,"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.44647607,"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.4574468,"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.46841756,"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.4950133,"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.50598407,"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.7084442,"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":"40","depth":4,"bounds":{"left":0.67785907,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.69015956,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"bounds":{"left":0.6994681,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"64","depth":4,"bounds":{"left":0.7117686,"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.7237367,"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.73105055,"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';","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';","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":"New File or Directory…","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":"Expand Selected","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":"Collapse All","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":"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}]...
|
-1625780816707413608
|
2218600140881933893
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
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
40
1
40
64
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';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
34060
|
NULL
|
NULL
|
NULL
|
|
34062
|
1283
|
27
|
2026-05-13T10:52:29.667536+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778669549667_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
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
40
1
40
64
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';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
[{"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":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","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":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\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":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"64","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';","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';","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":"New File or Directory…","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":"Expand Selected","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":"Collapse All","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":"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}]...
|
-1625780816707413608
|
2218600140881933893
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
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
40
1
40
64
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';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
34067
|
1284
|
24
|
2026-05-13T10:52:36.831828+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778669556831_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}...
|
[{"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":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"bounds":{"left":0.37466756,"top":0.12529927,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.38397607,"top":0.12529927,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39361703,"top":0.123703115,"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.40093085,"top":0.123703115,"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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"bounds":{"left":0.11968085,"top":0.0207502,"width":0.28823137,"height":0.9792498},"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
-7282040004185114236
|
-2479994403298349370
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
34068
|
1283
|
30
|
2026-05-13T10:52:39.362460+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778669559362_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
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
40
1
40
64
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';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide
app ~/jiminny/app, folder
.circleci, folder
.cursor, folder
.github
.sonarlint, folder
.vscode, folder
.windsurf, folder
app, sources root
Actions, folder
InviteUserToTeamAction.php, class
MarkUserAsOnboardableAction.php, class
SyncRecordingFlagsAction.php, class
UpdateTeamMemberAction.php, class
UpdateUserRolesAction.php, class
Component, folder
Acl, folder
ActionItems, folder
Activity, folder
ActivityAnalytics, folder
ActivitySearch, folder
AiActivityType, folder
AiAutomation, folder
AiCallScoring, folder
AskAnything, folder
Dtos, folder
Events, folder
AskAnythingPromptService.php, class
HistoryService.php, class
AskJiminnyAi, folder
AWS, folder
BillingManagement, folder
Cache, folder
CoachingFeedback, folder
Country, folder
CustomerApi, folder
Database, folder
Datadog, folder
DateTime, folder
DealInsights, folder
DealRisks, folder
ElasticSearch, folder
Eloquent, folder
Encoding, folder
Encryption, folder
ES, folder
Faker, folder
FeatureFlags, folder
FFMpeg, folder
FileSystem, folder
Gecko, folder
Gong, folder
GuzzleHttp, folder
KeyPoints, folder
Kiosk, folder
LanguageDetection, folder
LiveFeed, folder
Locks, folder
Math, folder
MediaPipeline, folder
MeetingBot, folder
MobileSettings, folder
Model, folder
Notification, folder
Nudge, folder
ParagraphBreaker, folder
ParticipantSpeech, folder
PartitionedCookie, folder
PlaybackPage, folder
Playlist, folder
Prophet, folder
ProphetAi, folder
ProsperWorks, folder
Queue, folder
Router, folder
Saml2, folder
SCIM, folder
Seeder, folder
Sentry, folder
Serializer, folder
Settings, folder
Sidekick, folder
Slack, folder
TeamInsights, folder
TimeMemoryMapper, folder
Transcription, folder
TranscriptionSummary, folder
Twilio, folder
Uploader, folder
UrlGenerator, folder
Utility, folder
Uuid, folder
Waveform, folder
Webhooks, folder
Workflow, folder
Configuration, folder
Console, folder
Commands, folder
Activities, folder
Analytics, folder
Calendars, folder
Crm, folder
Hubspot
IntegrationApp
Traits
AddLayoutEntities.php, class
AutologDelayedCommand.php, class
BackfillOpportunityUserFromAccountCommand.php, class
BullhornCommandAbstract.php, abstract class
BullhornPingCommand.php, class
BullhornSearchCommand.php, class
BullhornSessionCommand.php, class
CheckActivityLoggableCommand.php, final class
CleanDuplicateFieldDataCommand.php, class
FullSyncOpportunityCommand.php, class
LogActivitiesCommand.php, final class
ManageSyncStrategyCommand.php, class
MatchCrmObjectsCommand.php, class
MatchOpportunityActivitiesCommand.php, class
MigrateProvider.php, class
ProcessHubspotObjectsSyncBatches.php, class
PurgeDeletedOpportunitiesCommand.php, class
ResetGovernorLimits.php, class
SendNotLogged.php, class
SetupActivityTypeForFollowUp.php, final class
SetupCloseCrm.php, class
SetupCopperCrm.php, class
SetupCrmCommand.php, abstract class
SetupLayouts.php, class
SyncAccount.php, class
SyncContact.php, class
SyncFieldMetadata.php, class
SyncHubspotActiveDeals.php, class
SyncHubspotObjects.php, class
SyncLead.php, class
SyncObjects.php, class
SyncOpportunitiesMissingFieldDataCommand.php, class
SyncOpportunity.php, class
SyncProfileMetadata.php, class
SyncTeamMetadata.php, class
UpdateOpportunitySpecifications.php, class
DealInsights, folder
Dev, folder
Dialers, folder
DTOs, folder
Elasticsearch, folder
EngagementStats, folder
GeckoExport, folder
Livestream, folder
Mailboxes, folder
Migrate, folder
PlaybackThemes, folder
Playbooks, folder
Playlists, folder
Postmark, folder
ProphetAi, folder
Reports, folder
AutomatedReportsCommand.php, class
AutomatedReportsRetentionPolicyCommand.php, class
AutomatedReportsSendCommand.php, class
CreateMockAskJiminnyReportResultCommand.php, class
DeleteReportCommand.php, class
GenerateMarketingReport.php, class
Team.php, class
Usage.php, class
Slack, folder
Teams, folder
Tracks, folder
Transcription, folder
Twilio, folder
Users, folder
Vocabulary, folder
Zoom, folder
Command.php, class
CreateDatabaseUsers.php, class
DatabaseTableCount.php, class
DeleteOldAiCrmNotesCommand.php, class
DeleteS3LeftoversCommand.php, class
DevPostmanCommand.php, final class
DiarizeViaAiParticipantIdentificationCommand.php, class
EncryptTokensCommand.php, class
EngagementStatsRegenerateCommand.php, class
FeatureFlagsHelper.php
FixCrossTenantIssues.php, class
FlushRolesPermissionsCache.php, class
GenerateInternalWebhookToken.php, class
GroupSetDefaultLanguageCommand.php, final class
HelperTruncateCoachingTables.php, class
HubspotJournalPollingCommand.php, class
HubspotWebhookServiceCommand.php, class
ImportRecording.php, class
ImportUsersFromCsvFile.php, final class
IterateUsersCommand.php, abstract class
JiminnyCacheClearCommand.php, class
JiminnyDebugCommand.php, class
JiminnySetEncryptedTokenManagerModeCommand.php, class...
|
[{"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":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","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":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\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":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"64","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';","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';","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":"New File or Directory…","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":"Expand Selected","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":"Collapse All","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":"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},{"role":"AXStaticText","text":"app ~/jiminny/app, folder","depth":6,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".circleci, folder","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".cursor, folder","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".github","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".sonarlint, folder","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".vscode, folder","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":".windsurf, folder","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"app, sources root","depth":7,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Actions, folder","depth":8,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"InviteUserToTeamAction.php, class","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"MarkUserAsOnboardableAction.php, class","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncRecordingFlagsAction.php, class","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"UpdateTeamMemberAction.php, class","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"UpdateUserRolesAction.php, class","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Component, folder","depth":8,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Acl, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActionItems, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Activity, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivityAnalytics, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ActivitySearch, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AiActivityType, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AiAutomation, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AiCallScoring, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AskAnything, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Dtos, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Events, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AskAnythingPromptService.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"HistoryService.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AskJiminnyAi, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AWS, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"BillingManagement, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Cache, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"CoachingFeedback, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Country, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"CustomerApi, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Database, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Datadog, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DateTime, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DealInsights, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DealRisks, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ElasticSearch, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Eloquent, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Encoding, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Encryption, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ES, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Faker, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"FeatureFlags, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"FFMpeg, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"FileSystem, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Gecko, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Gong, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GuzzleHttp, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"KeyPoints, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Kiosk, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LanguageDetection, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LiveFeed, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Locks, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Math, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"MediaPipeline, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"MeetingBot, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"MobileSettings, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Model, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Notification, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Nudge, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ParagraphBreaker, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ParticipantSpeech, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PartitionedCookie, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PlaybackPage, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Playlist, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Prophet, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ProphetAi, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ProsperWorks, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Queue, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Router, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Saml2, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SCIM, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Seeder, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Sentry, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Serializer, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Settings, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Sidekick, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Slack, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"TeamInsights, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"TimeMemoryMapper, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Transcription, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"TranscriptionSummary, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Twilio, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Uploader, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"UrlGenerator, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Utility, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Uuid, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Waveform, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Webhooks, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Workflow, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Configuration, folder","depth":8,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Console, folder","depth":8,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Commands, folder","depth":9,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Activities, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Analytics, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Calendars, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Crm, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Hubspot","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IntegrationApp","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Traits","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AddLayoutEntities.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AutologDelayedCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"BackfillOpportunityUserFromAccountCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"BullhornCommandAbstract.php, abstract class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"BullhornPingCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"BullhornSearchCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"BullhornSessionCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"CheckActivityLoggableCommand.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"CleanDuplicateFieldDataCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"FullSyncOpportunityCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"LogActivitiesCommand.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ManageSyncStrategyCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"MatchCrmObjectsCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"MatchOpportunityActivitiesCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"MigrateProvider.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ProcessHubspotObjectsSyncBatches.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PurgeDeletedOpportunitiesCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ResetGovernorLimits.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SendNotLogged.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SetupActivityTypeForFollowUp.php, final class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SetupCloseCrm.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SetupCopperCrm.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SetupCrmCommand.php, abstract class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SetupLayouts.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncAccount.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncContact.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncFieldMetadata.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncHubspotActiveDeals.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncHubspotObjects.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncLead.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncObjects.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncOpportunitiesMissingFieldDataCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncOpportunity.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncProfileMetadata.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"SyncTeamMetadata.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"UpdateOpportunitySpecifications.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DealInsights, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Dev, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Dialers, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DTOs, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Elasticsearch, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"EngagementStats, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GeckoExport, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Livestream, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Mailboxes, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Migrate, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"PlaybackThemes, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Playbooks, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Playlists, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Postmark, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ProphetAi, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Reports, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AutomatedReportsCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AutomatedReportsRetentionPolicyCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"AutomatedReportsSendCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"CreateMockAskJiminnyReportResultCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DeleteReportCommand.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GenerateMarketingReport.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Team.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Usage.php, class","depth":11,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Slack, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Teams, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Tracks, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Transcription, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Twilio, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Users, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Vocabulary, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Zoom, folder","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"Command.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"CreateDatabaseUsers.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DatabaseTableCount.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DeleteOldAiCrmNotesCommand.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DeleteS3LeftoversCommand.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DevPostmanCommand.php, final class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"DiarizeViaAiParticipantIdentificationCommand.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"EncryptTokensCommand.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"EngagementStatsRegenerateCommand.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"FeatureFlagsHelper.php","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"FixCrossTenantIssues.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"FlushRolesPermissionsCache.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GenerateInternalWebhookToken.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"GroupSetDefaultLanguageCommand.php, final class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"HelperTruncateCoachingTables.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"HubspotJournalPollingCommand.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"HubspotWebhookServiceCommand.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ImportRecording.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"ImportUsersFromCsvFile.php, final class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"IterateUsersCommand.php, abstract class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"JiminnyCacheClearCommand.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"JiminnyDebugCommand.php, class","depth":10,"on_screen":false,"role_description":"text"},{"role":"AXStaticText","text":"JiminnySetEncryptedTokenManagerModeCommand.php, class","depth":10,"on_screen":false,"role_description":"text"}]...
|
-6952175702660547756
|
2218617733067978309
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
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
40
1
40
64
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';
Project
Project
New File or Directory…
Expand Selected
Collapse All
Options
Hide
app ~/jiminny/app, folder
.circleci, folder
.cursor, folder
.github
.sonarlint, folder
.vscode, folder
.windsurf, folder
app, sources root
Actions, folder
InviteUserToTeamAction.php, class
MarkUserAsOnboardableAction.php, class
SyncRecordingFlagsAction.php, class
UpdateTeamMemberAction.php, class
UpdateUserRolesAction.php, class
Component, folder
Acl, folder
ActionItems, folder
Activity, folder
ActivityAnalytics, folder
ActivitySearch, folder
AiActivityType, folder
AiAutomation, folder
AiCallScoring, folder
AskAnything, folder
Dtos, folder
Events, folder
AskAnythingPromptService.php, class
HistoryService.php, class
AskJiminnyAi, folder
AWS, folder
BillingManagement, folder
Cache, folder
CoachingFeedback, folder
Country, folder
CustomerApi, folder
Database, folder
Datadog, folder
DateTime, folder
DealInsights, folder
DealRisks, folder
ElasticSearch, folder
Eloquent, folder
Encoding, folder
Encryption, folder
ES, folder
Faker, folder
FeatureFlags, folder
FFMpeg, folder
FileSystem, folder
Gecko, folder
Gong, folder
GuzzleHttp, folder
KeyPoints, folder
Kiosk, folder
LanguageDetection, folder
LiveFeed, folder
Locks, folder
Math, folder
MediaPipeline, folder
MeetingBot, folder
MobileSettings, folder
Model, folder
Notification, folder
Nudge, folder
ParagraphBreaker, folder
ParticipantSpeech, folder
PartitionedCookie, folder
PlaybackPage, folder
Playlist, folder
Prophet, folder
ProphetAi, folder
ProsperWorks, folder
Queue, folder
Router, folder
Saml2, folder
SCIM, folder
Seeder, folder
Sentry, folder
Serializer, folder
Settings, folder
Sidekick, folder
Slack, folder
TeamInsights, folder
TimeMemoryMapper, folder
Transcription, folder
TranscriptionSummary, folder
Twilio, folder
Uploader, folder
UrlGenerator, folder
Utility, folder
Uuid, folder
Waveform, folder
Webhooks, folder
Workflow, folder
Configuration, folder
Console, folder
Commands, folder
Activities, folder
Analytics, folder
Calendars, folder
Crm, folder
Hubspot
IntegrationApp
Traits
AddLayoutEntities.php, class
AutologDelayedCommand.php, class
BackfillOpportunityUserFromAccountCommand.php, class
BullhornCommandAbstract.php, abstract class
BullhornPingCommand.php, class
BullhornSearchCommand.php, class
BullhornSessionCommand.php, class
CheckActivityLoggableCommand.php, final class
CleanDuplicateFieldDataCommand.php, class
FullSyncOpportunityCommand.php, class
LogActivitiesCommand.php, final class
ManageSyncStrategyCommand.php, class
MatchCrmObjectsCommand.php, class
MatchOpportunityActivitiesCommand.php, class
MigrateProvider.php, class
ProcessHubspotObjectsSyncBatches.php, class
PurgeDeletedOpportunitiesCommand.php, class
ResetGovernorLimits.php, class
SendNotLogged.php, class
SetupActivityTypeForFollowUp.php, final class
SetupCloseCrm.php, class
SetupCopperCrm.php, class
SetupCrmCommand.php, abstract class
SetupLayouts.php, class
SyncAccount.php, class
SyncContact.php, class
SyncFieldMetadata.php, class
SyncHubspotActiveDeals.php, class
SyncHubspotObjects.php, class
SyncLead.php, class
SyncObjects.php, class
SyncOpportunitiesMissingFieldDataCommand.php, class
SyncOpportunity.php, class
SyncProfileMetadata.php, class
SyncTeamMetadata.php, class
UpdateOpportunitySpecifications.php, class
DealInsights, folder
Dev, folder
Dialers, folder
DTOs, folder
Elasticsearch, folder
EngagementStats, folder
GeckoExport, folder
Livestream, folder
Mailboxes, folder
Migrate, folder
PlaybackThemes, folder
Playbooks, folder
Playlists, folder
Postmark, folder
ProphetAi, folder
Reports, folder
AutomatedReportsCommand.php, class
AutomatedReportsRetentionPolicyCommand.php, class
AutomatedReportsSendCommand.php, class
CreateMockAskJiminnyReportResultCommand.php, class
DeleteReportCommand.php, class
GenerateMarketingReport.php, class
Team.php, class
Usage.php, class
Slack, folder
Teams, folder
Tracks, folder
Transcription, folder
Twilio, folder
Users, folder
Vocabulary, folder
Zoom, folder
Command.php, class
CreateDatabaseUsers.php, class
DatabaseTableCount.php, class
DeleteOldAiCrmNotesCommand.php, class
DeleteS3LeftoversCommand.php, class
DevPostmanCommand.php, final class
DiarizeViaAiParticipantIdentificationCommand.php, class
EncryptTokensCommand.php, class
EngagementStatsRegenerateCommand.php, class
FeatureFlagsHelper.php
FixCrossTenantIssues.php, class
FlushRolesPermissionsCache.php, class
GenerateInternalWebhookToken.php, class
GroupSetDefaultLanguageCommand.php, final class
HelperTruncateCoachingTables.php, class
HubspotJournalPollingCommand.php, class
HubspotWebhookServiceCommand.php, class
ImportRecording.php, class
ImportUsersFromCsvFile.php, final class
IterateUsersCommand.php, abstract class
JiminnyCacheClearCommand.php, class
JiminnyDebugCommand.php, class
JiminnySetEncryptedTokenManagerModeCommand.php, class...
|
34066
|
NULL
|
NULL
|
NULL
|
|
47892
|
1701
|
13
|
2026-05-15T08:57:59.135979+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835479135_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
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":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.0944149,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"bounds":{"left":0.38530585,"top":0.07581804,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.39461437,"top":0.07581804,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40425533,"top":0.074221864,"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.41156915,"top":0.074221864,"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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"bounds":{"left":0.13430852,"top":0.0726257,"width":0.28424203,"height":0.9066241},"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\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.42021278,"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.42885637,"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}]...
|
-8188770867370784850
|
-2480275878277157178
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
Execute
Explain Plan...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47902
|
1700
|
8
|
2026-05-15T08:58:25.323753+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835505323_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Code changed:
Hide
Sync Changes
Hide This Notification
40
1
40
65
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');
Project
Project
New File or Directory…
Expand Selected
Expand All
Collapse All
Options
Hide...
|
[{"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":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","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":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\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":"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":"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":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"65","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'\n# and id IN (32415, 32416);\nand 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');","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'\n# and id IN (32415, 32416);\nand 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');","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":"New File or Directory…","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":"Expand Selected","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":"Expand All","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":"Collapse All","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":"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}]...
|
-1889413980994870646
|
2218617733067978309
|
app_switch
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Code changed:
Hide
Sync Changes
Hide This Notification
40
1
40
65
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');
Project
Project
New File or Directory…
Expand Selected
Expand All
Collapse All
Options
Hide...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47903
|
1700
|
9
|
2026-05-15T08:58:33.576154+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835513576_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto...
|
[{"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":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","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":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\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}]...
|
5194873116303313412
|
-2480258423530066426
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto...
|
47902
|
NULL
|
NULL
|
NULL
|
|
47904
|
1701
|
22
|
2026-05-15T08:58:33.588385+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835513588_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto...
|
[{"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":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.0944149,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"bounds":{"left":0.38530585,"top":0.07581804,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.39461437,"top":0.07581804,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40425533,"top":0.074221864,"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.41156915,"top":0.074221864,"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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"bounds":{"left":0.13430852,"top":0.0,"width":0.28424203,"height":0.98324025},"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\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.42021278,"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.42885637,"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.4398271,"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.44847074,"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.45711437,"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.4680851,"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.47905585,"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}]...
|
5194873116303313412
|
-2480258423530066426
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47905
|
1700
|
10
|
2026-05-15T08:58:34.353192+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835514353_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}...
|
[{"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":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","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":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
-3631646260759821103
|
-2479994403300446522
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47906
|
1701
|
23
|
2026-05-15T08:58:34.368968+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835514368_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}...
|
[{"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":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.0944149,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"bounds":{"left":0.38530585,"top":0.07581804,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.39461437,"top":0.07581804,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40425533,"top":0.074221864,"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.41156915,"top":0.074221864,"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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"bounds":{"left":0.13430852,"top":0.0,"width":0.28424203,"height":0.98324025},"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
-3631646260759821103
|
-2479994403300446522
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}...
|
47904
|
NULL
|
NULL
|
NULL
|
|
47907
|
1700
|
11
|
2026-05-15T08:58:35.280718+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835515280_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
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,"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":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","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":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","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}]...
|
-3217526785416111167
|
-8132290182084711486
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴1DEV (-zsh)APP (-zsh)83-zsh₴4root@docker_lamp_1:/home/jiminny# phpartisanactivity:update:es 422003Foundactivity ID: 422003,UUID: f43cf158-e60d-46e5-92f8-c4e0594a3219Sending activity for ES update...Done.root@docker_lamp_1:/home/jiminny#What's next:Try Docker Debug forseamless, persistent debugging tools in any container or image →Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-failed to connect to the docker API at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-•HomeDMsActivityFilesLater..•More>0.(aholJiminny Tech Day - 6h 2 m left100% С8• Fri 15 May 11:58:34-→Describe what you are looking forJiminny ...#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...^ Direct messages. Stoyan Tomov®. Galya DimitrovaR. Aneliya Angelova€. Vasil Vasileva. Stefka Stoyanova* Todor StamatovMario Georgiev. Nikolay Ivanovdo James Graham ". Stoyan TanevR. Steliyan Georgiev& Petko Kashinski. Lukas Kovalik y...::: AppsToastJira CloudGoogle Cale...# releases8 226 0• MessagesC Files• Bookmarks+20904-fix-updat^ ~~ an-activity-command59ea0d31 - Mt.Today ~-quest #12078 fromjiminny/JY-20904-fix-update-es-on-activity-commandjiminny/app| Added by GitHubCircleCI APP 11:09 AMDeployment Successful!Project: appWhen:05/15/202608:09:35Tag:View JobNewGitHub APP 11:36 AM4 new commits pushed tomasterby LakyLak8dac0dfa - JY-20903 Update activity stagewhen opportunity is changede883ed5b - JY-20903 revert changes incommand0d351159 - Merge branch 'master' into JY-20903-update_activity-stage-on-opportunity-change0e331f23 - Merge pull request #12077 fromjiminny/JY-20903-update_activity-stage-on-opportunity-changejiminny/app| Added by GitHubMessage #releases+...
|
47905
|
NULL
|
NULL
|
NULL
|
|
47908
|
1701
|
24
|
2026-05-15T08:58:35.275533+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835515275_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
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":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.0944149,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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 'AskJiminnyReportActivityServiceTest'","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}]...
|
-3217526785416111167
|
-8132290182084711486
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
PhostormVIewINavicarecodeWindowFV faVsco.js°9 JY-20891-improve-sms-text-rProletey(c) UserinvitationD10.ohp© SmsRelayFailed.php XG SyncProfileLeads.php© SyncProfileOpportunities.phpclass Smskelayralled extends Mallable 1mpLements shoulduueueDealRisksD ElasticSearchDoroupsD Import0 Mailboxv m Nuages>@ UserPilotc createnuagecreateaevent.or> C Opportunitiesv _ Playbooks© AttachLayout.phpc) Changesidekickserinas.onov D Plavlists> Activitiesv PlanhatC) CreateActivivAddedtio?lal→hUserPilot9 ImportGrounPlavlistSharesLis, M Teamsm Transcritionv MUsersC ActivitvProviderDisconnected(c) ActivitvDroviderintearated nh0 CreateDefaultDlavlict nhr(C) CroateNefaultSavedSearches(C) CroateGrounCreatedFvent nh(C) DeleteScheduledllcerActivitie9) NotifvCrmOwnerDicconnecte0 NotifuCrmi Icorhiccannostodll(e) SotDefaultAvatarListener.ohp) setupcalendarsync.onp© SetupMailSync.php© SyncIntercom.php© SyncPlanhat.php© SyncUserPilot.php© ValidateSendinaMessage.phpc)ValidateSendinaNotification.o> MWebhookE aitkeen€ ChangeLoaConteytCorrelationldlv M Maillv ActivitiesC) MailBoxFailedToConnect.oho(c) SmcReceived.nhn(c) SmcRelavsailed.nhn(C) TrackRectored nhnM Calendarsuse Serializesmodels:/*** Tne Actzvitu instance.* @vac TextRelay2 usagespublic StextRelay;public Sreason;public Scode;* SmsRelayFailed constructor.public function construct(TextRelay StextRelay, string Sreason, int Scode = 0)Sth1s->textkelay = stextrelay*sthis->reason = sreason:sthis->code = scode:* surLd the messageoublic function buildo: staticSsubiect = "Your text message failed to send':SorioinActivitv = sthis->textRelav->orioinActivity:if ($originActivity) {Sto = SoniainActivitv->nrosnect name 22 SoniainActivitv->to->national nhone numben•Ssubiect = I to 1 Sto.return Sthis->view( view: 'emails.activities.sms-relay-failed')->subject(Ssubject);41A3 A=custom.logscratch &.ison=laravel.log4 SF jiminny@localhost]A HS_local (jiminny@localhost]« console [PROD] XA console_7 [QAI PROD]652653T664665666- A console [STAGING]Tx: Autoselect * trom activity searches where 10 = 8/7147select * from activity search_filters where activity search_id = 87714:SELECT * FROM activities WHERE uvid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuld to binl47842446-0151-4000-854t-cc6568290101'0 = UU1d:SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate_limits;select * from automated_report_results where media tyRe = 'pdf' and status = 2and 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: # 79763436SELECT email provider id, COUNT(*) as count, GROUP CONCAT(id) as ids, GROUP CONCAT(status) as statusesFROM text relaysWHERE email provider id IN ('19e2027868a64b42'.'19e2033ed8ea6b10')GRuuP 8y emanl provzder 10:SELECT id. status, telephony provider id. created atFROM activitiesNHERE id IN (80028719. 80028846)SELECT 1d. status, code. email sent at. created at. uodated at.FROM text_relaysWHERESdN 09415. 3241699SELECT id. status. code. senden, recinient. created atFROM text_relaysWHERE senden LTKE I%manio.aeoraiev%' OR senden LTKS I%stovan.tomov%!ORDER RY created at DESCIITMTT 10•SELECT id, vuid, status, code, sender, recipient, created_at, updated_atFROM text relaysWHERE vuid = uuid to bin('0626141c-27a6-4d8c-aff8-7c8020a2c656'):|A console leu!do jiminny v040 A1 A40 V 65 ^Jiminny Tech Day - 6h 2m left100% 2• Fri 15 May 11:58:34AskJiminnyReportActivityServiceTest vCascadeReview PR for ActivityDebug Text Relay Faily+0 ..Hete is ted, email5t 2026at10:20 FMom: The Jiminny Team <[EMAIL]>Subiect: Your text message failed to sendr text message.Please contact support for more information, quoting reference 0626141c-27a6-4d8c-aff8-/c8020a2c656 and code 2200.Perrect. The email shows•Reference: 0626141c-27a6-4d8c-aff8-7c8020a2c656Code: 2200Code 2200 is REASON CODE SENDER MISMATCH (line 35 in EmailTextRelay.php), which meansThis is a different text relay record than the one we've been looking at (32416 has UUID 0x4CD18652A407AA2DA526870553821366 ). Let me find the record with UUID 9626141c-27a6-4d8c-aff8-7c80insalSELECT id, uuid, status, code, sender, recipient, created_at, updated_atFROM text_relaysWHERE uuld = uuld to b1n 0626141C-27a6-408c-att8-/c8626a2c656 :This will show the actual failed text relay record that triggered the failure email Stovan received.al -A Your included weekly usage quota is exhausted. Using your extra usage. Quota resets May 17, 11:00 AMAsk anvthina (84-DSWE.1.6WN Windsurf Teams51-52UTE.8io 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47909
|
1700
|
12
|
2026-05-15T08:58:38.213355+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835518213_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Code changed:
Hide
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":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","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":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\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":"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":"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}]...
|
8735129481521543369
|
-2480276026453537274
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Code changed:
Hide
Sync Changes...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47910
|
1701
|
25
|
2026-05-15T08:58:38.201405+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835518201_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}...
|
[{"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":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.0944149,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"bounds":{"left":0.38530585,"top":0.07581804,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.39461437,"top":0.07581804,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40425533,"top":0.074221864,"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.41156915,"top":0.074221864,"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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"bounds":{"left":0.13430852,"top":0.0,"width":0.28424203,"height":0.98324025},"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
-3631646260759821103
|
-2479994403300446522
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}...
|
47908
|
NULL
|
NULL
|
NULL
|
|
47915
|
1700
|
15
|
2026-05-15T08:58:48.897815+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835528897_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴ SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴1DEV (-zsh)APP (-zsh)83-zsh₴4root@docker_lamp_1:/home/jiminny# phpartisanactivity:update:es 422003Foundactivity ID: 422003,UUID: f43cf158-e60d-46e5-92f8-c4e0594a3219Sending activity for ES update...Done.root@docker_lamp_1:/home/jiminny#What's next:Try Docker Debug forseamless, persistent debugging tools in any container or image →Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-failed to connect to the docker API at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-•HomeDMsActivityFilesLater..•More>0.(aholJiminny Tech Day - 6h 2 m left100% С8• Fri 15 May 11:58:48-→Describe what you are looking forJiminny ...#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...^ Direct messages. Stoyan Tomov®. Galya DimitrovaR. Aneliya Angelova€. Vasil Vasileva. Stefka Stoyanova* Todor StamatovMario Georgiev. Nikolay Ivanovdo James Graham ". Stoyan TanevR. Steliyan Georgiev& Petko Kashinski. Lukas Kovalik y...::: AppsToastJira CloudGoogle Cale...# releases8 226 0• MessagesC Files• Bookmarks+20904-fix-updat^ ~~ an-activity-command59ea0d31 - Mt.Today ~-quest #12078 fromjiminny/JY-20904-fix-update-es-on-activity-commandjiminny/app| Added by GitHubCircleCI APP 11:09 AMDeployment Successful!Project: appWhen:05/15/202608:09:35Tag:View JobNewGitHub APP 11:36 AM4 new commits pushed tomasterby LakyLak8dac0dfa - JY-20903 Update activity stagewhen opportunity is changede883ed5b - JY-20903 revert changes incommand0d351159 - Merge branch 'master' into JY-20903-update_activity-stage-on-opportunity-change0e331f23 - Merge pull request #12077 fromjiminny/JY-20903-update_activity-stage-on-opportunity-changejiminny/app| Added by GitHubMessage #releases+...
|
NULL
|
7071313121457261961
|
NULL
|
click
|
ocr
|
NULL
|
SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴ SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴1DEV (-zsh)APP (-zsh)83-zsh₴4root@docker_lamp_1:/home/jiminny# phpartisanactivity:update:es 422003Foundactivity ID: 422003,UUID: f43cf158-e60d-46e5-92f8-c4e0594a3219Sending activity for ES update...Done.root@docker_lamp_1:/home/jiminny#What's next:Try Docker Debug forseamless, persistent debugging tools in any container or image →Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-failed to connect to the docker API at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-•HomeDMsActivityFilesLater..•More>0.(aholJiminny Tech Day - 6h 2 m left100% С8• Fri 15 May 11:58:48-→Describe what you are looking forJiminny ...#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...^ Direct messages. Stoyan Tomov®. Galya DimitrovaR. Aneliya Angelova€. Vasil Vasileva. Stefka Stoyanova* Todor StamatovMario Georgiev. Nikolay Ivanovdo James Graham ". Stoyan TanevR. Steliyan Georgiev& Petko Kashinski. Lukas Kovalik y...::: AppsToastJira CloudGoogle Cale...# releases8 226 0• MessagesC Files• Bookmarks+20904-fix-updat^ ~~ an-activity-command59ea0d31 - Mt.Today ~-quest #12078 fromjiminny/JY-20904-fix-update-es-on-activity-commandjiminny/app| Added by GitHubCircleCI APP 11:09 AMDeployment Successful!Project: appWhen:05/15/202608:09:35Tag:View JobNewGitHub APP 11:36 AM4 new commits pushed tomasterby LakyLak8dac0dfa - JY-20903 Update activity stagewhen opportunity is changede883ed5b - JY-20903 revert changes incommand0d351159 - Merge branch 'master' into JY-20903-update_activity-stage-on-opportunity-change0e331f23 - Merge pull request #12077 fromjiminny/JY-20903-update_activity-stage-on-opportunity-changejiminny/app| Added by GitHubMessage #releases+...
|
47913
|
NULL
|
NULL
|
NULL
|
|
47916
|
1701
|
28
|
2026-05-15T08:58:48.868866+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835528868_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 JY-20891-improve-sms-text-relProiect vC)InviteUserToTeamaction.ong(c) UserinvitationD10.ohp© SmsRelayFailed.php=custom.logscratch &.ison= laravel.logA SF jiminny@localhost]A HS_local (jiminny@localhost]« console [PROD] XA console leu!PlanhatService.php© PlaybackService.php© PlaybackVideoOnlyService.php© PlaybookCategoryService.php© PlaylistGeneratorinterface.php© ResolveTeamCrmConnection.ph:© SimpleThrottleService.php© SlackService.php@ SocialAccountService.php© SoftPhoneService.php© TeamDeactivatedService.php© TeamOwnerService.php© TeamService.phpsms-relay-failed.blade.php xA console_7 [QAI PROD]A console [STAGING]@extends('emails.template')M.іAyoseccion content)651so>we're really sorry bur we coula nor send your cexc messace.‹o›<p>h1s 1s often due to the message beina too lonq.<p≥<p>Please contact support for more information, quoting reference {{ $textRelay->id_string }} and code {1 655Best wishes.<on›The Jiminny TeamcIranscoderaramererkesolver.oh© UserService.phr</0>dendsection(c) Uuid.oho> & Traits> D Usecases> D User•Uiils• M ValidationlmVophp helners.oho© InitialFrontendState.php(c) liminnv.ohoc) Dlan nhn© Serializer.php© TeamScimDetails.php> D bootstrap>D build>@ config|>@ contrib>@ database>©docs.>C front-end@lang> @ node modules library root>C phpstanD publicv D resourcesv Mviewsv D emailsv Mactivitiesactivity-live-coach-requesexport-link blade.oho.mailbox-failed.blade.ohpnot-olavable. blade.ohosms-received.blade.phpsms-relav-failed biade ohrtrack-rectored hlade nhnM calendars657659660661662663665666 V669671673682690692Tx: Autovselect * trom activity searches where 10 = 8/7147select * trom activity search_ tilters where activity search 1d = 8/7141SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuld to binl47842446-0151-4000-854t-cc6568290101'0 = UU1d:SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate Limits:select * from automated_report_results where media type = 'pdf' and status = 2and 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 x rron users where cean ld = < and emall ulke'%scott%' and id = 29510:SELECT * FROM activities WHERE uuid to bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid: # 79763436SELECT email provider id, COUNT(*) as count, GROUP CONCAT(id) as ids, GROUP CONCAT(status) as statusesFROM text relaysWHERE email provider id IN ('19e2027868a64b42'.'19e2033ed8ea6b10')GRuUP 8y emanl provider 105SELEcT 1d. status. telenhony provider id. created at.FROM activitiesWHERE 1d TN (80028719. 80028846)5SELECT 1d. status. code. email sent at. created at. uodated at.FROM text_relaysWHERESdN 09415. 3241699SELECT id status. code. senden, necinient. created atFROM text_relaysWHERE senden LTKE I%manio.aeoraiev%' OR senden LTKS I%stovan.tomov%!ORDER RY created at DESCIITMTT 10•SELECT id, vuid, status, code, sender, recipient, created_at, updated_atFROM text relaysWHERE vuid = uuid to bin('0626141c-27a6-4d8c-aff8-7c8020a2c656'):|do jiminny v040 A1 A40 V65 ^Jiminny Tech Day - 6h 2m left100% 2• Fri 15 May 11:58:48AskJiminnyReportActivityServiceTest vCascadeReview PR tor ActivityDebug Text Relay Faily+0 ..Hete is ted, email5t 2026at10:20 FMom: The Jiminny Team <[EMAIL]>Subiect: Your text message failed to sendr text message.Please contact support for more information, quoting reference 0626141c-27a6-4d8c-aff8-/c8020a2c656 and code 2200.Perrect. The email shows•Reference: 0626141c-27a6-4d8c-aff8-7c8020a2c656Code: 2200Code 2200 is REASON CODE SENDER MISMATCH (line 35 in EmailTextRelay.php), which meansThis is a different text relay record than the one we've been looking at (32416 has UUID 0x4CD18652A407AA2DA526870553821366 ). Let me find the record with UUID 9626141c-27a6-4d8c-aff8-7c89 |insalSELECT id, uuid, status, code, sender, recipient, created_at, updated_atFROM text_relaysWHERE uuld = uuld to b1n 0626141C-27a6-408c-att8-/c8626a2c656 :This will show the actual failed text relay record that triggered the failure email Stovan received.Your included weekly usage quota is exhausted. Using your extra usage. Quota resets May 17, 11:00 AMAsk anvthina (884-DSWE.1.6W Windsurf Teams 7:80 UTF-8Po 4 spaces...
|
NULL
|
-7642874081530678986
|
NULL
|
click
|
ocr
|
NULL
|
PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 JY-20891-improve-sms-text-relProiect vC)InviteUserToTeamaction.ong(c) UserinvitationD10.ohp© SmsRelayFailed.php=custom.logscratch &.ison= laravel.logA SF jiminny@localhost]A HS_local (jiminny@localhost]« console [PROD] XA console leu!PlanhatService.php© PlaybackService.php© PlaybackVideoOnlyService.php© PlaybookCategoryService.php© PlaylistGeneratorinterface.php© ResolveTeamCrmConnection.ph:© SimpleThrottleService.php© SlackService.php@ SocialAccountService.php© SoftPhoneService.php© TeamDeactivatedService.php© TeamOwnerService.php© TeamService.phpsms-relay-failed.blade.php xA console_7 [QAI PROD]A console [STAGING]@extends('emails.template')M.іAyoseccion content)651so>we're really sorry bur we coula nor send your cexc messace.‹o›<p>h1s 1s often due to the message beina too lonq.<p≥<p>Please contact support for more information, quoting reference {{ $textRelay->id_string }} and code {1 655Best wishes.<on›The Jiminny TeamcIranscoderaramererkesolver.oh© UserService.phr</0>dendsection(c) Uuid.oho> & Traits> D Usecases> D User•Uiils• M ValidationlmVophp helners.oho© InitialFrontendState.php(c) liminnv.ohoc) Dlan nhn© Serializer.php© TeamScimDetails.php> D bootstrap>D build>@ config|>@ contrib>@ database>©docs.>C front-end@lang> @ node modules library root>C phpstanD publicv D resourcesv Mviewsv D emailsv Mactivitiesactivity-live-coach-requesexport-link blade.oho.mailbox-failed.blade.ohpnot-olavable. blade.ohosms-received.blade.phpsms-relav-failed biade ohrtrack-rectored hlade nhnM calendars657659660661662663665666 V669671673682690692Tx: Autovselect * trom activity searches where 10 = 8/7147select * trom activity search_ tilters where activity search 1d = 8/7141SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuld to binl47842446-0151-4000-854t-cc6568290101'0 = UU1d:SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate Limits:select * from automated_report_results where media type = 'pdf' and status = 2and 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 x rron users where cean ld = < and emall ulke'%scott%' and id = 29510:SELECT * FROM activities WHERE uuid to bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid: # 79763436SELECT email provider id, COUNT(*) as count, GROUP CONCAT(id) as ids, GROUP CONCAT(status) as statusesFROM text relaysWHERE email provider id IN ('19e2027868a64b42'.'19e2033ed8ea6b10')GRuUP 8y emanl provider 105SELEcT 1d. status. telenhony provider id. created at.FROM activitiesWHERE 1d TN (80028719. 80028846)5SELECT 1d. status. code. email sent at. created at. uodated at.FROM text_relaysWHERESdN 09415. 3241699SELECT id status. code. senden, necinient. created atFROM text_relaysWHERE senden LTKE I%manio.aeoraiev%' OR senden LTKS I%stovan.tomov%!ORDER RY created at DESCIITMTT 10•SELECT id, vuid, status, code, sender, recipient, created_at, updated_atFROM text relaysWHERE vuid = uuid to bin('0626141c-27a6-4d8c-aff8-7c8020a2c656'):|do jiminny v040 A1 A40 V65 ^Jiminny Tech Day - 6h 2m left100% 2• Fri 15 May 11:58:48AskJiminnyReportActivityServiceTest vCascadeReview PR tor ActivityDebug Text Relay Faily+0 ..Hete is ted, email5t 2026at10:20 FMom: The Jiminny Team <[EMAIL]>Subiect: Your text message failed to sendr text message.Please contact support for more information, quoting reference 0626141c-27a6-4d8c-aff8-/c8020a2c656 and code 2200.Perrect. The email shows•Reference: 0626141c-27a6-4d8c-aff8-7c8020a2c656Code: 2200Code 2200 is REASON CODE SENDER MISMATCH (line 35 in EmailTextRelay.php), which meansThis is a different text relay record than the one we've been looking at (32416 has UUID 0x4CD18652A407AA2DA526870553821366 ). Let me find the record with UUID 9626141c-27a6-4d8c-aff8-7c89 |insalSELECT id, uuid, status, code, sender, recipient, created_at, updated_atFROM text_relaysWHERE uuld = uuld to b1n 0626141C-27a6-408c-att8-/c8626a2c656 :This will show the actual failed text relay record that triggered the failure email Stovan received.Your included weekly usage quota is exhausted. Using your extra usage. Quota resets May 17, 11:00 AMAsk anvthina (884-DSWE.1.6W Windsurf Teams 7:80 UTF-8Po 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47917
|
1701
|
29
|
2026-05-15T08:59:05.908693+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835545908_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Code changed:
Hide
Sync Changes
Hide This Notification
40
1
40
65
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');
Project
Project
New File or Directory…
Expand Selected
Expand All
Collapse All
Options
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":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.0944149,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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 'AskJiminnyReportActivityServiceTest'","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":"1","depth":4,"bounds":{"left":0.38530585,"top":0.10055866,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"3","depth":4,"bounds":{"left":0.39461437,"top":0.10055866,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.40425533,"top":0.09896249,"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.41156915,"top":0.09896249,"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":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\n }\n}","depth":4,"bounds":{"left":0.13430852,"top":0.054269753,"width":0.28424203,"height":0.94573027},"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Mail\\Activities;\n\nuse Illuminate\\Bus\\Queueable;\nuse Illuminate\\Queue\\SerializesModels;\nuse Illuminate\\Contracts\\Queue\\ShouldQueue;\nuse Jiminny\\Mail\\Mailable;\nuse Jiminny\\Models\\TextRelay;\n\nclass SmsRelayFailed extends Mailable implements ShouldQueue\n{\n use Queueable;\n use SerializesModels;\n\n /**\n * The Activity instance.\n *\n * @var TextRelay\n */\n public $textRelay;\n\n public $reason;\n\n public $code;\n\n /**\n * SmsRelayFailed constructor.\n */\n public function __construct(TextRelay $textRelay, string $reason, int $code = 0)\n {\n $this->textRelay = $textRelay;\n $this->reason = $reason;\n $this->code = $code;\n }\n\n /**\n * Build the message.\n */\n public function build(): static\n {\n $subject = 'Your text message failed to send';\n $originActivity = $this->textRelay->originActivity;\n\n if ($originActivity) {\n $to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;\n\n $subject .= ' to ' . $to;\n }\n\n return $this->view('emails.activities.sms-relay-failed')->subject($subject);\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.42021278,"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.42885637,"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.4398271,"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.44847074,"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.45711437,"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.4680851,"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.47905585,"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.5056516,"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.51662236,"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.75731385,"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":"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":"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":"AXStaticText","text":"40","depth":4,"bounds":{"left":0.72672874,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"1","depth":4,"bounds":{"left":0.7390292,"top":0.123703115,"width":0.00731383,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"40","depth":4,"bounds":{"left":0.74833775,"top":0.123703115,"width":0.010305851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"65","depth":4,"bounds":{"left":0.7606383,"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.7726064,"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.7799202,"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'\n# and id IN (32415, 32416);\nand 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');","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'\n# and id IN (32415, 32416);\nand 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');","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":"New File or Directory…","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":"Expand Selected","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":"Expand All","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":"Collapse All","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":"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}]...
|
-1889413980994870646
|
2218617733067978309
|
visual_change
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
1
3
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Mail\Activities;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
use Jiminny\Mail\Mailable;
use Jiminny\Models\TextRelay;
class SmsRelayFailed extends Mailable implements ShouldQueue
{
use Queueable;
use SerializesModels;
/**
* The Activity instance.
*
* @var TextRelay
*/
public $textRelay;
public $reason;
public $code;
/**
* SmsRelayFailed constructor.
*/
public function __construct(TextRelay $textRelay, string $reason, int $code = 0)
{
$this->textRelay = $textRelay;
$this->reason = $reason;
$this->code = $code;
}
/**
* Build the message.
*/
public function build(): static
{
$subject = 'Your text message failed to send';
$originActivity = $this->textRelay->originActivity;
if ($originActivity) {
$to = $originActivity->prospect_name ?? $originActivity->to->national_phone_number;
$subject .= ' to ' . $to;
}
return $this->view('emails.activities.sms-relay-failed')->subject($subject);
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution Settings…
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny
Code changed:
Hide
Sync Changes
Hide This Notification
40
1
40
65
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');
Project
Project
New File or Directory…
Expand Selected
Expand All
Collapse All
Options
Hide...
|
47916
|
NULL
|
NULL
|
NULL
|
|
47918
|
1700
|
16
|
2026-05-15T08:59:10.582629+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835550582_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-1362947798257697316
|
-2575675244731720149
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴1DEV (-zsh)APP (-zsh)83-zsh₴4root@docker_lamp_1:/home/jiminny# phpartisanactivity:update:es 422003Foundactivity ID: 422003,UUID: f43cf158-e60d-46e5-92f8-c4e0594a3219Sending activity for ES update...Done.root@docker_lamp_1:/home/jiminny#What's next:Try Docker Debug forseamless, persistent debugging tools in any container or image →Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-failed to connect to the docker API at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-HomeDMsActivityFilesLater..•More-Jiminny ...#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...^ Direct messages. Stoyan TomovGalya DimitrovaR. Aneliya Angelova€. Vasil Vasilevã. Stefka Stoyanova* Todor StamatovMario Georgiev. Nikolay Ivanovdo James Graham ". Stoyan TanevR. Steliyan Georgiev& Petko Kashinski. Lukas Kovalik y...::: AppsToastJira CloudGoogle Cale...Jiminny Tech Day - 6h 1 m left100% С8• Fri 15 May 11:59:10Describe what you are looking for# releases8 226 0• MessagesC Files• Bookmarks+20904-fix-updat^ ~~ an-activity-command59ea0d31 - Mt.Today ~-quest #12078 fromjiminny/JY-20904-fix-update-es-on-activity-commandjiminny/app| Added by GitHubCircleCI APP 11:09 AMDeployment Successful!Project: appWhen:05/15/202608:09:35Tag:View JobNewGitHub APP 11:36 AM4 new commits pushed tomasterby LakyLak8dac0dfa - JY-20903 Update activity stagewhen opportunity is changede883ed5b - JY-20903 revert changes incommand0d351159 - Merge branch 'master' into JY-20903-update_activity-stage-on-opportunity-change0e331f23 - Merge pull request #12077 fromjiminny/JY-20903-update_activity-stage-on-opportunity-changejiminny/app| Added by GitHubMessage #releases+...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47922
|
1700
|
18
|
2026-05-15T08:59:19.116087+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835559116_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴ SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴1DEV (-zsh)APP (-zsh)83-zsh₴4root@docker_lamp_1:/home/jiminny# phpartisanactivity:update:es 422003Foundactivity ID: 422003,UUID: f43cf158-e60d-46e5-92f8-c4e0594a3219Sending activity for ES update...Done.root@docker_lamp_1:/home/jiminny#What's next:Try Docker Debug forseamless, persistent debugging tools in any container or image →Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-failed to connect to the docker API at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-HomeDMsActivityFilesLater..•More> 0.Jiminny Tech Day - 6h 1 m left100% С8• Fri 15 May 11:59:18-Describe what you are looking forJiminny ...#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...^ Direct messages. Stoyan TomovGalya DimitrovaR. Aneliya Angelova€. Vasil Vasileva. Stefka Stoyanova* Todor StamatovMario Georgiev. Nikolay Ivanovdo James Graham ". Stoyan TanevR. Steliyan Georgiev& Petko Kashinski. Lukas Kovalik y...::: AppsToastJira CloudGoogle Cale...# releases8 226 0• MessagesC Files• Bookmarks+20904-fix-updat^ ~~ an-activity-command59ea0d31 - Mt._Today~-quest #12078 fromjiminny/JY-20904-fix-update-es-on-activity-commandjiminny/app| Added by GitHubCircleCI APP 11:09 AMDeployment Successful!Project: appWhen:05/15/202608:09:35Tag:View JobNewGitHub APP 11:36 AM4 new commits pushed tomaster by LakyLak8dac0dfa - JY-20903 Update activity stagewhen opportunity is changede883ed5b - JY-20903 revert changes incommand0d351159 - Merge branch 'master' into JY-20903-update_activity-stage-on-opportunity-change0e331f23 - Merge pull request #12077 fromjiminny/JY-20903-update_activity-stage-on-opportunity-changejiminny/app| Added by GitHubMessage #releases+...
|
NULL
|
-2737442910727669303
|
NULL
|
click
|
ocr
|
NULL
|
SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴ SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴1DEV (-zsh)APP (-zsh)83-zsh₴4root@docker_lamp_1:/home/jiminny# phpartisanactivity:update:es 422003Foundactivity ID: 422003,UUID: f43cf158-e60d-46e5-92f8-c4e0594a3219Sending activity for ES update...Done.root@docker_lamp_1:/home/jiminny#What's next:Try Docker Debug forseamless, persistent debugging tools in any container or image →Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-failed to connect to the docker API at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-HomeDMsActivityFilesLater..•More> 0.Jiminny Tech Day - 6h 1 m left100% С8• Fri 15 May 11:59:18-Describe what you are looking forJiminny ...#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...^ Direct messages. Stoyan TomovGalya DimitrovaR. Aneliya Angelova€. Vasil Vasileva. Stefka Stoyanova* Todor StamatovMario Georgiev. Nikolay Ivanovdo James Graham ". Stoyan TanevR. Steliyan Georgiev& Petko Kashinski. Lukas Kovalik y...::: AppsToastJira CloudGoogle Cale...# releases8 226 0• MessagesC Files• Bookmarks+20904-fix-updat^ ~~ an-activity-command59ea0d31 - Mt._Today~-quest #12078 fromjiminny/JY-20904-fix-update-es-on-activity-commandjiminny/app| Added by GitHubCircleCI APP 11:09 AMDeployment Successful!Project: appWhen:05/15/202608:09:35Tag:View JobNewGitHub APP 11:36 AM4 new commits pushed tomaster by LakyLak8dac0dfa - JY-20903 Update activity stagewhen opportunity is changede883ed5b - JY-20903 revert changes incommand0d351159 - Merge branch 'master' into JY-20903-update_activity-stage-on-opportunity-change0e331f23 - Merge pull request #12077 fromjiminny/JY-20903-update_activity-stage-on-opportunity-changejiminny/app| Added by GitHubMessage #releases+...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47923
|
1701
|
32
|
2026-05-15T08:59:19.132939+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835559132_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 JY-20891-improve-sms-text-relay:Proiect vC InviteUserToTeamAction.onp(c) UserinvitationD10.ohpPlanhatService.php© PlaybackService.php© PlaybackVideoOnlyService.php© PlaybookCategoryService.php© PlaylistGeneratorinterface.php© ResolveTeamCrmConnection.ph© SimpleThrottleService.php© SlackService.php@ SocialAccountService.php© SoftPhoneService.php© TeamDeactivatedService.php© TeamOwnerService.php© TeamService.phpsms-relay-failed.blade.php x,template')ly sorry bur we coula nor send your cexc messace.so›ften due to the message being too long.‹</p›ntact support for more information, quoting reference {{ StextRelay->id string }} and code {{ Scode }}.</p>nes.consony TeamcIranscoderaramererkesolver.oh© UserService.phr(c) Uuid.oho> & Traits> D Usecases> D User•Uiils• M Validationl,mVo.php helners.oho© InitialFrontendState.php(c) liminnv.ohoc) Dlan nhn i© Serializer.php© TeamScimDetails.php> D bootstrap>D build>@ config|>@ contrib>@ database>©docs.>C front-end@lang> @ node modules library root>C phpstanD publicv D resourcesv Mviewsv D emailsv Mactivitiesactivity-live-coach-requesexport-link blade.oho.mailbox-failed.blade.ohpnot-olavable.blade.ohosms-received.blade.phpsms-relav-failed biade ohrtrack-rectored hlade nhnM calendars=custom.logscratch &.ison= laravel.logA SF jiminny@localhost]A HS_local (jiminny@localhost]« console [PROD] XA console leu!7 console_7 [QAI PROD]~/jiminny/app/app/Mail/Activities/SmsRelayFailed.php V669671690692A console [STAGING]Tx: Autoydo jiminny vselect * trom activity searches where 10 = 8/7147040 A1 A40 V 65 ^select * trom activity search_ tilters where activity search 1d = 8/7141SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuld to binl47842446-0151-4000-854t-cc6568290101'0 = UU1d:SELECT * FROM crm_configurations WHERE provider = 'hubspot' ;select * from rate Limits:select * from automated_report_results where media type = 'pdf' and status = 2and 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 x rron users where cean ld = < and emall ulke'%scott%' and id = 29510:SELECT * FROM activities WHERE uuid to bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid: # 79763436SELECT email provider id, COUNT(*) as count, GROUP CONCAT(id) as ids, GROUP CONCAT(status) as statusesFROM text relaysWHERE email provider id IN ('19e2027868a64b42'.'19e2033ed8ea6b10')GRuUP 8y emanl provider 105SELEcT 1d. status. telenhony provider 1d. created at.FROM activitiesWHERE id IN (80028719. 80028846)SELECT 1d. status. code. email sent at. created at. uodated at.FROM text_relaysWHERESdN 09415. 3241699SELECT id status. code. senden, necinient. created atFROM text_relaysWHERE senden LTKE I%manio.aeoraiev%' OR senden LTKS I%stovan.tomov%!ORDER RY created at DESCIITMTT 10•SELECT id, vuid, status, code, sender, recipient, created_at, updated_atFROM text relaysWHERE vuid = uuid to bin('0626141c-27a6-4d8c-aff8-7c8020a2c656'):|# Jiminny Tech Day - 6h 1m lef100% 52• Fri 15 May 11:59:19AskJiminnyReportActivityServiceTest vCascadeReview PR for ActivityDebug Text Relay Faily+0 ..Hete is ted, email5t 2026at10:20 FMom: The Jiminny Team <[EMAIL]>Subiect: Your text message failed to sendr text message.Please contact support for more information, quoting reference 0626141c-27a6-4d8c-aff8-/c8020a2c656 and code 2200.Perrect. The email shows•Reference: 0626141c-27a6-4d8c-aff8-7c8020a2c656Code: 2200Code 2200 is REASON CODE SENDER MISMATCH (line 35 in EmailTextRelay.php), which meansThis is a different text relay record than the one we've been looking at (32416 has UUID 0x4CD18652A407AA2DA526870553821366 ). Let me find the record with UUID 9626141c-27a6-4d8c-aff8-7c89 |i salSELECT id, uuid, status, code, sender, recipient, created_at, updated_atFROM text_relaysWHERE uuld = uuld to b1n 0626141C-27a6-408c-att8-/c8626a2c656 :This will show the actual failed text relay record that triggered the failure email Stovan received.Your included weekly usage quota is exhausted. Using your extra usage. Quota resets May 17, 11:00 AMAsk anvthina (84L)SWE.1.6W Windsurf Toams 7-84/10 charchUTE.8Po 4 spaces...
|
NULL
|
-3496006567050465386
|
NULL
|
click
|
ocr
|
NULL
|
PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 JY-20891-improve-sms-text-relay:Proiect vC InviteUserToTeamAction.onp(c) UserinvitationD10.ohpPlanhatService.php© PlaybackService.php© PlaybackVideoOnlyService.php© PlaybookCategoryService.php© PlaylistGeneratorinterface.php© ResolveTeamCrmConnection.ph© SimpleThrottleService.php© SlackService.php@ SocialAccountService.php© SoftPhoneService.php© TeamDeactivatedService.php© TeamOwnerService.php© TeamService.phpsms-relay-failed.blade.php x,template')ly sorry bur we coula nor send your cexc messace.so›ften due to the message being too long.‹</p›ntact support for more information, quoting reference {{ StextRelay->id string }} and code {{ Scode }}.</p>nes.consony TeamcIranscoderaramererkesolver.oh© UserService.phr(c) Uuid.oho> & Traits> D Usecases> D User•Uiils• M Validationl,mVo.php helners.oho© InitialFrontendState.php(c) liminnv.ohoc) Dlan nhn i© Serializer.php© TeamScimDetails.php> D bootstrap>D build>@ config|>@ contrib>@ database>©docs.>C front-end@lang> @ node modules library root>C phpstanD publicv D resourcesv Mviewsv D emailsv Mactivitiesactivity-live-coach-requesexport-link blade.oho.mailbox-failed.blade.ohpnot-olavable.blade.ohosms-received.blade.phpsms-relav-failed biade ohrtrack-rectored hlade nhnM calendars=custom.logscratch &.ison= laravel.logA SF jiminny@localhost]A HS_local (jiminny@localhost]« console [PROD] XA console leu!7 console_7 [QAI PROD]~/jiminny/app/app/Mail/Activities/SmsRelayFailed.php V669671690692A console [STAGING]Tx: Autoydo jiminny vselect * trom activity searches where 10 = 8/7147040 A1 A40 V 65 ^select * trom activity search_ tilters where activity search 1d = 8/7141SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuld to binl47842446-0151-4000-854t-cc6568290101'0 = UU1d:SELECT * FROM crm_configurations WHERE provider = 'hubspot' ;select * from rate Limits:select * from automated_report_results where media type = 'pdf' and status = 2and 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 x rron users where cean ld = < and emall ulke'%scott%' and id = 29510:SELECT * FROM activities WHERE uuid to bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid: # 79763436SELECT email provider id, COUNT(*) as count, GROUP CONCAT(id) as ids, GROUP CONCAT(status) as statusesFROM text relaysWHERE email provider id IN ('19e2027868a64b42'.'19e2033ed8ea6b10')GRuUP 8y emanl provider 105SELEcT 1d. status. telenhony provider 1d. created at.FROM activitiesWHERE id IN (80028719. 80028846)SELECT 1d. status. code. email sent at. created at. uodated at.FROM text_relaysWHERESdN 09415. 3241699SELECT id status. code. senden, necinient. created atFROM text_relaysWHERE senden LTKE I%manio.aeoraiev%' OR senden LTKS I%stovan.tomov%!ORDER RY created at DESCIITMTT 10•SELECT id, vuid, status, code, sender, recipient, created_at, updated_atFROM text relaysWHERE vuid = uuid to bin('0626141c-27a6-4d8c-aff8-7c8020a2c656'):|# Jiminny Tech Day - 6h 1m lef100% 52• Fri 15 May 11:59:19AskJiminnyReportActivityServiceTest vCascadeReview PR for ActivityDebug Text Relay Faily+0 ..Hete is ted, email5t 2026at10:20 FMom: The Jiminny Team <[EMAIL]>Subiect: Your text message failed to sendr text message.Please contact support for more information, quoting reference 0626141c-27a6-4d8c-aff8-/c8020a2c656 and code 2200.Perrect. The email shows•Reference: 0626141c-27a6-4d8c-aff8-7c8020a2c656Code: 2200Code 2200 is REASON CODE SENDER MISMATCH (line 35 in EmailTextRelay.php), which meansThis is a different text relay record than the one we've been looking at (32416 has UUID 0x4CD18652A407AA2DA526870553821366 ). Let me find the record with UUID 9626141c-27a6-4d8c-aff8-7c89 |i salSELECT id, uuid, status, code, sender, recipient, created_at, updated_atFROM text_relaysWHERE uuld = uuld to b1n 0626141C-27a6-408c-att8-/c8626a2c656 :This will show the actual failed text relay record that triggered the failure email Stovan received.Your included weekly usage quota is exhausted. Using your extra usage. Quota resets May 17, 11:00 AMAsk anvthina (84L)SWE.1.6W Windsurf Toams 7-84/10 charchUTE.8Po 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47931
|
1701
|
36
|
2026-05-15T08:59:29.796813+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835569796_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.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
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
PhostormVIewINavicarecode Project: faVsco.js, menu
PhostormVIewINavicarecodeFV faVsco.js°9 JY-20891-improve-sms-text-relProiect vC)InviteUserToTeamaction.ong(c) UserinvitationD10.ohpC EmailTextRelay.php X© SmsRelayFailed.phpiilg createlnoox.onpC DeleteEmailMessagesJoo.ongsms-relay-failed.blade.phpclass chartlexckelay excenas Jod Inplements shoulauueuecmalllextkelay.onppubLic tunccion nanalelc Processtmallsonerass.ong_ Meeuinabolw Telephony0 UserБBEBEEc) ChangeEmailJob.ohp@ DeactivateUser.Job.ohn© DeleteScheduledUserActivitie 12€© SetupDefaultSavedSearches.| 127© SyncTolntercom.php© SyncToPlanhat.php© SyncToUserPilot.phpc. RaceProceccing.loh.nhn(c) Dummv.loh.nhn© ImportRecallAlRecordingsJob.ph 133© ImportRemoteTrackJob.phpG Job.php(C).lohDicnatcher nhn© JobDispatcherInterface.php© PurgeSoftDeletedOpportunityJot 138T SqsVisibilityControl.phpv C Listenersv @ Activitiesv @ ActivityProvider> @ JustCallv D UserPilot© TrackProviderInstalledE 145>C Audic> MBotsv@ CoachingIntercomv Planhat© CreateActivityLoggedE' 151(C) CreateCoachinaFeedba 1c4(C) CreatecoachinaFeedha nc.© CreateCoachingFocusC 154(C) CreateCoachingFocusP ncel© CreateCommentedEver 15%© CreateManagerCoache: 15%© CreatePlayedEvent.php 158© CreateSelfCoachedEvel 159© CreateSharedEvent.php 160l)MlicorDilot© CreateAvailabilityNotificati 162© CreateCoachingFeedbackl 1Checked out IV.20801_imnrove.Sactivity = $messagingService->buildActivity(smessage">stdtype: Activity::TYPE_SMS_OUTBOUND,Suser->softphone_number,Sth1S->coschis->cext,strtolover (8this>sactvatyonsgin=»prospect ? Sthis-›actávity0nigin-sprospect-scmm_provider_.id E66strtolowerschis-›acuivirvurzozn->prospect rype)countrycode: nuluSthis->textRelav->updateCl'oriqin activity 1d' => Sthis->activitv0rigin->id.= Sactivitv->1d."status' => TextRelav: • STATUS PROCESSEDI} catch (TextRelayException $e) {Sthis->textRelav->undatedi'status' => TextRelav:•STATUS FATLED.'codel => Se->aetCodeo.i$sender = $this->parseSender(Sheaders['From']):// If we can pull the sender, tell them that it failed.i4 (Scenden)SSresponder = (new SmsRelayFailed(Sthis->textRelay, $e->getMessage•, $e->getCodeO))->onQueue( queue: Constants::QUEUE_EMAILS):} catch (\Exception $e) {Sthis->textRelay->updateCi'status' => TextRelav::STATUS_FAILED.'code => self::REASON_CODE UNKNOWN.Sentry::cantureExcention Se):finally&Delete the message from the emall server Git Lives for 30 davs)..Sthis->trashMessade(Smail Service, Sthis->messageld):=custom.logscratch &.ison= laravel.logA SF jiminny@localhost]A HS_local (jiminny@localhost]« console [PROD] XA console leu!A console_7 [QAI PROD]mee9MiAy652_654— 658[659663— 664665666 V669- 672992382384685686- 687—688689696692=693A console [STAGING]Tx: Autoydo jiminny vselect * trom activity searches where 10 = 8/1147040 A1 A40 V65 ^select * trom activity search_ tilters where activity search 1d = 8/7141SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuld to binl47842446-0151-4000-854t-cc6568290101'0 = UU1d:SELECT * FROM crm_configurations WHERE provider = 'hubspot' ;select * from rate Limits:select * from automated_report_results where media type = 'pdf' and status = 2and 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 x rron users where cean ld = < and emall ulke'%scott%' and id = 29510:SELECT * FROM activities WHERE uuid to bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid: # 79763436SELECT email provider id, COUNT(*) as count, GROUP CONCAT(id) as ids, GROUP CONCAT(status) as statusesFROM text relaysemail provider id IN ('19e2027868a64b42'."yezusseddeaob10'))GRuUP 8y emanl provider 105SELEcT 1d. status. telenhony provider id. created at.FROM activitiesWHERE 1d TN (80028719. 80028846)5SELECT 1d. status. code. email sent at. created at. uodated at.FROM text_relaysSELECT id status. code. senden, necinient. created atEROM text nelavsWHERE senden LTKE I%manio.aeoraiev%' OR senden LTKS I%stovan.tomov%!ORDER RY created at DESCIITMTT 10•SELECT id, vuid, status, code, sender, recipient, created_at, updated_atFROM text relaysWHERE vuid = uuid to bin('0626141c-27a6-4d8c-aff8-7c8020a2c656'):|# Jiminny Tech Day - 6h 1m lef100% 2• Fri 15 May 11:59:29AskJiminnyReportActivityServiceTest vCascadeReview PR tor ActivityDebug Text Relay Faily+0 ..Hete is ted, email5t 2026at10:20 FMom: The Jiminny Team <[EMAIL]>Subiect: Your text message failed to sendr text message.Please contact support for more information, quoting reference 0626141c-27a6-4d8c-aff8-/c8020a2c656 and code 2200.Perrect. The email shows•Reference: 0626141c-27a6-4d8c-aff8-7c8020a2c656Code: 2200Code 2200 is REASON CODE SENDER MISMATCH (line 35 in EmailTextRelay.php), which meansThis is a different text relay record than the one we've been looking at (32416 has UUID 0x4CD18652A407AA2DA526870553821366 ). Let me find the record with UUID 9626141c-27a6-4d8c-aff8-7c89 |insalSELECT id, uuid, status, code, sender, recipient, created_at, updated_atFROM text_relaysWHERE uuld = uuld to b1n 0626141C-27a6-408c-att8-/c8626a2c656 :This will show the actual failed text relay record that triggered the failure email Stovan received.al -Your included weekly usage quota is exhausted. Using your extra usage. Quota resets May 17, 11:00 AMAsk anvthina (84-DSWE.1.6WN Windsurf Toams 146-41UTF.8Po 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47932
|
1700
|
23
|
2026-05-15T08:59:40.750061+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835580750_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, 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":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays<br/>109 incoming commits<br/>","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-1362947798257697316
|
-2575675244731720149
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴1DEV (-zsh)APP (-zsh)83-zsh₴4root@docker_lamp_1:/home/jiminny# phpartisanactivity:update:es 422003Foundactivity ID: 422003,UUID: f43cf158-e60d-46e5-92f8-c4e0594a3219Sending activity for ES update...Done.root@docker_lamp_1:/home/jiminny#What's next:Try Docker Debug forseamless, persistent debugging tools in any container or image →Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-failed to connect to the docker API at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-HomeDMsActivityFilesLater..•More> 0.Jiminny Tech Day - 6h 1 m left100% С8• Fri 15 May 11:59:40-Describe what you are looking forJiminny ...#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...^ Direct messages. Stoyan TomovGalya DimitrovaR. Aneliya Angelova€. Vasil Vasileva. Stefka Stoyanova* Todor StamatovMario Georgiev. Nikolay Ivanovdo James Graham ". Stoyan TanevR. Steliyan Georgiev& Petko Kashinski. Lukas Kovalik y...::: AppsToastJira CloudGoogle Cale...# releases8 22• MessagesC Files• Bookmarks+20904-fix-updat^ ~~ an-activity-command59ea0d31 - Mt._Today~-quest #12078 fromjiminny/JY-20904-fix-update-es-on-activity-commandjiminny/app| Added by GitHubCircleCI APP 11:09 AMDeployment Successful!Project: appWhen:05/15/202608:09:35Tag:View JobNewGitHub APP 11:36 AM4 new commits pushed tomaster by LakyLak8dac0dfa - JY-20903 Update activity stagewhen opportunity is changede883ed5b - JY-20903 revert changes incommand0d351159 - Merge branch 'master' into JY-20903-update_activity-stage-on-opportunity-change0e331f23 - Merge pull request #12077 fromjiminny/JY-20903-update_activity-stage-on-opportunity-changejiminny/app| Added by GitHubMessage #releases+...
|
47930
|
NULL
|
NULL
|
NULL
|
|
47934
|
1700
|
24
|
2026-05-15T08:59:43.554208+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835583554_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴ SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴1DEV (-zsh)APP (-zsh)83-zsh₴4root@docker_lamp_1:/home/jiminny# phpartisanactivity:update:es 422003Foundactivity ID: 422003,UUID: f43cf158-e60d-46e5-92f8-c4e0594a3219Sending activity for ES update...Done.root@docker_lamp_1:/home/jiminny#What's next:Try Docker Debug forseamless, persistent debugging tools in any container or image →Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-failed to connect to the docker API at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-HomeDMsActivityFilesLater..•More> 0.Jiminny Tech Day - 6h 1 m left100% С8• Fri 15 May 11:59:43-Describe what you are looking forJiminny ...#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...^ Direct messages. Stoyan TomovGalya DimitrovaR. Aneliya Angelova€. Vasil Vasileva. Stefka Stoyanova* Todor StamatovMario Georgiev. Nikolay Ivanovdo James Graham ". Stoyan TanevR. Steliyan Georgiev& Petko Kashinski. Lukas Kovalik y...::: AppsToastJira CloudGoogle Cale...# releases8 226 0• MessagesC FilesBookmarks+20904-fix-updat^ ~~ an-activity-command59ea0d31 - Mt._Today~-quest #12078 fromjiminny/JY-20904-fix-update-es-on-activity-commandjiminny/app| Added by GitHubCircleCI APP 11:09 AMDeployment Successful!Project: appWhen:05/15/202608:09:35Tag:View JobNewGitHub APP 11:36 AM4 new commits pushed tomaster by LakyLak8dac0dfa - JY-20903 Update activity stagewhen opportunity is changede883ed5b - JY-20903 revert changes incommand0d351159 - Merge branch 'master' into JY-20903-update_activity-stage-on-opportunity-change0e331f23 - Merge pull request #12077 fromjiminny/JY-20903-update_activity-stage-on-opportunity-changejiminny/app| Added by GitHubMessage #releases+...
|
NULL
|
4828356378192993210
|
NULL
|
click
|
ocr
|
NULL
|
SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴ SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴1DEV (-zsh)APP (-zsh)83-zsh₴4root@docker_lamp_1:/home/jiminny# phpartisanactivity:update:es 422003Foundactivity ID: 422003,UUID: f43cf158-e60d-46e5-92f8-c4e0594a3219Sending activity for ES update...Done.root@docker_lamp_1:/home/jiminny#What's next:Try Docker Debug forseamless, persistent debugging tools in any container or image →Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-failed to connect to the docker API at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-HomeDMsActivityFilesLater..•More> 0.Jiminny Tech Day - 6h 1 m left100% С8• Fri 15 May 11:59:43-Describe what you are looking forJiminny ...#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...^ Direct messages. Stoyan TomovGalya DimitrovaR. Aneliya Angelova€. Vasil Vasileva. Stefka Stoyanova* Todor StamatovMario Georgiev. Nikolay Ivanovdo James Graham ". Stoyan TanevR. Steliyan Georgiev& Petko Kashinski. Lukas Kovalik y...::: AppsToastJira CloudGoogle Cale...# releases8 226 0• MessagesC FilesBookmarks+20904-fix-updat^ ~~ an-activity-command59ea0d31 - Mt._Today~-quest #12078 fromjiminny/JY-20904-fix-update-es-on-activity-commandjiminny/app| Added by GitHubCircleCI APP 11:09 AMDeployment Successful!Project: appWhen:05/15/202608:09:35Tag:View JobNewGitHub APP 11:36 AM4 new commits pushed tomaster by LakyLak8dac0dfa - JY-20903 Update activity stagewhen opportunity is changede883ed5b - JY-20903 revert changes incommand0d351159 - Merge branch 'master' into JY-20903-update_activity-stage-on-opportunity-change0e331f23 - Merge pull request #12077 fromjiminny/JY-20903-update_activity-stage-on-opportunity-changejiminny/app| Added by GitHubMessage #releases+...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47935
|
1701
|
38
|
2026-05-15T08:59:43.591850+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835583591_m2.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 JY-20891-improve-sms-text-relay:Proiect vC)InviteUserToTeamaction.ong(c) UserinvitationD10.ohp© SmsRelayFailed.php xPlanhatService.php© PlaybackService.php© PlaybackVideoOnlyService.php© PlaybookCategoryService.php© PlaylistGeneratorinterface.php© ResolveTeamCrmConnection.ph© SimpleThrottleService.php© SlackService.php@ SocialAccountService.php© SoftPhoneService.php© TeamDeactivatedService.php© TeamOwnerService.php© TeamService.phpsms-relay-failed.blade.php x,template')M.іAyly sorry buc we coula nor send your cexc messace.<o>ften due to the message being too long.‹</p›ntact support for more information, quoting reference {{ StextRelay->id string }} and code {{ Scode }}.</p>nes.consony TeamcIranscoderaramererkesolver.oh© UserService.phr(c) Uuid.oho> & Traits> D Usecases> D User•Uiils• M Validationl,mVo.php helners.oho© InitialFrontendState.php(c) liminnv.ohoc) Dlan nho© Serializer.php© TeamScimDetails.php> D bootstrap> D build.>@ config|>@ contrib>@ database>@ docs.>C front-end@lang> @ node modules library root>C phpstanD publicv D resourcesv Mviewsv D emailsv Mactivitiesactivity-live-coach-requesexport-link blade.oho.mailbox-failed.blade.ohpnot-olavable.blade.ohosms-received.blade.phpsms-relav-failed biade ohrtrack-rectored hlade nhnM calendarsChecked out.IV.20801_imnrove-cmc-teyt-rolavs (28 minutes aao)l=custom.logscratch &.ison= laravel.logA SF jiminny@localhost]A HS_local (jiminny@localhost]« console [PROD] XA console leu!A console_7 [QAI PROD]655657659660661662663665666 V669690692A console [STAGING]Tx: Autovdo jiminny vselect * trom activity searches where 10 = 8/7147040 A1 A40 V65 ^select * trom activity search_ tilters where activity search 1d = 8/7141SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuld to binl47842446-0151-4000-854t-cc6568290101'0 = UU1d:SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate Limits:select * from automated_report_results where media type = 'pdf' and status = 2and 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 x rron users where cean ld = < and emall ulke'%scott%' and id = 29510:SELECT * FROM activities WHERE uuid to bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid: # 79763436SELECT email provider id, COUNT(*) as count, GROUP CONCAT(id) as ids, GROUP CONCAT(status) as statusesFROM text relaysWHERE email provider id IN ('19e2027868a64b42'."yezusseddeaob10'))GRuUP 8y emanl provider 105SELEcT 1d. status. telenhony provider 1d. created at.FROM activitiesWHERE 1d TN (80028719. 80028846)5SELECT 1d. status. code. email sent at. created at. uodated at.FROM text_relaysWHEREJdIN 62415. 3241699SELECT id status. code. senden, necinient. created atFROM text_relaysWHERE senden LTKE I%manio.aeoraiev%' OR senden LTKS I%stovan.tomov%!ORDER RY created at DESCIITMTT 10•SELECT id, vuid, status, code, sender, recipient, created_at, updated_atFROM text relaysWHERE vuid = uuid to bin('0626141c-27a6-4d8c-aff8-7c8020a2c656'):|# Jiminny Tech Day - 6h 1m lef100% 2• Fri 15 May 11:59:43U AskJiminnyReportActivityServiceTest vCascadeReview PR tor ActivityDebug Text Relay Faily+0 ..Hete is ted, email5t 2026at10:20 FMom: The Jiminny Team <[EMAIL]>Subiect: Your text message failed to sendr text message.Please contact support for more information, quoting reference 0626141c-27a6-4d8c-aff8-/c8020a2c656 and code 2200.Perrect. The email shows•Reference: 0626141c-27a6-4d8c-aff8-7c8020a2c656Code: 2200Code 2200 is REASON CODE SENDER MISMATCH (line 35 in EmailTextRelay.php), which meansThis is a different text relay record than the one we've been looking at (32416 has UUID 0x4CD18652A407AA2DA526870553821366 ). Let me find the record with UUID 9626141c-27a6-4d8c-aff8-7c89 |i salSELECT id, uuid, status, code, sender, recipient, created_at, updated_atFROM text_relaysWHEREuuld = uuld to b1n 0626141c-27a6-408c-atf8-/c8626azc656':This will show the actual failed text relay record that triggered the failure email Stovan received.A Your included weekly usage quota is exhausted. Using your extra usage. Quota resets May 17, 11:00 AMAsk anvthina (84L)SWE.1.6W Windsurf Toams 7-84/10 charchUTE.8Po 4 spaces...
|
NULL
|
-3262040048995470338
|
NULL
|
click
|
ocr
|
NULL
|
PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 PhpStormViewINavicarecodeWindowmelpFV faVsco.js°9 JY-20891-improve-sms-text-relay:Proiect vC)InviteUserToTeamaction.ong(c) UserinvitationD10.ohp© SmsRelayFailed.php xPlanhatService.php© PlaybackService.php© PlaybackVideoOnlyService.php© PlaybookCategoryService.php© PlaylistGeneratorinterface.php© ResolveTeamCrmConnection.ph© SimpleThrottleService.php© SlackService.php@ SocialAccountService.php© SoftPhoneService.php© TeamDeactivatedService.php© TeamOwnerService.php© TeamService.phpsms-relay-failed.blade.php x,template')M.іAyly sorry buc we coula nor send your cexc messace.<o>ften due to the message being too long.‹</p›ntact support for more information, quoting reference {{ StextRelay->id string }} and code {{ Scode }}.</p>nes.consony TeamcIranscoderaramererkesolver.oh© UserService.phr(c) Uuid.oho> & Traits> D Usecases> D User•Uiils• M Validationl,mVo.php helners.oho© InitialFrontendState.php(c) liminnv.ohoc) Dlan nho© Serializer.php© TeamScimDetails.php> D bootstrap> D build.>@ config|>@ contrib>@ database>@ docs.>C front-end@lang> @ node modules library root>C phpstanD publicv D resourcesv Mviewsv D emailsv Mactivitiesactivity-live-coach-requesexport-link blade.oho.mailbox-failed.blade.ohpnot-olavable.blade.ohosms-received.blade.phpsms-relav-failed biade ohrtrack-rectored hlade nhnM calendarsChecked out.IV.20801_imnrove-cmc-teyt-rolavs (28 minutes aao)l=custom.logscratch &.ison= laravel.logA SF jiminny@localhost]A HS_local (jiminny@localhost]« console [PROD] XA console leu!A console_7 [QAI PROD]655657659660661662663665666 V669690692A console [STAGING]Tx: Autovdo jiminny vselect * trom activity searches where 10 = 8/7147040 A1 A40 V65 ^select * trom activity search_ tilters where activity search 1d = 8/7141SELECT * FROM activities WHERE uuid_to_bin('8827f672-202d-4162-9d04-73ff5f0566a9') = uuidor uuld to binl47842446-0151-4000-854t-cc6568290101'0 = UU1d:SELECT * FROM crm_configurations WHERE provider = 'hubspot';select * from rate Limits:select * from automated_report_results where media type = 'pdf' and status = 2and 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 x rron users where cean ld = < and emall ulke'%scott%' and id = 29510:SELECT * FROM activities WHERE uuid to bin('67cebfc2-ed56-44a2-8c68-7a0286ed8618') = uuid: # 79763436SELECT email provider id, COUNT(*) as count, GROUP CONCAT(id) as ids, GROUP CONCAT(status) as statusesFROM text relaysWHERE email provider id IN ('19e2027868a64b42'."yezusseddeaob10'))GRuUP 8y emanl provider 105SELEcT 1d. status. telenhony provider 1d. created at.FROM activitiesWHERE 1d TN (80028719. 80028846)5SELECT 1d. status. code. email sent at. created at. uodated at.FROM text_relaysWHEREJdIN 62415. 3241699SELECT id status. code. senden, necinient. created atFROM text_relaysWHERE senden LTKE I%manio.aeoraiev%' OR senden LTKS I%stovan.tomov%!ORDER RY created at DESCIITMTT 10•SELECT id, vuid, status, code, sender, recipient, created_at, updated_atFROM text relaysWHERE vuid = uuid to bin('0626141c-27a6-4d8c-aff8-7c8020a2c656'):|# Jiminny Tech Day - 6h 1m lef100% 2• Fri 15 May 11:59:43U AskJiminnyReportActivityServiceTest vCascadeReview PR tor ActivityDebug Text Relay Faily+0 ..Hete is ted, email5t 2026at10:20 FMom: The Jiminny Team <[EMAIL]>Subiect: Your text message failed to sendr text message.Please contact support for more information, quoting reference 0626141c-27a6-4d8c-aff8-/c8020a2c656 and code 2200.Perrect. The email shows•Reference: 0626141c-27a6-4d8c-aff8-7c8020a2c656Code: 2200Code 2200 is REASON CODE SENDER MISMATCH (line 35 in EmailTextRelay.php), which meansThis is a different text relay record than the one we've been looking at (32416 has UUID 0x4CD18652A407AA2DA526870553821366 ). Let me find the record with UUID 9626141c-27a6-4d8c-aff8-7c89 |i salSELECT id, uuid, status, code, sender, recipient, created_at, updated_atFROM text_relaysWHEREuuld = uuld to b1n 0626141c-27a6-408c-atf8-/c8626azc656':This will show the actual failed text relay record that triggered the failure email Stovan received.A Your included weekly usage quota is exhausted. Using your extra usage. Quota resets May 17, 11:00 AMAsk anvthina (84L)SWE.1.6W Windsurf Toams 7-84/10 charchUTE.8Po 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
47936
|
1700
|
25
|
2026-05-15T08:59:44.488643+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-15/1778 /Users/lukas/.screenpipe/data/data/2026-05-15/1778835584488_m1.jpg...
|
PhpStorm
|
faVsco.js – SmsRelayFailed.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴ SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴1DEV (-zsh)APP (-zsh)83-zsh₴4root@docker_lamp_1:/home/jiminny# phpartisanactivity:update:es 422003Foundactivity ID: 422003,UUID: f43cf158-e60d-46e5-92f8-c4e0594a3219Sending activity for ES update...Done.root@docker_lamp_1:/home/jiminny#What's next:Try Docker Debug forseamless, persistent debugging tools in any container or image →Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-failed to connect to the docker API at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-HomeDMsActivityFilesLater..•More> 0.Jiminny Tech Day - 6h 1 m left100% С8• Fri 15 May 11:59:44-Describe what you are looking forJiminny ...#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...^ Direct messages. Stoyan TomovGalya DimitrovaR. Aneliya Angelova€. Vasil Vasileva. Stefka Stoyanova* Todor StamatovMario Georgiev. Nikolay Ivanovdo James Graham ". Stoyan TanevR. Steliyan Georgiev& Petko Kashinski. Lukas Kovalik y...::: AppsToastJira CloudGoogle Cale...# releases8 22• MessagesC FilesBookmarks+20904-fix-updat^ ~~ an-activity-command59ea0d31 - Mt._Today~-quest #12078 fromjiminny/JY-20904-fix-update-es-on-activity-commandjiminny/app| Added by GitHubCircleCI APP 11:09 AMDeployment Successful!Project: appWhen:05/15/202608:09:35Tag:View JobNewGitHub APP 11:36 AM4 new commits pushed tomaster by LakyLak8dac0dfa - JY-20903 Update activity stagewhen opportunity is changede883ed5b - JY-20903 revert changes incommand0d351159 - Merge branch 'master' into JY-20903-update_activity-stage-on-opportunity-change0e331f23 - Merge pull request #12077 fromjiminny/JY-20903-update_activity-stage-on-opportunity-changejiminny/app| Added by GitHubMessage #releases+...
|
NULL
|
-5338504017839690247
|
NULL
|
click
|
ocr
|
NULL
|
SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴ SlackFileEditViewGoHistoryWindowHelp••DEVDOCKERO ₴1DEV (-zsh)APP (-zsh)83-zsh₴4root@docker_lamp_1:/home/jiminny# phpartisanactivity:update:es 422003Foundactivity ID: 422003,UUID: f43cf158-e60d-46e5-92f8-c4e0594a3219Sending activity for ES update...Done.root@docker_lamp_1:/home/jiminny#What's next:Try Docker Debug forseamless, persistent debugging tools in any container or image →Learn more at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-failed to connect to the docker API at [URL_WITH_CREDENTIALS] ~/jiminny/app (JY-20903-update_activity-stage-on-HomeDMsActivityFilesLater..•More> 0.Jiminny Tech Day - 6h 1 m left100% С8• Fri 15 May 11:59:44-Describe what you are looking forJiminny ...#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...^ Direct messages. Stoyan TomovGalya DimitrovaR. Aneliya Angelova€. Vasil Vasileva. Stefka Stoyanova* Todor StamatovMario Georgiev. Nikolay Ivanovdo James Graham ". Stoyan TanevR. Steliyan Georgiev& Petko Kashinski. Lukas Kovalik y...::: AppsToastJira CloudGoogle Cale...# releases8 22• MessagesC FilesBookmarks+20904-fix-updat^ ~~ an-activity-command59ea0d31 - Mt._Today~-quest #12078 fromjiminny/JY-20904-fix-update-es-on-activity-commandjiminny/app| Added by GitHubCircleCI APP 11:09 AMDeployment Successful!Project: appWhen:05/15/202608:09:35Tag:View JobNewGitHub APP 11:36 AM4 new commits pushed tomaster by LakyLak8dac0dfa - JY-20903 Update activity stagewhen opportunity is changede883ed5b - JY-20903 revert changes incommand0d351159 - Merge branch 'master' into JY-20903-update_activity-stage-on-opportunity-change0e331f23 - Merge pull request #12077 fromjiminny/JY-20903-update_activity-stage-on-opportunity-changejiminny/app| Added by GitHubMessage #releases+...
|
47934
|
NULL
|
NULL
|
NULL
|
|
34480
|
1294
|
6
|
2026-05-13T11:18:58.429519+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778671138429_m2.jpg...
|
PhpStorm
|
faVsco.js – SocialAccountService.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhostormINavicareCodeLaravelKeractorFV faVsco.js?9 PhostormINavicareCodeLaravelKeractorFV faVsco.js?9 master kroledey(C) ReindexForGrounListeTextkelayservice.pnpReindexForLeadListenLo kelndexroropportunit© ReindexForUserListenOkesolverrovider.onpo senecxooncmall.ong© SetupintegrationActiorC UserPilotActivityListenAuthenticationAutomatedReports_CalendarsaermDealKisKSu lasucsearchL Groupsu ImooriM MailboxNudaesUserPilot(C) CreateNuddecreated:> Opportunitiesv MPlavbooks© AttachLayout.php(C) ChandeSidekickSettind(C) CreatePlavbookCreatev M Dlavlicte>• Activitiesv M PlanhatC) Create ActivitvAddeMuicerDilot0) ImnortGrounDlavlistShD TeamsD Transcriptionwusers4) AntivityDrovidorDicoon(C) ActivityProviderinteareCreateDefaultPlaylist.r© CreateDefaultSavedSe© CreateGroupCreatedE© DeleteScheduledUser8 NotifvCrmOwnerDiscoP NotifvCrmUserDisconr(C) SetDefaultAvatarListeruse rulobox UAuchz Lllent rrovlder hubspockesourceuwneruse GuzzleHttp\Exception\ConnectException:use buzzlehtto Exception RequestExceptionuse Illuminate Auth Authenticat1onexception:use Illuminate Contracts Events Dispatcher:use IlLuminate Support Facades Cache:use Jiminny \Component\Encryption\EncryptedTokenManager;use Jaminny zvents Users CrmAccountReconnectediuse Jiminny Events\Users\SocialAccountConnected;use Jiminny Events Users SocialAccountDisconnected:use Jiminny Exceptions \ActivityProviderException;use Jiminny Excentions InvalidEnumExcention:use Jiminny \Exceptions\SocialAccountTokenInvalidException;luse himinnv Model s Crm Profile:use Jiminny Repositories \UserRepository:luse liminnv Models SocialAccount •use Jiminny Models\Team;use liminnv Models Ilsen•use Jlninny noutticaclons slackbotAddeoluco liminnv NAutho Cion+ Providon Aincall.use Jiminny uAuchz cLlent rrovlder AlrcaLLresourceuwneruse Jininny UAuchz Cllent rrovlder buctnorh.use Jininny UAuEnz Cllent rrovlder Ulatoaduse Jiminny UAuthz Cllent Provider D1aLpadResourceuwneruse Jiminny UAuthz Cllent Provider Salesloftuse Jiminny UAuthz Cllent Provider Salesloftresourceuwneruse Jiminny Services Activity lalkdesk Provider Talkdeskuse Jiminny Services Activity lalkdesk Provider Talkdeskresourceuwner:use Jaminny Services Activity Zoom Provider Zoom:use Jiminny Services Activitv Zoom Provider ZoomResource0wner:use Jiminny Services 0Auth2 Provider BasicAuthiuse Jiminny Services 0Auth2 Provider Outreach:use JsonExcentioniuse League\0Auth2\Client\0ptionProvider\HttpBasicAuth0ptionProvider;use Leaque DAuth2 Mient Providen AhstractProviden:use League\0Auth2\Client \Provider\Exception\IdentityProviderException;luse Leaque OAuth2 Client Providern Gooale.© SetupCalendarSvnc.oh54use League\0Auth2\Client \Provider\GoogleUser;C) SetuoMailSvnc.ohvluse Leaque OAuth2 Client Provider Iinkedtn.C) Svncintercom.ohouse League\0Auth2\Client \Provider\LinkedInResource0wner;(C) SvncPlanhat. ohouse leaque NAuth2 Client Providen RecouncelwnerIntenfaco.(c) SunceliserDilot nhnuse League\0Auth2\Client\Token \AccessToken;(c) ValidateSendinaMecseluco Losaue NAutha Cion+ Token AccoccTokonIntonfacoMWehhookuse Libphonenumber \NumberParseExceptiionAcceot File ga X Reiect File o s8cneo libnhanonunhon| DhTnoNiledihsonke+ v< 5 of 5 files →© MailboxController.phpsms-relay-failed.blade.phpC SmsMessage.pngAccept Reject= custom.log= laravel.logA SF (jiminny@localhost]4 HS_local [jiminny@localhost]& console (PROD] X A console [EU]A console [STAGING]D69.Tx: Auto v— 629632633- €661662663669_666 VSo jiminnyAND to.domain = LOWERSUBSTRING INDEXc.calendar provider id. '0'. -1)040 A1 A40 V 65 ^GROUP BY t.id, t.name, calendar_domairORDER BY t.name. calendar domain:select * from users u join calendars c 1<->l.n: on c.user_id = u.idwhere u.tean id = 880select * from activities where id = 74049485• # team 563 crm 537select * from activities where id = 73272382; # team 563 crm 537select * from activities where id = 64400389; # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297; # team 563 crm 537select * from participants where activity id = 58081273:select * from activities where crm confiquration id = 537 and provider = 'aircalland account id = 19003658 order by updated at desc:select * from contacts where crm confiquration id = 537 and id = 35957759:select * from accounts where crm confiquration 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 10 = 87714:select * from activity search filters where activity search_id = 87714:SELECT * FROM activities WHERE uuid to bin('88274672-202d-4162-9d04-73f£5f0566a9') = uuidlon uuid to bin(:47842446-af51-4bch-854f-cc6560290101') = uuid:SELECT * FROM crm_configurations WHERE provider = 'hubspot' ;select * from nate Zimitsiselect * from automated_report_results where media type = 'pdf' and status = 2and id IN (18, 1872);select * from automated_reports where id = 54;SELECT * SP0M ucenc WHERE id TN (24427 20443 20413)4SELECT * 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 ¿d - 20119.select * from users where team_id = 2 and email like '%scott%' and id = 29510:suppont Dally • In 42m100% S2• Wed 13 May 14:18:58U AskJiminnyReportActivityServiceTest vcascadeTrial Owner Role SeleSMS Fallure Emall.•EmailTextRelay.phpEmailTextRelay.phpThought for 1skead sso.onpno OlnieDSso.php• Sso.phpRead SsoController.ohrSsoController.ohoThouahts|•SsoController.phpThoucht for 1c >SsoController.phpThoughtsRead ValidateSendinaMessaae.ohnlThought for 1sValidateSendinaMessage.onoValidateSendinaMessade.oho• ValidateSendingMessage.phpRead SocialAccountService.oho #|350-369Soarched IcerRenocitorv in ann/ServiceeOSocialAccountService.phpAsk anvthina (84L)« Code SWF-1.6+0 ..+1-1+1-1+7 -2+2-1+1-1+4-2+1-1J 116 tokens•Reiect alllAccent alliO IDE error occurredSee details and submit reportW Windsurf Teams21-1UTE.8Iio 4 spacesw...
|
NULL
|
2988305319921383350
|
NULL
|
visual_change
|
ocr
|
NULL
|
PhostormINavicareCodeLaravelKeractorFV faVsco.js?9 PhostormINavicareCodeLaravelKeractorFV faVsco.js?9 master kroledey(C) ReindexForGrounListeTextkelayservice.pnpReindexForLeadListenLo kelndexroropportunit© ReindexForUserListenOkesolverrovider.onpo senecxooncmall.ong© SetupintegrationActiorC UserPilotActivityListenAuthenticationAutomatedReports_CalendarsaermDealKisKSu lasucsearchL Groupsu ImooriM MailboxNudaesUserPilot(C) CreateNuddecreated:> Opportunitiesv MPlavbooks© AttachLayout.php(C) ChandeSidekickSettind(C) CreatePlavbookCreatev M Dlavlicte>• Activitiesv M PlanhatC) Create ActivitvAddeMuicerDilot0) ImnortGrounDlavlistShD TeamsD Transcriptionwusers4) AntivityDrovidorDicoon(C) ActivityProviderinteareCreateDefaultPlaylist.r© CreateDefaultSavedSe© CreateGroupCreatedE© DeleteScheduledUser8 NotifvCrmOwnerDiscoP NotifvCrmUserDisconr(C) SetDefaultAvatarListeruse rulobox UAuchz Lllent rrovlder hubspockesourceuwneruse GuzzleHttp\Exception\ConnectException:use buzzlehtto Exception RequestExceptionuse Illuminate Auth Authenticat1onexception:use Illuminate Contracts Events Dispatcher:use IlLuminate Support Facades Cache:use Jiminny \Component\Encryption\EncryptedTokenManager;use Jaminny zvents Users CrmAccountReconnectediuse Jiminny Events\Users\SocialAccountConnected;use Jiminny Events Users SocialAccountDisconnected:use Jiminny Exceptions \ActivityProviderException;use Jiminny Excentions InvalidEnumExcention:use Jiminny \Exceptions\SocialAccountTokenInvalidException;luse himinnv Model s Crm Profile:use Jiminny Repositories \UserRepository:luse liminnv Models SocialAccount •use Jiminny Models\Team;use liminnv Models Ilsen•use Jlninny noutticaclons slackbotAddeoluco liminnv NAutho Cion+ Providon Aincall.use Jiminny uAuchz cLlent rrovlder AlrcaLLresourceuwneruse Jininny UAuchz Cllent rrovlder buctnorh.use Jininny UAuEnz Cllent rrovlder Ulatoaduse Jiminny UAuthz Cllent Provider D1aLpadResourceuwneruse Jiminny UAuthz Cllent Provider Salesloftuse Jiminny UAuthz Cllent Provider Salesloftresourceuwneruse Jiminny Services Activity lalkdesk Provider Talkdeskuse Jiminny Services Activity lalkdesk Provider Talkdeskresourceuwner:use Jaminny Services Activity Zoom Provider Zoom:use Jiminny Services Activitv Zoom Provider ZoomResource0wner:use Jiminny Services 0Auth2 Provider BasicAuthiuse Jiminny Services 0Auth2 Provider Outreach:use JsonExcentioniuse League\0Auth2\Client\0ptionProvider\HttpBasicAuth0ptionProvider;use Leaque DAuth2 Mient Providen AhstractProviden:use League\0Auth2\Client \Provider\Exception\IdentityProviderException;luse Leaque OAuth2 Client Providern Gooale.© SetupCalendarSvnc.oh54use League\0Auth2\Client \Provider\GoogleUser;C) SetuoMailSvnc.ohvluse Leaque OAuth2 Client Provider Iinkedtn.C) Svncintercom.ohouse League\0Auth2\Client \Provider\LinkedInResource0wner;(C) SvncPlanhat. ohouse leaque NAuth2 Client Providen RecouncelwnerIntenfaco.(c) SunceliserDilot nhnuse League\0Auth2\Client\Token \AccessToken;(c) ValidateSendinaMecseluco Losaue NAutha Cion+ Token AccoccTokonIntonfacoMWehhookuse Libphonenumber \NumberParseExceptiionAcceot File ga X Reiect File o s8cneo libnhanonunhon| DhTnoNiledihsonke+ v< 5 of 5 files →© MailboxController.phpsms-relay-failed.blade.phpC SmsMessage.pngAccept Reject= custom.log= laravel.logA SF (jiminny@localhost]4 HS_local [jiminny@localhost]& console (PROD] X A console [EU]A console [STAGING]D69.Tx: Auto v— 629632633- €661662663669_666 VSo jiminnyAND to.domain = LOWERSUBSTRING INDEXc.calendar provider id. '0'. -1)040 A1 A40 V 65 ^GROUP BY t.id, t.name, calendar_domairORDER BY t.name. calendar domain:select * from users u join calendars c 1<->l.n: on c.user_id = u.idwhere u.tean id = 880select * from activities where id = 74049485• # team 563 crm 537select * from activities where id = 73272382; # team 563 crm 537select * from activities where id = 64400389; # team 563 crm 537select * from activities where id = 58081273; # team 563 crm 537select * from activities where id = 54520297; # team 563 crm 537select * from participants where activity id = 58081273:select * from activities where crm confiquration id = 537 and provider = 'aircalland account id = 19003658 order by updated at desc:select * from contacts where crm confiquration id = 537 and id = 35957759:select * from accounts where crm confiquration 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 10 = 87714:select * from activity search filters where activity search_id = 87714:SELECT * FROM activities WHERE uuid to bin('88274672-202d-4162-9d04-73f£5f0566a9') = uuidlon uuid to bin(:47842446-af51-4bch-854f-cc6560290101') = uuid:SELECT * FROM crm_configurations WHERE provider = 'hubspot' ;select * from nate Zimitsiselect * from automated_report_results where media type = 'pdf' and status = 2and id IN (18, 1872);select * from automated_reports where id = 54;SELECT * SP0M ucenc WHERE id TN (24427 20443 20413)4SELECT * 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 ¿d - 20119.select * from users where team_id = 2 and email like '%scott%' and id = 29510:suppont Dally • In 42m100% S2• Wed 13 May 14:18:58U AskJiminnyReportActivityServiceTest vcascadeTrial Owner Role SeleSMS Fallure Emall.•EmailTextRelay.phpEmailTextRelay.phpThought for 1skead sso.onpno OlnieDSso.php• Sso.phpRead SsoController.ohrSsoController.ohoThouahts|•SsoController.phpThoucht for 1c >SsoController.phpThoughtsRead ValidateSendinaMessaae.ohnlThought for 1sValidateSendinaMessage.onoValidateSendinaMessade.oho• ValidateSendingMessage.phpRead SocialAccountService.oho #|350-369Soarched IcerRenocitorv in ann/ServiceeOSocialAccountService.phpAsk anvthina (84L)« Code SWF-1.6+0 ..+1-1+1-1+7 -2+2-1+1-1+4-2+1-1J 116 tokens•Reiect alllAccent alliO IDE error occurredSee details and submit reportW Windsurf Teams21-1UTE.8Iio 4 spacesw...
|
34479
|
NULL
|
NULL
|
NULL
|
|
34481
|
1293
|
4
|
2026-05-13T11:19:02.371032+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778671142371_m1.jpg...
|
PhpStorm
|
faVsco.js – SocialAccountService.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
SlackFileEditViewGoHistoryWindowHelpPRODIDOCKER$81 SlackFileEditViewGoHistoryWindowHelpPRODIDOCKER$81DEV (docker)₴82APP (-zshDOCKER (docker-compose)docker_lamp_1/proc/1/fd/1'1 '/usr/local/bin/php' 'artisan' jiminny:playlists:normalize-sort › '2>&1docker_1amp_1docker_lamp_1docker_lamp_1docker_1amp_1run_artisan_schedule: Done waiting for schedule:run2026-05-13 11:17:08 Running ['artisan'Paceing bot scoredat e soe19sDONEdocker_1amp_11'/usr/local/bin/php' 'artisan'meeting-bot: schedule-bot > */proc/1/fd/1'2>&1elasticsearch1 {"type": "server""timestamp": "2026-05-13T11:17:26, 690Z","Level": "1NFO","component":"o.e.m. j.JvmGcMonitorService"e.name":"e802ad473a4f", "cluster .name":"docker-cluster""nod"message": "[gc] [6214] overhead,spent [497ms] collecting in the last [1.4s]", "cluster.uuid": "8uhZw1CUSGyWYR_OvaKx6g" ,"node.id" : "e2ZKzgw4Q4aCf2w51jWr1A"}docker_lamp_12026-05-13 11:17:19 Running ['artisan' dialers:monitor-activities] 1OS DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' dialers:monitor-activities › */proc/1/fd/1' 2>&12026-05-13 11:17:29 Running ['artisan' jiminny:monitor-social-accountdocker_lamp_1proc/1/fd/1' 2>&1docker_1amp_19s DONEdocker_lamp_11/fd/1' 2>&1docker_lamp_1tches=15]85DONEdocker_lamp_115 >*/proc/1/fd/1' 2>&1docker_lamp_1 |9s DONEdocker_1amp_12>&1docker_lamp_1docker_lamp_11RUNNINGdocker_1amp_1docker_lamp_1msDONE1 '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > '/2026-05-13 11:17:39 Running ['artisan' mailbox:skip-lists:refresh].1 '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh › '/proc/2026-05-13 11:17:48 Running ['artisan' mailbox:batch:process --max-ba1 '/usr/local/bin/php' 'artisan'mailbox:batch:process --max-batches=2026-05-13 11:17:56 Running ['artisan' mailbox:batch:create]1 • '/usr/local/bin/php' 'artisan'mailbox:batch: create › '/proc/1/fd/12026-05-13 11:18:06 Jiminny\Jobs\Mailbox\CreateBatches1 run_artisan_schedule: Done waiting forschedule: run2026-05-13 11:18:06 Jiminny\Jobs\Mailbox\CreateBatches426.72View in Docker Desktopo View Configw Enable WatchHomeDMsActivityFilesLaterMore>0.(aolED→Jiminny ...ab External connections* Starred& jiminny-x-integrati...8platform-inner-teamChannels# ai-chapter# alerts# backend# bugs# confusion-clinic# curiosity_lab# engineering# general#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...° Direct messages. Nikolay Ivanovd. James Graham. Stoyan TanevP. Galya DimitrovaSupport Daily - in 41 m100% <2Wed 13 May 14:19:01Describe what you are looking for# platform-tickets8146 0• Messagest Add canvasO Filesmhe PrioritThursday, April 16th~+Tuesday, May 5th ~Automation for Jira APP2:12 PMSRD-6835 Salesforce app issues has been raisedwith Platform team and assigned to **. The Priorityis P2 MediumAutomation for Jira APP5:01 PMSRD-6815 [Playback] Ask Jiminny odd behaviourhas been raised with Platform team and assigned toSteliyan Georgiev. The Priority is P2 MediumMonday, May 11th ~Automation for Jira APP 4:38 PMSRD-6845 CRM filling is not being applied has beenraised with Platform team and assigned to **. ThePriority is **Today ~Automation for Jira APP10:42 AMSRD-6848 Sidekick SMS issue has been raised withPlatform team and assigned to **. The Priority is **NewAutomation for Jira APP 1:33 PMSRD-6849 Recorded call does not appear on thedashboard has been raised with Platform team andassigned to **. The Priority is **Message #platform-tickets...
|
NULL
|
-5902067691265007472
|
NULL
|
idle
|
ocr
|
NULL
|
SlackFileEditViewGoHistoryWindowHelpPRODIDOCKER$81 SlackFileEditViewGoHistoryWindowHelpPRODIDOCKER$81DEV (docker)₴82APP (-zshDOCKER (docker-compose)docker_lamp_1/proc/1/fd/1'1 '/usr/local/bin/php' 'artisan' jiminny:playlists:normalize-sort › '2>&1docker_1amp_1docker_lamp_1docker_lamp_1docker_1amp_1run_artisan_schedule: Done waiting for schedule:run2026-05-13 11:17:08 Running ['artisan'Paceing bot scoredat e soe19sDONEdocker_1amp_11'/usr/local/bin/php' 'artisan'meeting-bot: schedule-bot > */proc/1/fd/1'2>&1elasticsearch1 {"type": "server""timestamp": "2026-05-13T11:17:26, 690Z","Level": "1NFO","component":"o.e.m. j.JvmGcMonitorService"e.name":"e802ad473a4f", "cluster .name":"docker-cluster""nod"message": "[gc] [6214] overhead,spent [497ms] collecting in the last [1.4s]", "cluster.uuid": "8uhZw1CUSGyWYR_OvaKx6g" ,"node.id" : "e2ZKzgw4Q4aCf2w51jWr1A"}docker_lamp_12026-05-13 11:17:19 Running ['artisan' dialers:monitor-activities] 1OS DONEdocker_lamp_11 '/usr/local/bin/php' 'artisan' dialers:monitor-activities › */proc/1/fd/1' 2>&12026-05-13 11:17:29 Running ['artisan' jiminny:monitor-social-accountdocker_lamp_1proc/1/fd/1' 2>&1docker_1amp_19s DONEdocker_lamp_11/fd/1' 2>&1docker_lamp_1tches=15]85DONEdocker_lamp_115 >*/proc/1/fd/1' 2>&1docker_lamp_1 |9s DONEdocker_1amp_12>&1docker_lamp_1docker_lamp_11RUNNINGdocker_1amp_1docker_lamp_1msDONE1 '/usr/local/bin/php' 'artisan' jiminny:monitor-social-accounts > '/2026-05-13 11:17:39 Running ['artisan' mailbox:skip-lists:refresh].1 '/usr/local/bin/php' 'artisan' mailbox:skip-lists:refresh › '/proc/2026-05-13 11:17:48 Running ['artisan' mailbox:batch:process --max-ba1 '/usr/local/bin/php' 'artisan'mailbox:batch:process --max-batches=2026-05-13 11:17:56 Running ['artisan' mailbox:batch:create]1 • '/usr/local/bin/php' 'artisan'mailbox:batch: create › '/proc/1/fd/12026-05-13 11:18:06 Jiminny\Jobs\Mailbox\CreateBatches1 run_artisan_schedule: Done waiting forschedule: run2026-05-13 11:18:06 Jiminny\Jobs\Mailbox\CreateBatches426.72View in Docker Desktopo View Configw Enable WatchHomeDMsActivityFilesLaterMore>0.(aolED→Jiminny ...ab External connections* Starred& jiminny-x-integrati...8platform-inner-teamChannels# ai-chapter# alerts# backend# bugs# confusion-clinic# curiosity_lab# engineering# general#jiminny-bg# platform-tickets# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of jimi...° Direct messages. Nikolay Ivanovd. James Graham. Stoyan TanevP. Galya DimitrovaSupport Daily - in 41 m100% <2Wed 13 May 14:19:01Describe what you are looking for# platform-tickets8146 0• Messagest Add canvasO Filesmhe PrioritThursday, April 16th~+Tuesday, May 5th ~Automation for Jira APP2:12 PMSRD-6835 Salesforce app issues has been raisedwith Platform team and assigned to **. The Priorityis P2 MediumAutomation for Jira APP5:01 PMSRD-6815 [Playback] Ask Jiminny odd behaviourhas been raised with Platform team and assigned toSteliyan Georgiev. The Priority is P2 MediumMonday, May 11th ~Automation for Jira APP 4:38 PMSRD-6845 CRM filling is not being applied has beenraised with Platform team and assigned to **. ThePriority is **Today ~Automation for Jira APP10:42 AMSRD-6848 Sidekick SMS issue has been raised withPlatform team and assigned to **. The Priority is **NewAutomation for Jira APP 1:33 PMSRD-6849 Recorded call does not appear on thedashboard has been raised with Platform team andassigned to **. The Priority is **Message #platform-tickets...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
34482
|
1294
|
7
|
2026-05-13T11:19:31.835228+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778671171835_m2.jpg...
|
PhpStorm
|
faVsco.js – SocialAccountService.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
IDE error occurred
text/html
text/html
text/html
S IDE error occurred
text/html
text/html
text/html
See details and submit report
Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"IDE error occurred","depth":3,"bounds":{"left":0.8753325,"top":0.92577815,"width":0.11037234,"height":0.013567438},"on_screen":true,"value":"IDE error occurred","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"on_screen":false,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"bounds":{"left":0.8753325,"top":0.92577815,"width":0.03756649,"height":0.013567438},"on_screen":true,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"on_screen":false,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"See details and submit report","depth":2,"bounds":{"left":0.8753325,"top":0.943336,"width":0.06017287,"height":0.013567438},"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"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":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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}]...
|
-3683899965916341431
|
-7194358248974582331
|
idle
|
accessibility
|
NULL
|
IDE error occurred
text/html
text/html
text/html
S IDE error occurred
text/html
text/html
text/html
See details and submit report
Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
34483
|
1293
|
5
|
2026-05-13T11:19:34.187184+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778671174187_m1.jpg...
|
PhpStorm
|
faVsco.js – SocialAccountService.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
IDE error occurred
text/html
text/html
text/html
S IDE error occurred
text/html
text/html
text/html
See details and submit report
Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
namespace Jiminny\Services;
/**
* @todo cleanup after #slack-oauth-v2
*/
use AdamPaterson\OAuth2\Client\Provider\SlackResourceOwner;
use Chadhutchins\OAuth2\Client\Provider\Slack;
use ChaseConey\LaravelDatadogHelper\Datadog;
use Daniti\OAuth2\Client\Provider\Pipedrive;
use Daniti\OAuth2\Client\Provider\PipedriveResourceOwner;
use Exception;
use Flipbox\OAuth2\Client\Provider\HubSpot;
use Flipbox\OAuth2\Client\Provider\HubSpotResourceOwner;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Response;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Support\Facades\Cache;
use Jiminny\Component\Encryption\EncryptedTokenManager;
use Jiminny\Events\Users\CrmAccountReconnected;
use Jiminny\Events\Users\SocialAccountConnected;
use Jiminny\Events\Users\SocialAccountDisconnected;
use Jiminny\Exceptions\ActivityProviderException;
use Jiminny\Exceptions\InvalidEnumException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Models\Crm\Profile;
use Jiminny\Repositories\UserRepository;
use Jiminny\Models\SocialAccount;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Notifications\SlackBotAdded;
use Jiminny\OAuth2\Client\Provider\Aircall;
use Jiminny\OAuth2\Client\Provider\AircallResourceOwner;
use Jiminny\OAuth2\Client\Provider\Bullhorn;
use Jiminny\OAuth2\Client\Provider\Dialpad;
use Jiminny\OAuth2\Client\Provider\DialpadResourceOwner;
use Jiminny\OAuth2\Client\Provider\Salesloft;
use Jiminny\OAuth2\Client\Provider\SalesloftResourceOwner;
use Jiminny\Services\Activity\Talkdesk\Provider\Talkdesk;
use Jiminny\Services\Activity\Talkdesk\Provider\TalkdeskResourceOwner;
use Jiminny\Services\Activity\Zoom\Provider\Zoom;
use Jiminny\Services\Activity\Zoom\Provider\ZoomResourceOwner;
use Jiminny\Services\OAuth2\Provider\BasicAuth;
use Jiminny\Services\OAuth2\Provider\Outreach;
use JsonException;
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\Google;
use League\OAuth2\Client\Provider\GoogleUser;
use League\OAuth2\Client\Provider\LinkedIn;
use League\OAuth2\Client\Provider\LinkedInResourceOwner;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Token\AccessTokenInterface;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberUtil;
use LogicException;
use Psr\Log\LoggerInterface;
use Random\RandomException;
use Stevenmaguire\OAuth2\Client\Provider\Salesforce;
use Stevenmaguire\OAuth2\Client\Provider\SalesforceResourceOwner;
use TheNetworg\OAuth2\Client\Provider\Azure;
use TheNetworg\OAuth2\Client\Provider\AzureResourceOwner;
use Throwable;
use TMannherz\OAuth2\Client\Provider\RingCentral;
use TMannherz\OAuth2\Client\Provider\RingcentralResourceOwner;
class SocialAccountService
{
/**
* Get a fresh tokens 5 minutes before it expires
* That should minimise the number of failed requests due to expired token
* for long-running jobs that reuse the same token for pulling lots of data.
*/
private const int REFRESH_OFFSET_MIN = 5;
private const string TOKEN_STATE_FETCH = 'fetch';
private const string TOKEN_STATE_REFRESH = 'refresh';
private const string TOKEN_RESULT_ATTEMPT = 'attempt';
private const string TOKEN_RESULT_SUCCESS = 'success';
private const string TOKEN_RESULT_FAILURE = 'failure';
private ?AccessTokenInterface $accessToken = null;
private ?string $token = null;
private ?string $refreshToken = null;
private ?int $expires = null;
private ?string $countryCode = null;
private ?string $timezone = null;
private ?array $vendorValues = null;
private ?int $refreshTokenExpires = null;
public function __construct(
private readonly EncryptedTokenManager $encryptedTokenManager,
private readonly LoggerInterface $logger,
private readonly PhoneNumberUtil $phoneNumberUtil,
private readonly Dispatcher $eventDispatcher,
private readonly UserRepository $userRepository,
) {
}
public function setVendorValues(array $values): void
{
$this->vendorValues = $values;
}
public function setAccessToken(AccessTokenInterface $accessToken): void
{
$this->accessToken = $accessToken;
// Todo: Also set these other params from this token e.g. refreshToken
}
public function setToken(?string $token): void
{
$this->token = $token;
}
public function setRefreshToken(?string $refreshToken): void
{
$this->refreshToken = $refreshToken;
}
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
public function setTimezone(string $timezone): void
{
$this->timezone = $timezone;
}
public function setExpires(?int $expiry): void
{
$this->expires = $expiry;
}
public function setRefreshTokenExpires(array $values): void
{
$this->refreshTokenExpires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
/**
* @throws InvalidEnumException
*/
public function getProvider(string $provider): AbstractProvider
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
return new LinkedIn(config('services.linkedin'));
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
$socialProvider = new LinkedIn(config('services.linkedin-conference'));
$socialProvider->withFields([
'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',
]);
return $socialProvider;
case SocialAccount::PROVIDER_SALESFORCE:
return new Salesforce(config('services.salesforce'));
case SocialAccount::PROVIDER_GOOGLE:
return new Google(config('services.google'));
case SocialAccount::PROVIDER_SLACK:
return new Slack(config('services.slack'));
case SocialAccount::PROVIDER_OFFICE:
$config = config('services.office');
// Convert string scope to array format expected by Azure provider
if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {
$config['scopes'] = array_filter(preg_split('/\s+/', trim($config['scope'])));
unset($config['scope']);
}
$socialProvider = new Azure($config);
$socialProvider->urlAPI = '[URL_WITH_CREDENTIALS] Exception
*/
public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
/** @var LinkedInResourceOwner $providerUser */
return $this->mapLinkedInUserData($providerUser);
case SocialAccount::PROVIDER_SALESFORCE:
/** @var SalesforceResourceOwner $providerUser */
return $this->mapSalesforceUserData($providerUser);
case SocialAccount::PROVIDER_HUBSPOT:
/** @var HubSpotResourceOwner $providerUser */
return $this->mapHubSpotUserData($providerUser);
case SocialAccount::PROVIDER_PIPEDRIVE:
/** @var PipedriveResourceOwner $providerUser */
return $this->mapPipedriveUserData($providerUser);
case SocialAccount::PROVIDER_GOOGLE:
/** @var GoogleUser $providerUser */
return $this->mapGoogleUserData($providerUser);
case SocialAccount::PROVIDER_SLACK:
/** @var SlackResourceOwner $providerUser */
return $this->mapSlackUserData($providerUser);
case SocialAccount::PROVIDER_OFFICE:
/** @var AzureResourceOwner $providerUser */
return $this->mapOfficeUserData($providerUser);
case SocialAccount::PROVIDER_OUTREACH:
return $this->mapOutreachUserData($providerUser);
case SocialAccount::PROVIDER_DIALPAD:
/** @var DialpadResourceOwner $providerUser*/
return $this->mapDialpadUserData($providerUser);
case SocialAccount::PROVIDER_AIRCALL:
/** @var AircallResourceOwner $providerUser */
return $this->mapAircallUserData($providerUser);
case SocialAccount::PROVIDER_ZOOM_PHONE:
/** @var ZoomResourceOwner $providerUser */
return $this->mapZoomPhoneUserData($providerUser);
case SocialAccount::PROVIDER_SALESLOFT:
/** @var SalesloftResourceOwner $providerUser */
return $this->mapSalesloftUserData($providerUser);
case SocialAccount::PROVIDER_BULLHORN:
return $this->mapBullhornUserData();
case SocialAccount::PROVIDER_TALKDESK:
/** @var TalkdeskResourceOwner $providerUser */
return $this->mapTalkdeskUserData($providerUser);
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_TELUS:
/** @var RingcentralResourceOwner $providerUser */
return $this->mapRingCentralUserData($providerUser);
default:
throw new InvalidEnumException('Unknown provider.');
}
}
/**
* Returns a new random string to use as the state parameter in an
* authorization flow.
*
* @param int $length Length of the random string to be generated.
*
* @throws RandomException
*/
public function getRandomState(int $length = 32): string
{
// Converting bytes to hex will always double length. Hence, we can reduce
// the amount of bytes by half to produce the correct length.
return bin2hex(random_bytes($length / 2));
}
private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount
{
return SocialAccount::where([
'provider' => $provider,
'provider_user_id' => $providerUser->getId(),
])->first();
}
/**
* Based on the provider data, try to match to a sociable entity based on email.
* If a match is made, create the social account under that entity.
*
* @throws AuthenticationException
*/
public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User
{
$account = $this->getAssociation($provider, $providerUser);
if ($account !== null && $account->hasUser()) {
return $account->getUser();
}
$userData = $this->mapUserData($provider, $providerUser);
// Check if we have an actual user with this email.
/** @var User|null $user */
$user = $this->userRepository->findByEmail($userData['email']);
// If the user is trying to connect to LinkedIn, don't allow this.
// Todo: have an interstitial page to perform 2FA to connect.
if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {
throw new AuthenticationException(
'Sorry, you\'ll need to login through your Jiminny account to access the Conference.',
);
}
return $user;
}
/**
* @throws JsonException
*/
public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount
{
/** @var SocialAccount $account */
$account = $user->socialAccounts()->firstOrNew([
'provider' => $provider,
]);
$account->fill([
'provider_user_id' => $providerUser->getId(),
'provider_user_token' => $this->token,
'expires' => $this->expires,
'state' => SocialAccount::STATE_CONNECTED,
'retry_after' => null,
]);
// This is an optional parameter, don't overwrite the existing one with null if we don't get it.
if ($this->refreshToken) {
$account->fill([
'provider_refresh_token' => $this->refreshToken,
'refresh_token_expires' => $this->refreshTokenExpires,
]);
}
if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {
$account->fill([
'auth_scope' => is_scalar($this->vendorValues['scope'])
? $this->vendorValues['scope']
: json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),
]);
} else {
$account->fill([
'auth_scope' => null,
]);
$this->logger->warning(
'[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',
// pulling directly from the token, just to avoid potential masking of the issue
['token_values' => $this->accessToken->getValues()],
);
}
$account->save();
// Association can be from an updated token so don't re-announce this.
if (
$account->wasRecentlyCreated
&& in_array($provider, SocialAccount::CRM_PROVIDERS, true)
&& $provider !== SocialAccount::PROVIDER_HUBSPOT
&& $providerUser->getId() !== null
) {
$crm = $user->team->crm;
$data = [
'crm_configuration_id' => $crm->id,
'log_notes' => Profile::LOG_NOTE_ENHANCED,
];
$crmProfile = $user->crmProfile()->where([
'crm_provider_id' => $providerUser->getId(),
])->first();
$user->crmProfile()->updateOrCreate([
'crm_provider_id' => $providerUser->getId(),
], $data);
// If updated, fire reconnected
if ($crmProfile !== null) {
$this->eventDispatcher->dispatch(new CrmAccountReconnected($account));
}
}
$this->eventDispatcher->dispatch(new SocialAccountConnected($account));
return $account;
}
public function integrate(string $provider, User $user, Team $team): void
{
if ($provider === SocialAccount::PROVIDER_SLACK) {
if (! isset($this->vendorValues['ok'])
|| $this->vendorValues['ok'] !== true
|| ! isset($this->vendorValues['token_type'])
|| $this->vendorValues['token_type'] !== 'bot'
) {
// code expects V2 token, which differs slightly from V1
throw new LogicException('Invalid token received from Slack OAuth v2 API');
}
$webhook = $this->vendorValues['incoming_webhook'];
$slackTeamId = $this->vendorValues['team']['id'];
$botData = [
'channel' => $webhook['channel'],
'channel_id' => $webhook['channel_id'],
'config_url' => $webhook['configuration_url'],
'webhook_url' => $webhook['url'],
'bot_user_id' => $this->vendorValues['bot_user_id'],
'bot_access_token' => $this->accessToken->getToken(),
];
$slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);
if ($slackBot->wasRecentlyCreated) {
// Send Slack notification.
$user->notify(new SlackBotAdded());
}
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);
$this->logger->info('[SocialAccountService] Fetching token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$account->refresh();
if (
! $forceRefresh
&& ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))
) {
$this->logger->info('[SocialAccountService] Token retrieved', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);
return $this->encryptedTokenManager->getAccessToken($account);
}
try {
$this->logger->info('[SocialAccountService] Token needs refreshing', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
return $this->refreshToken($account, $forceRefresh);
} catch (IdentityProviderException $exception) {
$responseBody = $exception->getResponseBody();
if ($responseBody instanceof Response) {
$responseBody = $responseBody->getBody();
}
if (is_object($responseBody) && method_exists($responseBody, '__toString')) {
$responseBody = $responseBody->__toString();
}
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'responseBody' => $responseBody,
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logger->error('[SocialAccountService] Cannot obtain token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception::class,
'errorMessage' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {
$this->logger->error('[SocialAccountService] Full refresh required', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
// Something terrible happened their token, they need to reconnect.
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
$this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));
}
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
}
}
public function refreshSocialAccountToken(SocialAccount $socialAccount): void
{
try {
$this->getToken($socialAccount);
} catch (Throwable $e) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $socialAccount->getId(),
'provider' => $socialAccount->getProviderName(),
'reason' => $e->getMessage(),
]);
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);
$newToken = null;
Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)
->block(8, function () use ($account, $forceRefresh, &$newToken): void {
try {
$account->refresh();
$token = $this->encryptedTokenManager->getAccessToken($account);
if (! $forceRefresh && $this->hasValidToken($account)) {
$newToken = $token;
return;
}
if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {
$this->logger->error('[SocialAccountService] Refresh token not found', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog(
$account,
self::TOKEN_STATE_REFRESH,
self::TOKEN_RESULT_FAILURE,
);
throw new SocialAccountTokenInvalidException(
'Refresh token is not set, re-connection required.',
);
}
$this->logger->info('[SocialAccountService] Refreshing token from provider', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),
'state' => $account->getState(),
]);
$newToken = $this->getProvider($account->provider)
->getAccessToken('refresh_token', [
'refresh_token' => $token->getRefreshToken(),
])
;
if ($newToken->getToken() === $token->getToken()) {
$this->logger->info('[SocialAccountService] Refreshed with an identical token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
}
} catch (ConnectException | RequestException $exception) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
// This usually occurs due to SSL errors.
throw new SocialAccountTokenInvalidException(
'Token could not be refreshed.',
$exception->getCode(),
$exception,
);
}
$account->provider_user_token = $newToken->getToken();
$account->expires = $newToken->getExpires();
$account->state = SocialAccount::STATE_CONNECTED;
if ($newToken->getRefreshToken()) {
$account->provider_refresh_token = $newToken->getRefreshToken();
$values = $newToken->getValues();
$account->refresh_token_expires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
$account->save();
});
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);
$this->logger->info('[SocialAccountService] Token refreshed', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'state' => $account->getState(),
]);
return $newToken;
}
/**
* @return string[]
*/
private function getAccessScope(string $provider): array
{
$scopes = [];
$providerScopes = config('services.' . $provider . '.scope');
if ($providerScopes) {
$scopes = preg_split('/\s+/', $providerScopes);
}
return $scopes;
}
/**
* @throws InvalidEnumException
*/
public function getAuthorizationOptions(string $provider): array
{
$scopes = ['scope' => $this->getAccessScope($provider)];
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
case SocialAccount::PROVIDER_SALESFORCE:
case SocialAccount::PROVIDER_HUBSPOT:
case SocialAccount::PROVIDER_OUTREACH:
case SocialAccount::PROVIDER_SALESLOFT:
case SocialAccount::PROVIDER_ZOOM_PHONE:
case SocialAccount::PROVIDER_PIPEDRIVE:
case SocialAccount::PROVIDER_SLACK:
case SocialAccount::PROVIDER_AIRCALL:
case SocialAccount::PROVIDER_BULLHORN:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_TELUS:
case SocialAccount::PROVIDER_DIALPAD:
case SocialAccount::PROVIDER_TALKDESK:
return $scopes;
case SocialAccount::PROVIDER_OFFICE:
return $scopes + [
'access_type' => 'offline',
];
case SocialAccount::PROVIDER_GOOGLE:
return $scopes + [
'access_type' => 'offline',
'include_granted_scopes' => 'true',
'approval_prompt' => null,
];
default:
throw new InvalidEnumException();
}
}
private function tokenDoesNotExpire(SocialAccount $account): bool
{
return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);
}
private function hasValidToken(SocialAccount $account): bool
{
return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();
}
private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void
{
Datadog::increment('jiminny.access_token', 1, [
'provider' => $account->getProviderName(),
'state' => $state,
'result' => $result,
]);
}
private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),
];
}
private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
try {
$parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);
$number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);
} catch (NumberParseException) {
$number = null;
}
// Todo: this should check the `organization_id` matches the parent crm configuration.
return [
'country_code' => $this->countryCode,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),
'phone' => $number,
'crm_provider_id' => $rawUserData['organization_id'],
'crm_base_url' => $this->vendorValues['instance_url'],
];
}
/**
* Todo: this should check the `getHubId` matches the parent crm configuration.
*/
private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $providerUser->getHubId(),
'crm_base_url' => $providerUser->toArray()['hub_domain'],
];
}
/**
* Todo: this should check the `getCompanyId` matches the parent crm configuration.
*/
private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $rawUserData['data']['company_id'],
'crm_base_url' => '[URL_WITH_CREDENTIALS] ActivityProviderException
*/
private function mapDialpadUserData(DialpadResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
// They need to be Super Admin to access the Company APIs.
$this->logger->info('[Dialpad] User authenticated', $rawUserData);
if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Dialpad Super Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapAircallUserData(AircallResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
/**
* @throws ActivityProviderException
*/
private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array
{
if ($providerUser->toArray()['data']['team_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Team Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapBullhornUserData(): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
];
}
private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
}
Execute
Explain Plan...
|
[{"role":"AXTextField","text [{"role":"AXTextField","text":"IDE error occurred","depth":3,"on_screen":true,"value":"IDE error occurred","help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"on_screen":false,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"on_screen":true,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXTextField","text":"text/html","depth":4,"on_screen":false,"help_text":"text/html","role_description":"text field","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXLink","text":"See details and submit report","depth":2,"on_screen":true,"role_description":"link","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"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":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>Some incoming commits are not fetched<br/>","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":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","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":"AXTextArea","text":"<?php\n\nnamespace Jiminny\\Services;\n\n/**\n * @todo cleanup after #slack-oauth-v2\n */\n\nuse AdamPaterson\\OAuth2\\Client\\Provider\\SlackResourceOwner;\nuse Chadhutchins\\OAuth2\\Client\\Provider\\Slack;\nuse ChaseConey\\LaravelDatadogHelper\\Datadog;\nuse Daniti\\OAuth2\\Client\\Provider\\Pipedrive;\nuse Daniti\\OAuth2\\Client\\Provider\\PipedriveResourceOwner;\nuse Exception;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpot;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpotResourceOwner;\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Psr7\\Response;\nuse Illuminate\\Auth\\AuthenticationException;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Support\\Facades\\Cache;\nuse Jiminny\\Component\\Encryption\\EncryptedTokenManager;\nuse Jiminny\\Events\\Users\\CrmAccountReconnected;\nuse Jiminny\\Events\\Users\\SocialAccountConnected;\nuse Jiminny\\Events\\Users\\SocialAccountDisconnected;\nuse Jiminny\\Exceptions\\ActivityProviderException;\nuse Jiminny\\Exceptions\\InvalidEnumException;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Repositories\\UserRepository;\nuse Jiminny\\Models\\SocialAccount;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Notifications\\SlackBotAdded;\nuse Jiminny\\OAuth2\\Client\\Provider\\Aircall;\nuse Jiminny\\OAuth2\\Client\\Provider\\AircallResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Bullhorn;\nuse Jiminny\\OAuth2\\Client\\Provider\\Dialpad;\nuse Jiminny\\OAuth2\\Client\\Provider\\DialpadResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Salesloft;\nuse Jiminny\\OAuth2\\Client\\Provider\\SalesloftResourceOwner;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\Talkdesk;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\TalkdeskResourceOwner;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\Zoom;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\ZoomResourceOwner;\nuse Jiminny\\Services\\OAuth2\\Provider\\BasicAuth;\nuse Jiminny\\Services\\OAuth2\\Provider\\Outreach;\nuse JsonException;\nuse League\\OAuth2\\Client\\OptionProvider\\HttpBasicAuthOptionProvider;\nuse League\\OAuth2\\Client\\Provider\\AbstractProvider;\nuse League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException;\nuse League\\OAuth2\\Client\\Provider\\Google;\nuse League\\OAuth2\\Client\\Provider\\GoogleUser;\nuse League\\OAuth2\\Client\\Provider\\LinkedIn;\nuse League\\OAuth2\\Client\\Provider\\LinkedInResourceOwner;\nuse League\\OAuth2\\Client\\Provider\\ResourceOwnerInterface;\nuse League\\OAuth2\\Client\\Token\\AccessToken;\nuse League\\OAuth2\\Client\\Token\\AccessTokenInterface;\nuse libphonenumber\\NumberParseException;\nuse libphonenumber\\PhoneNumberFormat;\nuse libphonenumber\\PhoneNumberUtil;\nuse LogicException;\nuse Psr\\Log\\LoggerInterface;\nuse Random\\RandomException;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\Salesforce;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\SalesforceResourceOwner;\nuse TheNetworg\\OAuth2\\Client\\Provider\\Azure;\nuse TheNetworg\\OAuth2\\Client\\Provider\\AzureResourceOwner;\nuse Throwable;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingCentral;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingcentralResourceOwner;\n\nclass SocialAccountService\n{\n /**\n * Get a fresh tokens 5 minutes before it expires\n * That should minimise the number of failed requests due to expired token\n * for long-running jobs that reuse the same token for pulling lots of data.\n */\n private const int REFRESH_OFFSET_MIN = 5;\n\n private const string TOKEN_STATE_FETCH = 'fetch';\n private const string TOKEN_STATE_REFRESH = 'refresh';\n private const string TOKEN_RESULT_ATTEMPT = 'attempt';\n private const string TOKEN_RESULT_SUCCESS = 'success';\n private const string TOKEN_RESULT_FAILURE = 'failure';\n\n private ?AccessTokenInterface $accessToken = null;\n private ?string $token = null;\n private ?string $refreshToken = null;\n private ?int $expires = null;\n private ?string $countryCode = null;\n private ?string $timezone = null;\n private ?array $vendorValues = null;\n\n private ?int $refreshTokenExpires = null;\n\n public function __construct(\n private readonly EncryptedTokenManager $encryptedTokenManager,\n private readonly LoggerInterface $logger,\n private readonly PhoneNumberUtil $phoneNumberUtil,\n private readonly Dispatcher $eventDispatcher,\n private readonly UserRepository $userRepository,\n ) {\n }\n\n public function setVendorValues(array $values): void\n {\n $this->vendorValues = $values;\n }\n\n public function setAccessToken(AccessTokenInterface $accessToken): void\n {\n $this->accessToken = $accessToken;\n // Todo: Also set these other params from this token e.g. refreshToken\n }\n\n public function setToken(?string $token): void\n {\n $this->token = $token;\n }\n\n public function setRefreshToken(?string $refreshToken): void\n {\n $this->refreshToken = $refreshToken;\n }\n\n public function setCountryCode(string $countryCode): void\n {\n $this->countryCode = $countryCode;\n }\n\n public function setTimezone(string $timezone): void\n {\n $this->timezone = $timezone;\n }\n\n public function setExpires(?int $expiry): void\n {\n $this->expires = $expiry;\n }\n\n public function setRefreshTokenExpires(array $values): void\n {\n $this->refreshTokenExpires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getProvider(string $provider): AbstractProvider\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n return new LinkedIn(config('services.linkedin'));\n\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n $socialProvider = new LinkedIn(config('services.linkedin-conference'));\n $socialProvider->withFields([\n 'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',\n ]);\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_SALESFORCE:\n return new Salesforce(config('services.salesforce'));\n\n case SocialAccount::PROVIDER_GOOGLE:\n return new Google(config('services.google'));\n\n case SocialAccount::PROVIDER_SLACK:\n return new Slack(config('services.slack'));\n\n case SocialAccount::PROVIDER_OFFICE:\n $config = config('services.office');\n\n // Convert string scope to array format expected by Azure provider\n if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {\n $config['scopes'] = array_filter(preg_split('/\\s+/', trim($config['scope'])));\n unset($config['scope']);\n }\n\n $socialProvider = new Azure($config);\n $socialProvider->urlAPI = 'https://graph.microsoft.com/v1.0/';\n $socialProvider->API_VERSION = '1.0';\n $socialProvider->defaultEndPointVersion = Azure::ENDPOINT_VERSION_2_0;\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_HUBSPOT:\n return new HubSpot(config('services.hubspot'));\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n return new Pipedrive(config('services.pipedrive'));\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n return new Zoom(config('services.zoom-phone'));\n\n case SocialAccount::PROVIDER_OUTREACH:\n return new Outreach(config('services.outreach'));\n\n case SocialAccount::PROVIDER_SALESLOFT:\n return new Salesloft(config('services.salesloft'));\n\n case SocialAccount::PROVIDER_AIRCALL:\n return new Aircall(config('services.aircall'));\n\n case SocialAccount::PROVIDER_DIALPAD:\n return new Dialpad(config('services.dialpad'));\n\n case SocialAccount::PROVIDER_GONG:\n return new BasicAuth(config('services.gong'));\n\n case SocialAccount::PROVIDER_CLOSE:\n return new BasicAuth(config('services.close'));\n\n case SocialAccount::PROVIDER_AVAYA:\n // Avaya is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.avaya'));\n\n case SocialAccount::PROVIDER_TELUS:\n // Telus is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.telus'));\n\n case SocialAccount::PROVIDER_RINGCENTRAL:\n return new RingCentral(config('services.ringcentral'));\n\n case SocialAccount::PROVIDER_BULLHORN:\n return new Bullhorn(config('services.bullhorn'));\n\n case SocialAccount::PROVIDER_TALKDESK:\n return new Talkdesk(config('services.talkdesk'), [\n // Automatically concatenate Basic token to AuthToken requests\n 'optionProvider' => new HttpBasicAuthOptionProvider(),\n ]);\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n /**\n *\n *\n * @throws Exception\n */\n public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n /** @var LinkedInResourceOwner $providerUser */\n return $this->mapLinkedInUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESFORCE:\n /** @var SalesforceResourceOwner $providerUser */\n return $this->mapSalesforceUserData($providerUser);\n\n case SocialAccount::PROVIDER_HUBSPOT:\n /** @var HubSpotResourceOwner $providerUser */\n return $this->mapHubSpotUserData($providerUser);\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n /** @var PipedriveResourceOwner $providerUser */\n return $this->mapPipedriveUserData($providerUser);\n\n case SocialAccount::PROVIDER_GOOGLE:\n /** @var GoogleUser $providerUser */\n return $this->mapGoogleUserData($providerUser);\n\n case SocialAccount::PROVIDER_SLACK:\n /** @var SlackResourceOwner $providerUser */\n return $this->mapSlackUserData($providerUser);\n\n case SocialAccount::PROVIDER_OFFICE:\n /** @var AzureResourceOwner $providerUser */\n return $this->mapOfficeUserData($providerUser);\n\n case SocialAccount::PROVIDER_OUTREACH:\n return $this->mapOutreachUserData($providerUser);\n\n case SocialAccount::PROVIDER_DIALPAD:\n /** @var DialpadResourceOwner $providerUser*/\n return $this->mapDialpadUserData($providerUser);\n\n case SocialAccount::PROVIDER_AIRCALL:\n /** @var AircallResourceOwner $providerUser */\n return $this->mapAircallUserData($providerUser);\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n /** @var ZoomResourceOwner $providerUser */\n return $this->mapZoomPhoneUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESLOFT:\n /** @var SalesloftResourceOwner $providerUser */\n return $this->mapSalesloftUserData($providerUser);\n\n case SocialAccount::PROVIDER_BULLHORN:\n return $this->mapBullhornUserData();\n\n case SocialAccount::PROVIDER_TALKDESK:\n /** @var TalkdeskResourceOwner $providerUser */\n return $this->mapTalkdeskUserData($providerUser);\n\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_TELUS:\n /** @var RingcentralResourceOwner $providerUser */\n return $this->mapRingCentralUserData($providerUser);\n default:\n throw new InvalidEnumException('Unknown provider.');\n }\n }\n\n /**\n * Returns a new random string to use as the state parameter in an\n * authorization flow.\n *\n * @param int $length Length of the random string to be generated.\n *\n * @throws RandomException\n */\n public function getRandomState(int $length = 32): string\n {\n // Converting bytes to hex will always double length. Hence, we can reduce\n // the amount of bytes by half to produce the correct length.\n return bin2hex(random_bytes($length / 2));\n }\n\n private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount\n {\n return SocialAccount::where([\n 'provider' => $provider,\n 'provider_user_id' => $providerUser->getId(),\n ])->first();\n }\n\n /**\n * Based on the provider data, try to match to a sociable entity based on email.\n * If a match is made, create the social account under that entity.\n *\n * @throws AuthenticationException\n */\n public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User\n {\n $account = $this->getAssociation($provider, $providerUser);\n if ($account !== null && $account->hasUser()) {\n return $account->getUser();\n }\n $userData = $this->mapUserData($provider, $providerUser);\n\n // Check if we have an actual user with this email.\n /** @var User|null $user */\n $user = $this->userRepository->findByEmail($userData['email']);\n\n // If the user is trying to connect to LinkedIn, don't allow this.\n // Todo: have an interstitial page to perform 2FA to connect.\n if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {\n throw new AuthenticationException(\n 'Sorry, you\\'ll need to login through your Jiminny account to access the Conference.',\n );\n }\n\n return $user;\n }\n\n /**\n * @throws JsonException\n */\n public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount\n {\n /** @var SocialAccount $account */\n $account = $user->socialAccounts()->firstOrNew([\n 'provider' => $provider,\n ]);\n\n $account->fill([\n 'provider_user_id' => $providerUser->getId(),\n 'provider_user_token' => $this->token,\n 'expires' => $this->expires,\n 'state' => SocialAccount::STATE_CONNECTED,\n 'retry_after' => null,\n ]);\n\n // This is an optional parameter, don't overwrite the existing one with null if we don't get it.\n if ($this->refreshToken) {\n $account->fill([\n 'provider_refresh_token' => $this->refreshToken,\n 'refresh_token_expires' => $this->refreshTokenExpires,\n ]);\n }\n\n if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {\n $account->fill([\n 'auth_scope' => is_scalar($this->vendorValues['scope'])\n ? $this->vendorValues['scope']\n : json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),\n ]);\n } else {\n $account->fill([\n 'auth_scope' => null,\n ]);\n\n $this->logger->warning(\n '[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',\n // pulling directly from the token, just to avoid potential masking of the issue\n ['token_values' => $this->accessToken->getValues()],\n );\n }\n\n $account->save();\n\n // Association can be from an updated token so don't re-announce this.\n if (\n $account->wasRecentlyCreated\n && in_array($provider, SocialAccount::CRM_PROVIDERS, true)\n && $provider !== SocialAccount::PROVIDER_HUBSPOT\n && $providerUser->getId() !== null\n ) {\n $crm = $user->team->crm;\n $data = [\n 'crm_configuration_id' => $crm->id,\n 'log_notes' => Profile::LOG_NOTE_ENHANCED,\n ];\n\n $crmProfile = $user->crmProfile()->where([\n 'crm_provider_id' => $providerUser->getId(),\n ])->first();\n\n $user->crmProfile()->updateOrCreate([\n 'crm_provider_id' => $providerUser->getId(),\n ], $data);\n\n // If updated, fire reconnected\n if ($crmProfile !== null) {\n $this->eventDispatcher->dispatch(new CrmAccountReconnected($account));\n }\n }\n\n $this->eventDispatcher->dispatch(new SocialAccountConnected($account));\n\n return $account;\n }\n\n public function integrate(string $provider, User $user, Team $team): void\n {\n if ($provider === SocialAccount::PROVIDER_SLACK) {\n if (! isset($this->vendorValues['ok'])\n || $this->vendorValues['ok'] !== true\n || ! isset($this->vendorValues['token_type'])\n || $this->vendorValues['token_type'] !== 'bot'\n ) {\n // code expects V2 token, which differs slightly from V1\n throw new LogicException('Invalid token received from Slack OAuth v2 API');\n }\n\n $webhook = $this->vendorValues['incoming_webhook'];\n\n $slackTeamId = $this->vendorValues['team']['id'];\n\n $botData = [\n 'channel' => $webhook['channel'],\n 'channel_id' => $webhook['channel_id'],\n 'config_url' => $webhook['configuration_url'],\n 'webhook_url' => $webhook['url'],\n 'bot_user_id' => $this->vendorValues['bot_user_id'],\n 'bot_access_token' => $this->accessToken->getToken(),\n ];\n\n $slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);\n\n if ($slackBot->wasRecentlyCreated) {\n // Send Slack notification.\n $user->notify(new SlackBotAdded());\n }\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);\n\n $this->logger->info('[SocialAccountService] Fetching token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $account->refresh();\n\n if (\n ! $forceRefresh\n && ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))\n ) {\n $this->logger->info('[SocialAccountService] Token retrieved', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);\n\n return $this->encryptedTokenManager->getAccessToken($account);\n }\n\n try {\n $this->logger->info('[SocialAccountService] Token needs refreshing', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n return $this->refreshToken($account, $forceRefresh);\n } catch (IdentityProviderException $exception) {\n $responseBody = $exception->getResponseBody();\n\n if ($responseBody instanceof Response) {\n $responseBody = $responseBody->getBody();\n }\n\n if (is_object($responseBody) && method_exists($responseBody, '__toString')) {\n $responseBody = $responseBody->__toString();\n }\n\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'responseBody' => $responseBody,\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logger->error('[SocialAccountService] Cannot obtain token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception::class,\n 'errorMessage' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {\n $this->logger->error('[SocialAccountService] Full refresh required', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n // Something terrible happened their token, they need to reconnect.\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n $this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));\n }\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n }\n }\n\n public function refreshSocialAccountToken(SocialAccount $socialAccount): void\n {\n try {\n $this->getToken($socialAccount);\n } catch (Throwable $e) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $socialAccount->getId(),\n 'provider' => $socialAccount->getProviderName(),\n 'reason' => $e->getMessage(),\n ]);\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);\n\n $newToken = null;\n\n Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)\n ->block(8, function () use ($account, $forceRefresh, &$newToken): void {\n try {\n $account->refresh();\n $token = $this->encryptedTokenManager->getAccessToken($account);\n\n if (! $forceRefresh && $this->hasValidToken($account)) {\n $newToken = $token;\n\n return;\n }\n\n if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {\n $this->logger->error('[SocialAccountService] Refresh token not found', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog(\n $account,\n self::TOKEN_STATE_REFRESH,\n self::TOKEN_RESULT_FAILURE,\n );\n\n throw new SocialAccountTokenInvalidException(\n 'Refresh token is not set, re-connection required.',\n );\n }\n\n $this->logger->info('[SocialAccountService] Refreshing token from provider', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),\n 'state' => $account->getState(),\n ]);\n\n $newToken = $this->getProvider($account->provider)\n ->getAccessToken('refresh_token', [\n 'refresh_token' => $token->getRefreshToken(),\n ])\n ;\n\n if ($newToken->getToken() === $token->getToken()) {\n $this->logger->info('[SocialAccountService] Refreshed with an identical token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n }\n } catch (ConnectException | RequestException $exception) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n // This usually occurs due to SSL errors.\n throw new SocialAccountTokenInvalidException(\n 'Token could not be refreshed.',\n $exception->getCode(),\n $exception,\n );\n }\n\n $account->provider_user_token = $newToken->getToken();\n $account->expires = $newToken->getExpires();\n $account->state = SocialAccount::STATE_CONNECTED;\n\n if ($newToken->getRefreshToken()) {\n $account->provider_refresh_token = $newToken->getRefreshToken();\n $values = $newToken->getValues();\n $account->refresh_token_expires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n $account->save();\n });\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);\n\n $this->logger->info('[SocialAccountService] Token refreshed', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'state' => $account->getState(),\n ]);\n\n return $newToken;\n }\n\n /**\n * @return string[]\n */\n private function getAccessScope(string $provider): array\n {\n $scopes = [];\n $providerScopes = config('services.' . $provider . '.scope');\n\n if ($providerScopes) {\n $scopes = preg_split('/\\s+/', $providerScopes);\n }\n\n return $scopes;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getAuthorizationOptions(string $provider): array\n {\n $scopes = ['scope' => $this->getAccessScope($provider)];\n\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n case SocialAccount::PROVIDER_SALESFORCE:\n case SocialAccount::PROVIDER_HUBSPOT:\n case SocialAccount::PROVIDER_OUTREACH:\n case SocialAccount::PROVIDER_SALESLOFT:\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n case SocialAccount::PROVIDER_PIPEDRIVE:\n case SocialAccount::PROVIDER_SLACK:\n case SocialAccount::PROVIDER_AIRCALL:\n case SocialAccount::PROVIDER_BULLHORN:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_TELUS:\n case SocialAccount::PROVIDER_DIALPAD:\n case SocialAccount::PROVIDER_TALKDESK:\n return $scopes;\n\n case SocialAccount::PROVIDER_OFFICE:\n return $scopes + [\n 'access_type' => 'offline',\n ];\n\n case SocialAccount::PROVIDER_GOOGLE:\n return $scopes + [\n 'access_type' => 'offline',\n 'include_granted_scopes' => 'true',\n 'approval_prompt' => null,\n ];\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n private function tokenDoesNotExpire(SocialAccount $account): bool\n {\n return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);\n }\n\n private function hasValidToken(SocialAccount $account): bool\n {\n return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();\n }\n\n private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void\n {\n Datadog::increment('jiminny.access_token', 1, [\n 'provider' => $account->getProviderName(),\n 'state' => $state,\n 'result' => $result,\n ]);\n }\n\n private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),\n ];\n }\n\n private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n try {\n $parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);\n $number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);\n } catch (NumberParseException) {\n $number = null;\n }\n\n // Todo: this should check the `organization_id` matches the parent crm configuration.\n\n return [\n 'country_code' => $this->countryCode,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),\n 'phone' => $number,\n 'crm_provider_id' => $rawUserData['organization_id'],\n 'crm_base_url' => $this->vendorValues['instance_url'],\n ];\n }\n\n /**\n * Todo: this should check the `getHubId` matches the parent crm configuration.\n */\n private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array\n {\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $providerUser->getHubId(),\n 'crm_base_url' => $providerUser->toArray()['hub_domain'],\n ];\n }\n\n /**\n * Todo: this should check the `getCompanyId` matches the parent crm configuration.\n */\n private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $rawUserData['data']['company_id'],\n 'crm_base_url' => 'https://' . $rawUserData['data']['company_domain'] . '.pipedrive.com',\n ];\n }\n\n private function mapGoogleUserData(GoogleUser $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($providerUser->getEmail()),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapSlackUserData(SlackResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getRealName(),\n ];\n }\n\n private function mapOfficeUserData(AzureResourceOwner $providerUser): array\n {\n $email = $providerUser->getUpn() ?? $providerUser->claim('email');\n\n $this->logger->info('[Office] User authenticated', $providerUser->toArray());\n\n $name = $providerUser->claim('name') ??\n $providerUser->getFirstName() . ' ' . $providerUser->getLastName();\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($email),\n 'name' => $name,\n ];\n }\n\n private function mapOutreachUserData(ResourceOwnerInterface $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n $socialProvider = $this->getProvider(SocialAccount::PROVIDER_OUTREACH);\n $url = 'https://api.outreach.io/api/v2/profiles/';\n\n try {\n $request = $socialProvider->getAuthenticatedRequest(\n 'get',\n $url . $rawUserData['meta']['user']['id'],\n $this->accessToken,\n );\n\n $response = $socialProvider->getParsedResponse($request);\n\n $this->logger->info('[Outreach] User authenticated', $response);\n } catch (Exception) {\n //Just ignore\n }\n\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapDialpadUserData(DialpadResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n // They need to be Super Admin to access the Company APIs.\n $this->logger->info('[Dialpad] User authenticated', $rawUserData);\n\n if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Dialpad Super Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapAircallUserData(AircallResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array\n {\n if ($providerUser->toArray()['data']['team_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Team Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapBullhornUserData(): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n\n private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Services;\n\n/**\n * @todo cleanup after #slack-oauth-v2\n */\n\nuse AdamPaterson\\OAuth2\\Client\\Provider\\SlackResourceOwner;\nuse Chadhutchins\\OAuth2\\Client\\Provider\\Slack;\nuse ChaseConey\\LaravelDatadogHelper\\Datadog;\nuse Daniti\\OAuth2\\Client\\Provider\\Pipedrive;\nuse Daniti\\OAuth2\\Client\\Provider\\PipedriveResourceOwner;\nuse Exception;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpot;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpotResourceOwner;\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Psr7\\Response;\nuse Illuminate\\Auth\\AuthenticationException;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Support\\Facades\\Cache;\nuse Jiminny\\Component\\Encryption\\EncryptedTokenManager;\nuse Jiminny\\Events\\Users\\CrmAccountReconnected;\nuse Jiminny\\Events\\Users\\SocialAccountConnected;\nuse Jiminny\\Events\\Users\\SocialAccountDisconnected;\nuse Jiminny\\Exceptions\\ActivityProviderException;\nuse Jiminny\\Exceptions\\InvalidEnumException;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Repositories\\UserRepository;\nuse Jiminny\\Models\\SocialAccount;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Notifications\\SlackBotAdded;\nuse Jiminny\\OAuth2\\Client\\Provider\\Aircall;\nuse Jiminny\\OAuth2\\Client\\Provider\\AircallResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Bullhorn;\nuse Jiminny\\OAuth2\\Client\\Provider\\Dialpad;\nuse Jiminny\\OAuth2\\Client\\Provider\\DialpadResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Salesloft;\nuse Jiminny\\OAuth2\\Client\\Provider\\SalesloftResourceOwner;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\Talkdesk;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\TalkdeskResourceOwner;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\Zoom;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\ZoomResourceOwner;\nuse Jiminny\\Services\\OAuth2\\Provider\\BasicAuth;\nuse Jiminny\\Services\\OAuth2\\Provider\\Outreach;\nuse JsonException;\nuse League\\OAuth2\\Client\\OptionProvider\\HttpBasicAuthOptionProvider;\nuse League\\OAuth2\\Client\\Provider\\AbstractProvider;\nuse League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException;\nuse League\\OAuth2\\Client\\Provider\\Google;\nuse League\\OAuth2\\Client\\Provider\\GoogleUser;\nuse League\\OAuth2\\Client\\Provider\\LinkedIn;\nuse League\\OAuth2\\Client\\Provider\\LinkedInResourceOwner;\nuse League\\OAuth2\\Client\\Provider\\ResourceOwnerInterface;\nuse League\\OAuth2\\Client\\Token\\AccessToken;\nuse League\\OAuth2\\Client\\Token\\AccessTokenInterface;\nuse libphonenumber\\NumberParseException;\nuse libphonenumber\\PhoneNumberFormat;\nuse libphonenumber\\PhoneNumberUtil;\nuse LogicException;\nuse Psr\\Log\\LoggerInterface;\nuse Random\\RandomException;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\Salesforce;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\SalesforceResourceOwner;\nuse TheNetworg\\OAuth2\\Client\\Provider\\Azure;\nuse TheNetworg\\OAuth2\\Client\\Provider\\AzureResourceOwner;\nuse Throwable;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingCentral;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingcentralResourceOwner;\n\nclass SocialAccountService\n{\n /**\n * Get a fresh tokens 5 minutes before it expires\n * That should minimise the number of failed requests due to expired token\n * for long-running jobs that reuse the same token for pulling lots of data.\n */\n private const int REFRESH_OFFSET_MIN = 5;\n\n private const string TOKEN_STATE_FETCH = 'fetch';\n private const string TOKEN_STATE_REFRESH = 'refresh';\n private const string TOKEN_RESULT_ATTEMPT = 'attempt';\n private const string TOKEN_RESULT_SUCCESS = 'success';\n private const string TOKEN_RESULT_FAILURE = 'failure';\n\n private ?AccessTokenInterface $accessToken = null;\n private ?string $token = null;\n private ?string $refreshToken = null;\n private ?int $expires = null;\n private ?string $countryCode = null;\n private ?string $timezone = null;\n private ?array $vendorValues = null;\n\n private ?int $refreshTokenExpires = null;\n\n public function __construct(\n private readonly EncryptedTokenManager $encryptedTokenManager,\n private readonly LoggerInterface $logger,\n private readonly PhoneNumberUtil $phoneNumberUtil,\n private readonly Dispatcher $eventDispatcher,\n private readonly UserRepository $userRepository,\n ) {\n }\n\n public function setVendorValues(array $values): void\n {\n $this->vendorValues = $values;\n }\n\n public function setAccessToken(AccessTokenInterface $accessToken): void\n {\n $this->accessToken = $accessToken;\n // Todo: Also set these other params from this token e.g. refreshToken\n }\n\n public function setToken(?string $token): void\n {\n $this->token = $token;\n }\n\n public function setRefreshToken(?string $refreshToken): void\n {\n $this->refreshToken = $refreshToken;\n }\n\n public function setCountryCode(string $countryCode): void\n {\n $this->countryCode = $countryCode;\n }\n\n public function setTimezone(string $timezone): void\n {\n $this->timezone = $timezone;\n }\n\n public function setExpires(?int $expiry): void\n {\n $this->expires = $expiry;\n }\n\n public function setRefreshTokenExpires(array $values): void\n {\n $this->refreshTokenExpires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getProvider(string $provider): AbstractProvider\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n return new LinkedIn(config('services.linkedin'));\n\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n $socialProvider = new LinkedIn(config('services.linkedin-conference'));\n $socialProvider->withFields([\n 'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',\n ]);\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_SALESFORCE:\n return new Salesforce(config('services.salesforce'));\n\n case SocialAccount::PROVIDER_GOOGLE:\n return new Google(config('services.google'));\n\n case SocialAccount::PROVIDER_SLACK:\n return new Slack(config('services.slack'));\n\n case SocialAccount::PROVIDER_OFFICE:\n $config = config('services.office');\n\n // Convert string scope to array format expected by Azure provider\n if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {\n $config['scopes'] = array_filter(preg_split('/\\s+/', trim($config['scope'])));\n unset($config['scope']);\n }\n\n $socialProvider = new Azure($config);\n $socialProvider->urlAPI = 'https://graph.microsoft.com/v1.0/';\n $socialProvider->API_VERSION = '1.0';\n $socialProvider->defaultEndPointVersion = Azure::ENDPOINT_VERSION_2_0;\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_HUBSPOT:\n return new HubSpot(config('services.hubspot'));\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n return new Pipedrive(config('services.pipedrive'));\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n return new Zoom(config('services.zoom-phone'));\n\n case SocialAccount::PROVIDER_OUTREACH:\n return new Outreach(config('services.outreach'));\n\n case SocialAccount::PROVIDER_SALESLOFT:\n return new Salesloft(config('services.salesloft'));\n\n case SocialAccount::PROVIDER_AIRCALL:\n return new Aircall(config('services.aircall'));\n\n case SocialAccount::PROVIDER_DIALPAD:\n return new Dialpad(config('services.dialpad'));\n\n case SocialAccount::PROVIDER_GONG:\n return new BasicAuth(config('services.gong'));\n\n case SocialAccount::PROVIDER_CLOSE:\n return new BasicAuth(config('services.close'));\n\n case SocialAccount::PROVIDER_AVAYA:\n // Avaya is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.avaya'));\n\n case SocialAccount::PROVIDER_TELUS:\n // Telus is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.telus'));\n\n case SocialAccount::PROVIDER_RINGCENTRAL:\n return new RingCentral(config('services.ringcentral'));\n\n case SocialAccount::PROVIDER_BULLHORN:\n return new Bullhorn(config('services.bullhorn'));\n\n case SocialAccount::PROVIDER_TALKDESK:\n return new Talkdesk(config('services.talkdesk'), [\n // Automatically concatenate Basic token to AuthToken requests\n 'optionProvider' => new HttpBasicAuthOptionProvider(),\n ]);\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n /**\n *\n *\n * @throws Exception\n */\n public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n /** @var LinkedInResourceOwner $providerUser */\n return $this->mapLinkedInUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESFORCE:\n /** @var SalesforceResourceOwner $providerUser */\n return $this->mapSalesforceUserData($providerUser);\n\n case SocialAccount::PROVIDER_HUBSPOT:\n /** @var HubSpotResourceOwner $providerUser */\n return $this->mapHubSpotUserData($providerUser);\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n /** @var PipedriveResourceOwner $providerUser */\n return $this->mapPipedriveUserData($providerUser);\n\n case SocialAccount::PROVIDER_GOOGLE:\n /** @var GoogleUser $providerUser */\n return $this->mapGoogleUserData($providerUser);\n\n case SocialAccount::PROVIDER_SLACK:\n /** @var SlackResourceOwner $providerUser */\n return $this->mapSlackUserData($providerUser);\n\n case SocialAccount::PROVIDER_OFFICE:\n /** @var AzureResourceOwner $providerUser */\n return $this->mapOfficeUserData($providerUser);\n\n case SocialAccount::PROVIDER_OUTREACH:\n return $this->mapOutreachUserData($providerUser);\n\n case SocialAccount::PROVIDER_DIALPAD:\n /** @var DialpadResourceOwner $providerUser*/\n return $this->mapDialpadUserData($providerUser);\n\n case SocialAccount::PROVIDER_AIRCALL:\n /** @var AircallResourceOwner $providerUser */\n return $this->mapAircallUserData($providerUser);\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n /** @var ZoomResourceOwner $providerUser */\n return $this->mapZoomPhoneUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESLOFT:\n /** @var SalesloftResourceOwner $providerUser */\n return $this->mapSalesloftUserData($providerUser);\n\n case SocialAccount::PROVIDER_BULLHORN:\n return $this->mapBullhornUserData();\n\n case SocialAccount::PROVIDER_TALKDESK:\n /** @var TalkdeskResourceOwner $providerUser */\n return $this->mapTalkdeskUserData($providerUser);\n\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_TELUS:\n /** @var RingcentralResourceOwner $providerUser */\n return $this->mapRingCentralUserData($providerUser);\n default:\n throw new InvalidEnumException('Unknown provider.');\n }\n }\n\n /**\n * Returns a new random string to use as the state parameter in an\n * authorization flow.\n *\n * @param int $length Length of the random string to be generated.\n *\n * @throws RandomException\n */\n public function getRandomState(int $length = 32): string\n {\n // Converting bytes to hex will always double length. Hence, we can reduce\n // the amount of bytes by half to produce the correct length.\n return bin2hex(random_bytes($length / 2));\n }\n\n private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount\n {\n return SocialAccount::where([\n 'provider' => $provider,\n 'provider_user_id' => $providerUser->getId(),\n ])->first();\n }\n\n /**\n * Based on the provider data, try to match to a sociable entity based on email.\n * If a match is made, create the social account under that entity.\n *\n * @throws AuthenticationException\n */\n public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User\n {\n $account = $this->getAssociation($provider, $providerUser);\n if ($account !== null && $account->hasUser()) {\n return $account->getUser();\n }\n $userData = $this->mapUserData($provider, $providerUser);\n\n // Check if we have an actual user with this email.\n /** @var User|null $user */\n $user = $this->userRepository->findByEmail($userData['email']);\n\n // If the user is trying to connect to LinkedIn, don't allow this.\n // Todo: have an interstitial page to perform 2FA to connect.\n if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {\n throw new AuthenticationException(\n 'Sorry, you\\'ll need to login through your Jiminny account to access the Conference.',\n );\n }\n\n return $user;\n }\n\n /**\n * @throws JsonException\n */\n public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount\n {\n /** @var SocialAccount $account */\n $account = $user->socialAccounts()->firstOrNew([\n 'provider' => $provider,\n ]);\n\n $account->fill([\n 'provider_user_id' => $providerUser->getId(),\n 'provider_user_token' => $this->token,\n 'expires' => $this->expires,\n 'state' => SocialAccount::STATE_CONNECTED,\n 'retry_after' => null,\n ]);\n\n // This is an optional parameter, don't overwrite the existing one with null if we don't get it.\n if ($this->refreshToken) {\n $account->fill([\n 'provider_refresh_token' => $this->refreshToken,\n 'refresh_token_expires' => $this->refreshTokenExpires,\n ]);\n }\n\n if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {\n $account->fill([\n 'auth_scope' => is_scalar($this->vendorValues['scope'])\n ? $this->vendorValues['scope']\n : json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),\n ]);\n } else {\n $account->fill([\n 'auth_scope' => null,\n ]);\n\n $this->logger->warning(\n '[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',\n // pulling directly from the token, just to avoid potential masking of the issue\n ['token_values' => $this->accessToken->getValues()],\n );\n }\n\n $account->save();\n\n // Association can be from an updated token so don't re-announce this.\n if (\n $account->wasRecentlyCreated\n && in_array($provider, SocialAccount::CRM_PROVIDERS, true)\n && $provider !== SocialAccount::PROVIDER_HUBSPOT\n && $providerUser->getId() !== null\n ) {\n $crm = $user->team->crm;\n $data = [\n 'crm_configuration_id' => $crm->id,\n 'log_notes' => Profile::LOG_NOTE_ENHANCED,\n ];\n\n $crmProfile = $user->crmProfile()->where([\n 'crm_provider_id' => $providerUser->getId(),\n ])->first();\n\n $user->crmProfile()->updateOrCreate([\n 'crm_provider_id' => $providerUser->getId(),\n ], $data);\n\n // If updated, fire reconnected\n if ($crmProfile !== null) {\n $this->eventDispatcher->dispatch(new CrmAccountReconnected($account));\n }\n }\n\n $this->eventDispatcher->dispatch(new SocialAccountConnected($account));\n\n return $account;\n }\n\n public function integrate(string $provider, User $user, Team $team): void\n {\n if ($provider === SocialAccount::PROVIDER_SLACK) {\n if (! isset($this->vendorValues['ok'])\n || $this->vendorValues['ok'] !== true\n || ! isset($this->vendorValues['token_type'])\n || $this->vendorValues['token_type'] !== 'bot'\n ) {\n // code expects V2 token, which differs slightly from V1\n throw new LogicException('Invalid token received from Slack OAuth v2 API');\n }\n\n $webhook = $this->vendorValues['incoming_webhook'];\n\n $slackTeamId = $this->vendorValues['team']['id'];\n\n $botData = [\n 'channel' => $webhook['channel'],\n 'channel_id' => $webhook['channel_id'],\n 'config_url' => $webhook['configuration_url'],\n 'webhook_url' => $webhook['url'],\n 'bot_user_id' => $this->vendorValues['bot_user_id'],\n 'bot_access_token' => $this->accessToken->getToken(),\n ];\n\n $slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);\n\n if ($slackBot->wasRecentlyCreated) {\n // Send Slack notification.\n $user->notify(new SlackBotAdded());\n }\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);\n\n $this->logger->info('[SocialAccountService] Fetching token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $account->refresh();\n\n if (\n ! $forceRefresh\n && ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))\n ) {\n $this->logger->info('[SocialAccountService] Token retrieved', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);\n\n return $this->encryptedTokenManager->getAccessToken($account);\n }\n\n try {\n $this->logger->info('[SocialAccountService] Token needs refreshing', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n return $this->refreshToken($account, $forceRefresh);\n } catch (IdentityProviderException $exception) {\n $responseBody = $exception->getResponseBody();\n\n if ($responseBody instanceof Response) {\n $responseBody = $responseBody->getBody();\n }\n\n if (is_object($responseBody) && method_exists($responseBody, '__toString')) {\n $responseBody = $responseBody->__toString();\n }\n\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'responseBody' => $responseBody,\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logger->error('[SocialAccountService] Cannot obtain token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception::class,\n 'errorMessage' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {\n $this->logger->error('[SocialAccountService] Full refresh required', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n // Something terrible happened their token, they need to reconnect.\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n $this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));\n }\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n }\n }\n\n public function refreshSocialAccountToken(SocialAccount $socialAccount): void\n {\n try {\n $this->getToken($socialAccount);\n } catch (Throwable $e) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $socialAccount->getId(),\n 'provider' => $socialAccount->getProviderName(),\n 'reason' => $e->getMessage(),\n ]);\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);\n\n $newToken = null;\n\n Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)\n ->block(8, function () use ($account, $forceRefresh, &$newToken): void {\n try {\n $account->refresh();\n $token = $this->encryptedTokenManager->getAccessToken($account);\n\n if (! $forceRefresh && $this->hasValidToken($account)) {\n $newToken = $token;\n\n return;\n }\n\n if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {\n $this->logger->error('[SocialAccountService] Refresh token not found', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog(\n $account,\n self::TOKEN_STATE_REFRESH,\n self::TOKEN_RESULT_FAILURE,\n );\n\n throw new SocialAccountTokenInvalidException(\n 'Refresh token is not set, re-connection required.',\n );\n }\n\n $this->logger->info('[SocialAccountService] Refreshing token from provider', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),\n 'state' => $account->getState(),\n ]);\n\n $newToken = $this->getProvider($account->provider)\n ->getAccessToken('refresh_token', [\n 'refresh_token' => $token->getRefreshToken(),\n ])\n ;\n\n if ($newToken->getToken() === $token->getToken()) {\n $this->logger->info('[SocialAccountService] Refreshed with an identical token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n }\n } catch (ConnectException | RequestException $exception) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n // This usually occurs due to SSL errors.\n throw new SocialAccountTokenInvalidException(\n 'Token could not be refreshed.',\n $exception->getCode(),\n $exception,\n );\n }\n\n $account->provider_user_token = $newToken->getToken();\n $account->expires = $newToken->getExpires();\n $account->state = SocialAccount::STATE_CONNECTED;\n\n if ($newToken->getRefreshToken()) {\n $account->provider_refresh_token = $newToken->getRefreshToken();\n $values = $newToken->getValues();\n $account->refresh_token_expires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n $account->save();\n });\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);\n\n $this->logger->info('[SocialAccountService] Token refreshed', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'state' => $account->getState(),\n ]);\n\n return $newToken;\n }\n\n /**\n * @return string[]\n */\n private function getAccessScope(string $provider): array\n {\n $scopes = [];\n $providerScopes = config('services.' . $provider . '.scope');\n\n if ($providerScopes) {\n $scopes = preg_split('/\\s+/', $providerScopes);\n }\n\n return $scopes;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getAuthorizationOptions(string $provider): array\n {\n $scopes = ['scope' => $this->getAccessScope($provider)];\n\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n case SocialAccount::PROVIDER_SALESFORCE:\n case SocialAccount::PROVIDER_HUBSPOT:\n case SocialAccount::PROVIDER_OUTREACH:\n case SocialAccount::PROVIDER_SALESLOFT:\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n case SocialAccount::PROVIDER_PIPEDRIVE:\n case SocialAccount::PROVIDER_SLACK:\n case SocialAccount::PROVIDER_AIRCALL:\n case SocialAccount::PROVIDER_BULLHORN:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_TELUS:\n case SocialAccount::PROVIDER_DIALPAD:\n case SocialAccount::PROVIDER_TALKDESK:\n return $scopes;\n\n case SocialAccount::PROVIDER_OFFICE:\n return $scopes + [\n 'access_type' => 'offline',\n ];\n\n case SocialAccount::PROVIDER_GOOGLE:\n return $scopes + [\n 'access_type' => 'offline',\n 'include_granted_scopes' => 'true',\n 'approval_prompt' => null,\n ];\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n private function tokenDoesNotExpire(SocialAccount $account): bool\n {\n return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);\n }\n\n private function hasValidToken(SocialAccount $account): bool\n {\n return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();\n }\n\n private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void\n {\n Datadog::increment('jiminny.access_token', 1, [\n 'provider' => $account->getProviderName(),\n 'state' => $state,\n 'result' => $result,\n ]);\n }\n\n private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),\n ];\n }\n\n private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n try {\n $parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);\n $number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);\n } catch (NumberParseException) {\n $number = null;\n }\n\n // Todo: this should check the `organization_id` matches the parent crm configuration.\n\n return [\n 'country_code' => $this->countryCode,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),\n 'phone' => $number,\n 'crm_provider_id' => $rawUserData['organization_id'],\n 'crm_base_url' => $this->vendorValues['instance_url'],\n ];\n }\n\n /**\n * Todo: this should check the `getHubId` matches the parent crm configuration.\n */\n private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array\n {\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $providerUser->getHubId(),\n 'crm_base_url' => $providerUser->toArray()['hub_domain'],\n ];\n }\n\n /**\n * Todo: this should check the `getCompanyId` matches the parent crm configuration.\n */\n private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $rawUserData['data']['company_id'],\n 'crm_base_url' => 'https://' . $rawUserData['data']['company_domain'] . '.pipedrive.com',\n ];\n }\n\n private function mapGoogleUserData(GoogleUser $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($providerUser->getEmail()),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapSlackUserData(SlackResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getRealName(),\n ];\n }\n\n private function mapOfficeUserData(AzureResourceOwner $providerUser): array\n {\n $email = $providerUser->getUpn() ?? $providerUser->claim('email');\n\n $this->logger->info('[Office] User authenticated', $providerUser->toArray());\n\n $name = $providerUser->claim('name') ??\n $providerUser->getFirstName() . ' ' . $providerUser->getLastName();\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($email),\n 'name' => $name,\n ];\n }\n\n private function mapOutreachUserData(ResourceOwnerInterface $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n $socialProvider = $this->getProvider(SocialAccount::PROVIDER_OUTREACH);\n $url = 'https://api.outreach.io/api/v2/profiles/';\n\n try {\n $request = $socialProvider->getAuthenticatedRequest(\n 'get',\n $url . $rawUserData['meta']['user']['id'],\n $this->accessToken,\n );\n\n $response = $socialProvider->getParsedResponse($request);\n\n $this->logger->info('[Outreach] User authenticated', $response);\n } catch (Exception) {\n //Just ignore\n }\n\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapDialpadUserData(DialpadResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n // They need to be Super Admin to access the Company APIs.\n $this->logger->info('[Dialpad] User authenticated', $rawUserData);\n\n if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Dialpad Super Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapAircallUserData(AircallResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array\n {\n if ($providerUser->toArray()['data']['team_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Team Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapBullhornUserData(): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n\n private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\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}]...
|
6872651054280190281
|
-8880471945877483717
|
idle
|
accessibility
|
NULL
|
IDE error occurred
text/html
text/html
text/html
S IDE error occurred
text/html
text/html
text/html
See details and submit report
Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
namespace Jiminny\Services;
/**
* @todo cleanup after #slack-oauth-v2
*/
use AdamPaterson\OAuth2\Client\Provider\SlackResourceOwner;
use Chadhutchins\OAuth2\Client\Provider\Slack;
use ChaseConey\LaravelDatadogHelper\Datadog;
use Daniti\OAuth2\Client\Provider\Pipedrive;
use Daniti\OAuth2\Client\Provider\PipedriveResourceOwner;
use Exception;
use Flipbox\OAuth2\Client\Provider\HubSpot;
use Flipbox\OAuth2\Client\Provider\HubSpotResourceOwner;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Response;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Support\Facades\Cache;
use Jiminny\Component\Encryption\EncryptedTokenManager;
use Jiminny\Events\Users\CrmAccountReconnected;
use Jiminny\Events\Users\SocialAccountConnected;
use Jiminny\Events\Users\SocialAccountDisconnected;
use Jiminny\Exceptions\ActivityProviderException;
use Jiminny\Exceptions\InvalidEnumException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Models\Crm\Profile;
use Jiminny\Repositories\UserRepository;
use Jiminny\Models\SocialAccount;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Notifications\SlackBotAdded;
use Jiminny\OAuth2\Client\Provider\Aircall;
use Jiminny\OAuth2\Client\Provider\AircallResourceOwner;
use Jiminny\OAuth2\Client\Provider\Bullhorn;
use Jiminny\OAuth2\Client\Provider\Dialpad;
use Jiminny\OAuth2\Client\Provider\DialpadResourceOwner;
use Jiminny\OAuth2\Client\Provider\Salesloft;
use Jiminny\OAuth2\Client\Provider\SalesloftResourceOwner;
use Jiminny\Services\Activity\Talkdesk\Provider\Talkdesk;
use Jiminny\Services\Activity\Talkdesk\Provider\TalkdeskResourceOwner;
use Jiminny\Services\Activity\Zoom\Provider\Zoom;
use Jiminny\Services\Activity\Zoom\Provider\ZoomResourceOwner;
use Jiminny\Services\OAuth2\Provider\BasicAuth;
use Jiminny\Services\OAuth2\Provider\Outreach;
use JsonException;
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\Google;
use League\OAuth2\Client\Provider\GoogleUser;
use League\OAuth2\Client\Provider\LinkedIn;
use League\OAuth2\Client\Provider\LinkedInResourceOwner;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Token\AccessTokenInterface;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberUtil;
use LogicException;
use Psr\Log\LoggerInterface;
use Random\RandomException;
use Stevenmaguire\OAuth2\Client\Provider\Salesforce;
use Stevenmaguire\OAuth2\Client\Provider\SalesforceResourceOwner;
use TheNetworg\OAuth2\Client\Provider\Azure;
use TheNetworg\OAuth2\Client\Provider\AzureResourceOwner;
use Throwable;
use TMannherz\OAuth2\Client\Provider\RingCentral;
use TMannherz\OAuth2\Client\Provider\RingcentralResourceOwner;
class SocialAccountService
{
/**
* Get a fresh tokens 5 minutes before it expires
* That should minimise the number of failed requests due to expired token
* for long-running jobs that reuse the same token for pulling lots of data.
*/
private const int REFRESH_OFFSET_MIN = 5;
private const string TOKEN_STATE_FETCH = 'fetch';
private const string TOKEN_STATE_REFRESH = 'refresh';
private const string TOKEN_RESULT_ATTEMPT = 'attempt';
private const string TOKEN_RESULT_SUCCESS = 'success';
private const string TOKEN_RESULT_FAILURE = 'failure';
private ?AccessTokenInterface $accessToken = null;
private ?string $token = null;
private ?string $refreshToken = null;
private ?int $expires = null;
private ?string $countryCode = null;
private ?string $timezone = null;
private ?array $vendorValues = null;
private ?int $refreshTokenExpires = null;
public function __construct(
private readonly EncryptedTokenManager $encryptedTokenManager,
private readonly LoggerInterface $logger,
private readonly PhoneNumberUtil $phoneNumberUtil,
private readonly Dispatcher $eventDispatcher,
private readonly UserRepository $userRepository,
) {
}
public function setVendorValues(array $values): void
{
$this->vendorValues = $values;
}
public function setAccessToken(AccessTokenInterface $accessToken): void
{
$this->accessToken = $accessToken;
// Todo: Also set these other params from this token e.g. refreshToken
}
public function setToken(?string $token): void
{
$this->token = $token;
}
public function setRefreshToken(?string $refreshToken): void
{
$this->refreshToken = $refreshToken;
}
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
public function setTimezone(string $timezone): void
{
$this->timezone = $timezone;
}
public function setExpires(?int $expiry): void
{
$this->expires = $expiry;
}
public function setRefreshTokenExpires(array $values): void
{
$this->refreshTokenExpires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
/**
* @throws InvalidEnumException
*/
public function getProvider(string $provider): AbstractProvider
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
return new LinkedIn(config('services.linkedin'));
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
$socialProvider = new LinkedIn(config('services.linkedin-conference'));
$socialProvider->withFields([
'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',
]);
return $socialProvider;
case SocialAccount::PROVIDER_SALESFORCE:
return new Salesforce(config('services.salesforce'));
case SocialAccount::PROVIDER_GOOGLE:
return new Google(config('services.google'));
case SocialAccount::PROVIDER_SLACK:
return new Slack(config('services.slack'));
case SocialAccount::PROVIDER_OFFICE:
$config = config('services.office');
// Convert string scope to array format expected by Azure provider
if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {
$config['scopes'] = array_filter(preg_split('/\s+/', trim($config['scope'])));
unset($config['scope']);
}
$socialProvider = new Azure($config);
$socialProvider->urlAPI = '[URL_WITH_CREDENTIALS] Exception
*/
public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
/** @var LinkedInResourceOwner $providerUser */
return $this->mapLinkedInUserData($providerUser);
case SocialAccount::PROVIDER_SALESFORCE:
/** @var SalesforceResourceOwner $providerUser */
return $this->mapSalesforceUserData($providerUser);
case SocialAccount::PROVIDER_HUBSPOT:
/** @var HubSpotResourceOwner $providerUser */
return $this->mapHubSpotUserData($providerUser);
case SocialAccount::PROVIDER_PIPEDRIVE:
/** @var PipedriveResourceOwner $providerUser */
return $this->mapPipedriveUserData($providerUser);
case SocialAccount::PROVIDER_GOOGLE:
/** @var GoogleUser $providerUser */
return $this->mapGoogleUserData($providerUser);
case SocialAccount::PROVIDER_SLACK:
/** @var SlackResourceOwner $providerUser */
return $this->mapSlackUserData($providerUser);
case SocialAccount::PROVIDER_OFFICE:
/** @var AzureResourceOwner $providerUser */
return $this->mapOfficeUserData($providerUser);
case SocialAccount::PROVIDER_OUTREACH:
return $this->mapOutreachUserData($providerUser);
case SocialAccount::PROVIDER_DIALPAD:
/** @var DialpadResourceOwner $providerUser*/
return $this->mapDialpadUserData($providerUser);
case SocialAccount::PROVIDER_AIRCALL:
/** @var AircallResourceOwner $providerUser */
return $this->mapAircallUserData($providerUser);
case SocialAccount::PROVIDER_ZOOM_PHONE:
/** @var ZoomResourceOwner $providerUser */
return $this->mapZoomPhoneUserData($providerUser);
case SocialAccount::PROVIDER_SALESLOFT:
/** @var SalesloftResourceOwner $providerUser */
return $this->mapSalesloftUserData($providerUser);
case SocialAccount::PROVIDER_BULLHORN:
return $this->mapBullhornUserData();
case SocialAccount::PROVIDER_TALKDESK:
/** @var TalkdeskResourceOwner $providerUser */
return $this->mapTalkdeskUserData($providerUser);
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_TELUS:
/** @var RingcentralResourceOwner $providerUser */
return $this->mapRingCentralUserData($providerUser);
default:
throw new InvalidEnumException('Unknown provider.');
}
}
/**
* Returns a new random string to use as the state parameter in an
* authorization flow.
*
* @param int $length Length of the random string to be generated.
*
* @throws RandomException
*/
public function getRandomState(int $length = 32): string
{
// Converting bytes to hex will always double length. Hence, we can reduce
// the amount of bytes by half to produce the correct length.
return bin2hex(random_bytes($length / 2));
}
private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount
{
return SocialAccount::where([
'provider' => $provider,
'provider_user_id' => $providerUser->getId(),
])->first();
}
/**
* Based on the provider data, try to match to a sociable entity based on email.
* If a match is made, create the social account under that entity.
*
* @throws AuthenticationException
*/
public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User
{
$account = $this->getAssociation($provider, $providerUser);
if ($account !== null && $account->hasUser()) {
return $account->getUser();
}
$userData = $this->mapUserData($provider, $providerUser);
// Check if we have an actual user with this email.
/** @var User|null $user */
$user = $this->userRepository->findByEmail($userData['email']);
// If the user is trying to connect to LinkedIn, don't allow this.
// Todo: have an interstitial page to perform 2FA to connect.
if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {
throw new AuthenticationException(
'Sorry, you\'ll need to login through your Jiminny account to access the Conference.',
);
}
return $user;
}
/**
* @throws JsonException
*/
public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount
{
/** @var SocialAccount $account */
$account = $user->socialAccounts()->firstOrNew([
'provider' => $provider,
]);
$account->fill([
'provider_user_id' => $providerUser->getId(),
'provider_user_token' => $this->token,
'expires' => $this->expires,
'state' => SocialAccount::STATE_CONNECTED,
'retry_after' => null,
]);
// This is an optional parameter, don't overwrite the existing one with null if we don't get it.
if ($this->refreshToken) {
$account->fill([
'provider_refresh_token' => $this->refreshToken,
'refresh_token_expires' => $this->refreshTokenExpires,
]);
}
if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {
$account->fill([
'auth_scope' => is_scalar($this->vendorValues['scope'])
? $this->vendorValues['scope']
: json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),
]);
} else {
$account->fill([
'auth_scope' => null,
]);
$this->logger->warning(
'[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',
// pulling directly from the token, just to avoid potential masking of the issue
['token_values' => $this->accessToken->getValues()],
);
}
$account->save();
// Association can be from an updated token so don't re-announce this.
if (
$account->wasRecentlyCreated
&& in_array($provider, SocialAccount::CRM_PROVIDERS, true)
&& $provider !== SocialAccount::PROVIDER_HUBSPOT
&& $providerUser->getId() !== null
) {
$crm = $user->team->crm;
$data = [
'crm_configuration_id' => $crm->id,
'log_notes' => Profile::LOG_NOTE_ENHANCED,
];
$crmProfile = $user->crmProfile()->where([
'crm_provider_id' => $providerUser->getId(),
])->first();
$user->crmProfile()->updateOrCreate([
'crm_provider_id' => $providerUser->getId(),
], $data);
// If updated, fire reconnected
if ($crmProfile !== null) {
$this->eventDispatcher->dispatch(new CrmAccountReconnected($account));
}
}
$this->eventDispatcher->dispatch(new SocialAccountConnected($account));
return $account;
}
public function integrate(string $provider, User $user, Team $team): void
{
if ($provider === SocialAccount::PROVIDER_SLACK) {
if (! isset($this->vendorValues['ok'])
|| $this->vendorValues['ok'] !== true
|| ! isset($this->vendorValues['token_type'])
|| $this->vendorValues['token_type'] !== 'bot'
) {
// code expects V2 token, which differs slightly from V1
throw new LogicException('Invalid token received from Slack OAuth v2 API');
}
$webhook = $this->vendorValues['incoming_webhook'];
$slackTeamId = $this->vendorValues['team']['id'];
$botData = [
'channel' => $webhook['channel'],
'channel_id' => $webhook['channel_id'],
'config_url' => $webhook['configuration_url'],
'webhook_url' => $webhook['url'],
'bot_user_id' => $this->vendorValues['bot_user_id'],
'bot_access_token' => $this->accessToken->getToken(),
];
$slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);
if ($slackBot->wasRecentlyCreated) {
// Send Slack notification.
$user->notify(new SlackBotAdded());
}
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);
$this->logger->info('[SocialAccountService] Fetching token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$account->refresh();
if (
! $forceRefresh
&& ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))
) {
$this->logger->info('[SocialAccountService] Token retrieved', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);
return $this->encryptedTokenManager->getAccessToken($account);
}
try {
$this->logger->info('[SocialAccountService] Token needs refreshing', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
return $this->refreshToken($account, $forceRefresh);
} catch (IdentityProviderException $exception) {
$responseBody = $exception->getResponseBody();
if ($responseBody instanceof Response) {
$responseBody = $responseBody->getBody();
}
if (is_object($responseBody) && method_exists($responseBody, '__toString')) {
$responseBody = $responseBody->__toString();
}
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'responseBody' => $responseBody,
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logger->error('[SocialAccountService] Cannot obtain token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception::class,
'errorMessage' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {
$this->logger->error('[SocialAccountService] Full refresh required', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
// Something terrible happened their token, they need to reconnect.
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
$this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));
}
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
}
}
public function refreshSocialAccountToken(SocialAccount $socialAccount): void
{
try {
$this->getToken($socialAccount);
} catch (Throwable $e) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $socialAccount->getId(),
'provider' => $socialAccount->getProviderName(),
'reason' => $e->getMessage(),
]);
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);
$newToken = null;
Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)
->block(8, function () use ($account, $forceRefresh, &$newToken): void {
try {
$account->refresh();
$token = $this->encryptedTokenManager->getAccessToken($account);
if (! $forceRefresh && $this->hasValidToken($account)) {
$newToken = $token;
return;
}
if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {
$this->logger->error('[SocialAccountService] Refresh token not found', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog(
$account,
self::TOKEN_STATE_REFRESH,
self::TOKEN_RESULT_FAILURE,
);
throw new SocialAccountTokenInvalidException(
'Refresh token is not set, re-connection required.',
);
}
$this->logger->info('[SocialAccountService] Refreshing token from provider', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),
'state' => $account->getState(),
]);
$newToken = $this->getProvider($account->provider)
->getAccessToken('refresh_token', [
'refresh_token' => $token->getRefreshToken(),
])
;
if ($newToken->getToken() === $token->getToken()) {
$this->logger->info('[SocialAccountService] Refreshed with an identical token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
}
} catch (ConnectException | RequestException $exception) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
// This usually occurs due to SSL errors.
throw new SocialAccountTokenInvalidException(
'Token could not be refreshed.',
$exception->getCode(),
$exception,
);
}
$account->provider_user_token = $newToken->getToken();
$account->expires = $newToken->getExpires();
$account->state = SocialAccount::STATE_CONNECTED;
if ($newToken->getRefreshToken()) {
$account->provider_refresh_token = $newToken->getRefreshToken();
$values = $newToken->getValues();
$account->refresh_token_expires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
$account->save();
});
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);
$this->logger->info('[SocialAccountService] Token refreshed', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'state' => $account->getState(),
]);
return $newToken;
}
/**
* @return string[]
*/
private function getAccessScope(string $provider): array
{
$scopes = [];
$providerScopes = config('services.' . $provider . '.scope');
if ($providerScopes) {
$scopes = preg_split('/\s+/', $providerScopes);
}
return $scopes;
}
/**
* @throws InvalidEnumException
*/
public function getAuthorizationOptions(string $provider): array
{
$scopes = ['scope' => $this->getAccessScope($provider)];
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
case SocialAccount::PROVIDER_SALESFORCE:
case SocialAccount::PROVIDER_HUBSPOT:
case SocialAccount::PROVIDER_OUTREACH:
case SocialAccount::PROVIDER_SALESLOFT:
case SocialAccount::PROVIDER_ZOOM_PHONE:
case SocialAccount::PROVIDER_PIPEDRIVE:
case SocialAccount::PROVIDER_SLACK:
case SocialAccount::PROVIDER_AIRCALL:
case SocialAccount::PROVIDER_BULLHORN:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_TELUS:
case SocialAccount::PROVIDER_DIALPAD:
case SocialAccount::PROVIDER_TALKDESK:
return $scopes;
case SocialAccount::PROVIDER_OFFICE:
return $scopes + [
'access_type' => 'offline',
];
case SocialAccount::PROVIDER_GOOGLE:
return $scopes + [
'access_type' => 'offline',
'include_granted_scopes' => 'true',
'approval_prompt' => null,
];
default:
throw new InvalidEnumException();
}
}
private function tokenDoesNotExpire(SocialAccount $account): bool
{
return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);
}
private function hasValidToken(SocialAccount $account): bool
{
return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();
}
private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void
{
Datadog::increment('jiminny.access_token', 1, [
'provider' => $account->getProviderName(),
'state' => $state,
'result' => $result,
]);
}
private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),
];
}
private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
try {
$parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);
$number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);
} catch (NumberParseException) {
$number = null;
}
// Todo: this should check the `organization_id` matches the parent crm configuration.
return [
'country_code' => $this->countryCode,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),
'phone' => $number,
'crm_provider_id' => $rawUserData['organization_id'],
'crm_base_url' => $this->vendorValues['instance_url'],
];
}
/**
* Todo: this should check the `getHubId` matches the parent crm configuration.
*/
private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $providerUser->getHubId(),
'crm_base_url' => $providerUser->toArray()['hub_domain'],
];
}
/**
* Todo: this should check the `getCompanyId` matches the parent crm configuration.
*/
private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $rawUserData['data']['company_id'],
'crm_base_url' => '[URL_WITH_CREDENTIALS] ActivityProviderException
*/
private function mapDialpadUserData(DialpadResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
// They need to be Super Admin to access the Company APIs.
$this->logger->info('[Dialpad] User authenticated', $rawUserData);
if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Dialpad Super Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapAircallUserData(AircallResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
/**
* @throws ActivityProviderException
*/
private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array
{
if ($providerUser->toArray()['data']['team_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Team Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapBullhornUserData(): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
];
}
private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
}
Execute
Explain Plan...
|
34481
|
NULL
|
NULL
|
NULL
|
|
34713
|
1299
|
6
|
2026-05-13T11:34:52.705495+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778672092705_m1.jpg...
|
PhpStorm
|
faVsco.js – SocialAccountService.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
namespace Jiminny\Services;
/**
* @todo cleanup after #slack-oauth-v2
*/
use AdamPaterson\OAuth2\Client\Provider\SlackResourceOwner;
use Chadhutchins\OAuth2\Client\Provider\Slack;
use ChaseConey\LaravelDatadogHelper\Datadog;
use Daniti\OAuth2\Client\Provider\Pipedrive;
use Daniti\OAuth2\Client\Provider\PipedriveResourceOwner;
use Exception;
use Flipbox\OAuth2\Client\Provider\HubSpot;
use Flipbox\OAuth2\Client\Provider\HubSpotResourceOwner;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Response;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Support\Facades\Cache;
use Jiminny\Component\Encryption\EncryptedTokenManager;
use Jiminny\Events\Users\CrmAccountReconnected;
use Jiminny\Events\Users\SocialAccountConnected;
use Jiminny\Events\Users\SocialAccountDisconnected;
use Jiminny\Exceptions\ActivityProviderException;
use Jiminny\Exceptions\InvalidEnumException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Models\Crm\Profile;
use Jiminny\Models\SocialAccount;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Notifications\SlackBotAdded;
use Jiminny\OAuth2\Client\Provider\Aircall;
use Jiminny\OAuth2\Client\Provider\AircallResourceOwner;
use Jiminny\OAuth2\Client\Provider\Bullhorn;
use Jiminny\OAuth2\Client\Provider\Dialpad;
use Jiminny\OAuth2\Client\Provider\DialpadResourceOwner;
use Jiminny\OAuth2\Client\Provider\Salesloft;
use Jiminny\OAuth2\Client\Provider\SalesloftResourceOwner;
use Jiminny\Services\Activity\Talkdesk\Provider\Talkdesk;
use Jiminny\Services\Activity\Talkdesk\Provider\TalkdeskResourceOwner;
use Jiminny\Services\Activity\Zoom\Provider\Zoom;
use Jiminny\Services\Activity\Zoom\Provider\ZoomResourceOwner;
use Jiminny\Services\OAuth2\Provider\BasicAuth;
use Jiminny\Services\OAuth2\Provider\Outreach;
use JsonException;
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\Google;
use League\OAuth2\Client\Provider\GoogleUser;
use League\OAuth2\Client\Provider\LinkedIn;
use League\OAuth2\Client\Provider\LinkedInResourceOwner;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Token\AccessTokenInterface;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberUtil;
use LogicException;
use Psr\Log\LoggerInterface;
use Random\RandomException;
use Stevenmaguire\OAuth2\Client\Provider\Salesforce;
use Stevenmaguire\OAuth2\Client\Provider\SalesforceResourceOwner;
use TheNetworg\OAuth2\Client\Provider\Azure;
use TheNetworg\OAuth2\Client\Provider\AzureResourceOwner;
use Throwable;
use TMannherz\OAuth2\Client\Provider\RingCentral;
use TMannherz\OAuth2\Client\Provider\RingcentralResourceOwner;
class SocialAccountService
{
/**
* Get a fresh tokens 5 minutes before it expires
* That should minimise the number of failed requests due to expired token
* for long-running jobs that reuse the same token for pulling lots of data.
*/
private const int REFRESH_OFFSET_MIN = 5;
private const string TOKEN_STATE_FETCH = 'fetch';
private const string TOKEN_STATE_REFRESH = 'refresh';
private const string TOKEN_RESULT_ATTEMPT = 'attempt';
private const string TOKEN_RESULT_SUCCESS = 'success';
private const string TOKEN_RESULT_FAILURE = 'failure';
private ?AccessTokenInterface $accessToken = null;
private ?string $token = null;
private ?string $refreshToken = null;
private ?int $expires = null;
private ?string $countryCode = null;
private ?string $timezone = null;
private ?array $vendorValues = null;
private ?int $refreshTokenExpires = null;
public function __construct(
private readonly EncryptedTokenManager $encryptedTokenManager,
private readonly LoggerInterface $logger,
private readonly PhoneNumberUtil $phoneNumberUtil,
private readonly Dispatcher $eventDispatcher,
) {
}
public function setVendorValues(array $values): void
{
$this->vendorValues = $values;
}
public function setAccessToken(AccessTokenInterface $accessToken): void
{
$this->accessToken = $accessToken;
// Todo: Also set these other params from this token e.g. refreshToken
}
public function setToken(?string $token): void
{
$this->token = $token;
}
public function setRefreshToken(?string $refreshToken): void
{
$this->refreshToken = $refreshToken;
}
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
public function setTimezone(string $timezone): void
{
$this->timezone = $timezone;
}
public function setExpires(?int $expiry): void
{
$this->expires = $expiry;
}
public function setRefreshTokenExpires(array $values): void
{
$this->refreshTokenExpires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
/**
* @throws InvalidEnumException
*/
public function getProvider(string $provider): AbstractProvider
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
return new LinkedIn(config('services.linkedin'));
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
$socialProvider = new LinkedIn(config('services.linkedin-conference'));
$socialProvider->withFields([
'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',
]);
return $socialProvider;
case SocialAccount::PROVIDER_SALESFORCE:
return new Salesforce(config('services.salesforce'));
case SocialAccount::PROVIDER_GOOGLE:
return new Google(config('services.google'));
case SocialAccount::PROVIDER_SLACK:
return new Slack(config('services.slack'));
case SocialAccount::PROVIDER_OFFICE:
$config = config('services.office');
// Convert string scope to array format expected by Azure provider
if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {
$config['scopes'] = array_filter(preg_split('/\s+/', trim($config['scope'])));
unset($config['scope']);
}
$socialProvider = new Azure($config);
$socialProvider->urlAPI = '[URL_WITH_CREDENTIALS] Exception
*/
public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
/** @var LinkedInResourceOwner $providerUser */
return $this->mapLinkedInUserData($providerUser);
case SocialAccount::PROVIDER_SALESFORCE:
/** @var SalesforceResourceOwner $providerUser */
return $this->mapSalesforceUserData($providerUser);
case SocialAccount::PROVIDER_HUBSPOT:
/** @var HubSpotResourceOwner $providerUser */
return $this->mapHubSpotUserData($providerUser);
case SocialAccount::PROVIDER_PIPEDRIVE:
/** @var PipedriveResourceOwner $providerUser */
return $this->mapPipedriveUserData($providerUser);
case SocialAccount::PROVIDER_GOOGLE:
/** @var GoogleUser $providerUser */
return $this->mapGoogleUserData($providerUser);
case SocialAccount::PROVIDER_SLACK:
/** @var SlackResourceOwner $providerUser */
return $this->mapSlackUserData($providerUser);
case SocialAccount::PROVIDER_OFFICE:
/** @var AzureResourceOwner $providerUser */
return $this->mapOfficeUserData($providerUser);
case SocialAccount::PROVIDER_OUTREACH:
return $this->mapOutreachUserData($providerUser);
case SocialAccount::PROVIDER_DIALPAD:
/** @var DialpadResourceOwner $providerUser*/
return $this->mapDialpadUserData($providerUser);
case SocialAccount::PROVIDER_AIRCALL:
/** @var AircallResourceOwner $providerUser */
return $this->mapAircallUserData($providerUser);
case SocialAccount::PROVIDER_ZOOM_PHONE:
/** @var ZoomResourceOwner $providerUser */
return $this->mapZoomPhoneUserData($providerUser);
case SocialAccount::PROVIDER_SALESLOFT:
/** @var SalesloftResourceOwner $providerUser */
return $this->mapSalesloftUserData($providerUser);
case SocialAccount::PROVIDER_BULLHORN:
return $this->mapBullhornUserData();
case SocialAccount::PROVIDER_TALKDESK:
/** @var TalkdeskResourceOwner $providerUser */
return $this->mapTalkdeskUserData($providerUser);
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_TELUS:
/** @var RingcentralResourceOwner $providerUser */
return $this->mapRingCentralUserData($providerUser);
default:
throw new InvalidEnumException('Unknown provider.');
}
}
/**
* Returns a new random string to use as the state parameter in an
* authorization flow.
*
* @param int $length Length of the random string to be generated.
*
* @throws RandomException
*/
public function getRandomState(int $length = 32): string
{
// Converting bytes to hex will always double length. Hence, we can reduce
// the amount of bytes by half to produce the correct length.
return bin2hex(random_bytes($length / 2));
}
private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount
{
return SocialAccount::where([
'provider' => $provider,
'provider_user_id' => $providerUser->getId(),
])->first();
}
/**
* Based on the provider data, try to match to a sociable entity based on email.
* If a match is made, create the social account under that entity.
*
* @throws AuthenticationException
*/
public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User
{
$account = $this->getAssociation($provider, $providerUser);
if ($account !== null && $account->hasUser()) {
return $account->getUser();
}
$userData = $this->mapUserData($provider, $providerUser);
// Check if we have an actual user with this email.
/** @var User|null $user */
$user = User::where('email', $userData['email'])->first();
// If the user is trying to connect to LinkedIn, don't allow this.
// Todo: have an interstitial page to perform 2FA to connect.
if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {
throw new AuthenticationException(
'Sorry, you\'ll need to login through your Jiminny account to access the Conference.',
);
}
return $user;
}
/**
* @throws JsonException
*/
public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount
{
/** @var SocialAccount $account */
$account = $user->socialAccounts()->firstOrNew([
'provider' => $provider,
]);
$account->fill([
'provider_user_id' => $providerUser->getId(),
'provider_user_token' => $this->token,
'expires' => $this->expires,
'state' => SocialAccount::STATE_CONNECTED,
'retry_after' => null,
]);
// This is an optional parameter, don't overwrite the existing one with null if we don't get it.
if ($this->refreshToken) {
$account->fill([
'provider_refresh_token' => $this->refreshToken,
'refresh_token_expires' => $this->refreshTokenExpires,
]);
}
if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {
$account->fill([
'auth_scope' => is_scalar($this->vendorValues['scope'])
? $this->vendorValues['scope']
: json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),
]);
} else {
$account->fill([
'auth_scope' => null,
]);
$this->logger->warning(
'[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',
// pulling directly from the token, just to avoid potential masking of the issue
['token_values' => $this->accessToken->getValues()],
);
}
$account->save();
// Association can be from an updated token so don't re-announce this.
if (
$account->wasRecentlyCreated
&& in_array($provider, SocialAccount::CRM_PROVIDERS, true)
&& $provider !== SocialAccount::PROVIDER_HUBSPOT
&& $providerUser->getId() !== null
) {
$crm = $user->team->crm;
$data = [
'crm_configuration_id' => $crm->id,
'log_notes' => Profile::LOG_NOTE_ENHANCED,
];
$crmProfile = $user->crmProfile()->where([
'crm_provider_id' => $providerUser->getId(),
])->first();
$user->crmProfile()->updateOrCreate([
'crm_provider_id' => $providerUser->getId(),
], $data);
// If updated, fire reconnected
if ($crmProfile !== null) {
$this->eventDispatcher->dispatch(new CrmAccountReconnected($account));
}
}
$this->eventDispatcher->dispatch(new SocialAccountConnected($account));
return $account;
}
public function integrate(string $provider, User $user, Team $team): void
{
if ($provider === SocialAccount::PROVIDER_SLACK) {
if (! isset($this->vendorValues['ok'])
|| $this->vendorValues['ok'] !== true
|| ! isset($this->vendorValues['token_type'])
|| $this->vendorValues['token_type'] !== 'bot'
) {
// code expects V2 token, which differs slightly from V1
throw new LogicException('Invalid token received from Slack OAuth v2 API');
}
$webhook = $this->vendorValues['incoming_webhook'];
$slackTeamId = $this->vendorValues['team']['id'];
$botData = [
'channel' => $webhook['channel'],
'channel_id' => $webhook['channel_id'],
'config_url' => $webhook['configuration_url'],
'webhook_url' => $webhook['url'],
'bot_user_id' => $this->vendorValues['bot_user_id'],
'bot_access_token' => $this->accessToken->getToken(),
];
$slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);
if ($slackBot->wasRecentlyCreated) {
// Send Slack notification.
$user->notify(new SlackBotAdded());
}
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);
$this->logger->info('[SocialAccountService] Fetching token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$account->refresh();
if (
! $forceRefresh
&& ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))
) {
$this->logger->info('[SocialAccountService] Token retrieved', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);
return $this->encryptedTokenManager->getAccessToken($account);
}
try {
$this->logger->info('[SocialAccountService] Token needs refreshing', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
return $this->refreshToken($account, $forceRefresh);
} catch (IdentityProviderException $exception) {
$responseBody = $exception->getResponseBody();
if ($responseBody instanceof Response) {
$responseBody = $responseBody->getBody();
}
if (is_object($responseBody) && method_exists($responseBody, '__toString')) {
$responseBody = $responseBody->__toString();
}
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'responseBody' => $responseBody,
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logger->error('[SocialAccountService] Cannot obtain token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception::class,
'errorMessage' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {
$this->logger->error('[SocialAccountService] Full refresh required', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
// Something terrible happened their token, they need to reconnect.
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
$this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));
}
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
}
}
public function refreshSocialAccountToken(SocialAccount $socialAccount): void
{
try {
$this->getToken($socialAccount);
} catch (Throwable $e) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $socialAccount->getId(),
'provider' => $socialAccount->getProviderName(),
'reason' => $e->getMessage(),
]);
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);
$newToken = null;
Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)
->block(8, function () use ($account, $forceRefresh, &$newToken): void {
try {
$account->refresh();
$token = $this->encryptedTokenManager->getAccessToken($account);
if (! $forceRefresh && $this->hasValidToken($account)) {
$newToken = $token;
return;
}
if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {
$this->logger->error('[SocialAccountService] Refresh token not found', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog(
$account,
self::TOKEN_STATE_REFRESH,
self::TOKEN_RESULT_FAILURE,
);
throw new SocialAccountTokenInvalidException(
'Refresh token is not set, re-connection required.',
);
}
$this->logger->info('[SocialAccountService] Refreshing token from provider', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),
'state' => $account->getState(),
]);
$newToken = $this->getProvider($account->provider)
->getAccessToken('refresh_token', [
'refresh_token' => $token->getRefreshToken(),
])
;
if ($newToken->getToken() === $token->getToken()) {
$this->logger->info('[SocialAccountService] Refreshed with an identical token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
}
} catch (ConnectException | RequestException $exception) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
// This usually occurs due to SSL errors.
throw new SocialAccountTokenInvalidException(
'Token could not be refreshed.',
$exception->getCode(),
$exception,
);
}
$account->provider_user_token = $newToken->getToken();
$account->expires = $newToken->getExpires();
$account->state = SocialAccount::STATE_CONNECTED;
if ($newToken->getRefreshToken()) {
$account->provider_refresh_token = $newToken->getRefreshToken();
$values = $newToken->getValues();
$account->refresh_token_expires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
$account->save();
});
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);
$this->logger->info('[SocialAccountService] Token refreshed', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'state' => $account->getState(),
]);
return $newToken;
}
/**
* @return string[]
*/
private function getAccessScope(string $provider): array
{
$scopes = [];
$providerScopes = config('services.' . $provider . '.scope');
if ($providerScopes) {
$scopes = preg_split('/\s+/', $providerScopes);
}
return $scopes;
}
/**
* @throws InvalidEnumException
*/
public function getAuthorizationOptions(string $provider): array
{
$scopes = ['scope' => $this->getAccessScope($provider)];
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
case SocialAccount::PROVIDER_SALESFORCE:
case SocialAccount::PROVIDER_HUBSPOT:
case SocialAccount::PROVIDER_OUTREACH:
case SocialAccount::PROVIDER_SALESLOFT:
case SocialAccount::PROVIDER_ZOOM_PHONE:
case SocialAccount::PROVIDER_PIPEDRIVE:
case SocialAccount::PROVIDER_SLACK:
case SocialAccount::PROVIDER_AIRCALL:
case SocialAccount::PROVIDER_BULLHORN:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_TELUS:
case SocialAccount::PROVIDER_DIALPAD:
case SocialAccount::PROVIDER_TALKDESK:
return $scopes;
case SocialAccount::PROVIDER_OFFICE:
return $scopes + [
'access_type' => 'offline',
];
case SocialAccount::PROVIDER_GOOGLE:
return $scopes + [
'access_type' => 'offline',
'include_granted_scopes' => 'true',
'approval_prompt' => null,
];
default:
throw new InvalidEnumException();
}
}
private function tokenDoesNotExpire(SocialAccount $account): bool
{
return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);
}
private function hasValidToken(SocialAccount $account): bool
{
return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();
}
private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void
{
Datadog::increment('jiminny.access_token', 1, [
'provider' => $account->getProviderName(),
'state' => $state,
'result' => $result,
]);
}
private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),
];
}
private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
try {
$parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);
$number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);
} catch (NumberParseException) {
$number = null;
}
// Todo: this should check the `organization_id` matches the parent crm configuration.
return [
'country_code' => $this->countryCode,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),
'phone' => $number,
'crm_provider_id' => $rawUserData['organization_id'],
'crm_base_url' => $this->vendorValues['instance_url'],
];
}
/**
* Todo: this should check the `getHubId` matches the parent crm configuration.
*/
private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $providerUser->getHubId(),
'crm_base_url' => $providerUser->toArray()['hub_domain'],
];
}
/**
* Todo: this should check the `getCompanyId` matches the parent crm configuration.
*/
private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $rawUserData['data']['company_id'],
'crm_base_url' => '[URL_WITH_CREDENTIALS] ActivityProviderException
*/
private function mapDialpadUserData(DialpadResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
// They need to be Super Admin to access the Company APIs.
$this->logger->info('[Dialpad] User authenticated', $rawUserData);
if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Dialpad Super Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapAircallUserData(AircallResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
/**
* @throws ActivityProviderException
*/
private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array
{
if ($providerUser->toArray()['data']['team_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Team Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapBullhornUserData(): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
];
}
private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
}...
|
[{"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":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","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":"AXTextArea","text":"<?php\n\nnamespace Jiminny\\Services;\n\n/**\n * @todo cleanup after #slack-oauth-v2\n */\n\nuse AdamPaterson\\OAuth2\\Client\\Provider\\SlackResourceOwner;\nuse Chadhutchins\\OAuth2\\Client\\Provider\\Slack;\nuse ChaseConey\\LaravelDatadogHelper\\Datadog;\nuse Daniti\\OAuth2\\Client\\Provider\\Pipedrive;\nuse Daniti\\OAuth2\\Client\\Provider\\PipedriveResourceOwner;\nuse Exception;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpot;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpotResourceOwner;\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Psr7\\Response;\nuse Illuminate\\Auth\\AuthenticationException;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Support\\Facades\\Cache;\nuse Jiminny\\Component\\Encryption\\EncryptedTokenManager;\nuse Jiminny\\Events\\Users\\CrmAccountReconnected;\nuse Jiminny\\Events\\Users\\SocialAccountConnected;\nuse Jiminny\\Events\\Users\\SocialAccountDisconnected;\nuse Jiminny\\Exceptions\\ActivityProviderException;\nuse Jiminny\\Exceptions\\InvalidEnumException;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Models\\SocialAccount;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Notifications\\SlackBotAdded;\nuse Jiminny\\OAuth2\\Client\\Provider\\Aircall;\nuse Jiminny\\OAuth2\\Client\\Provider\\AircallResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Bullhorn;\nuse Jiminny\\OAuth2\\Client\\Provider\\Dialpad;\nuse Jiminny\\OAuth2\\Client\\Provider\\DialpadResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Salesloft;\nuse Jiminny\\OAuth2\\Client\\Provider\\SalesloftResourceOwner;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\Talkdesk;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\TalkdeskResourceOwner;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\Zoom;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\ZoomResourceOwner;\nuse Jiminny\\Services\\OAuth2\\Provider\\BasicAuth;\nuse Jiminny\\Services\\OAuth2\\Provider\\Outreach;\nuse JsonException;\nuse League\\OAuth2\\Client\\OptionProvider\\HttpBasicAuthOptionProvider;\nuse League\\OAuth2\\Client\\Provider\\AbstractProvider;\nuse League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException;\nuse League\\OAuth2\\Client\\Provider\\Google;\nuse League\\OAuth2\\Client\\Provider\\GoogleUser;\nuse League\\OAuth2\\Client\\Provider\\LinkedIn;\nuse League\\OAuth2\\Client\\Provider\\LinkedInResourceOwner;\nuse League\\OAuth2\\Client\\Provider\\ResourceOwnerInterface;\nuse League\\OAuth2\\Client\\Token\\AccessToken;\nuse League\\OAuth2\\Client\\Token\\AccessTokenInterface;\nuse libphonenumber\\NumberParseException;\nuse libphonenumber\\PhoneNumberFormat;\nuse libphonenumber\\PhoneNumberUtil;\nuse LogicException;\nuse Psr\\Log\\LoggerInterface;\nuse Random\\RandomException;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\Salesforce;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\SalesforceResourceOwner;\nuse TheNetworg\\OAuth2\\Client\\Provider\\Azure;\nuse TheNetworg\\OAuth2\\Client\\Provider\\AzureResourceOwner;\nuse Throwable;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingCentral;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingcentralResourceOwner;\n\nclass SocialAccountService\n{\n /**\n * Get a fresh tokens 5 minutes before it expires\n * That should minimise the number of failed requests due to expired token\n * for long-running jobs that reuse the same token for pulling lots of data.\n */\n private const int REFRESH_OFFSET_MIN = 5;\n\n private const string TOKEN_STATE_FETCH = 'fetch';\n private const string TOKEN_STATE_REFRESH = 'refresh';\n private const string TOKEN_RESULT_ATTEMPT = 'attempt';\n private const string TOKEN_RESULT_SUCCESS = 'success';\n private const string TOKEN_RESULT_FAILURE = 'failure';\n\n private ?AccessTokenInterface $accessToken = null;\n private ?string $token = null;\n private ?string $refreshToken = null;\n private ?int $expires = null;\n private ?string $countryCode = null;\n private ?string $timezone = null;\n private ?array $vendorValues = null;\n\n private ?int $refreshTokenExpires = null;\n\n public function __construct(\n private readonly EncryptedTokenManager $encryptedTokenManager,\n private readonly LoggerInterface $logger,\n private readonly PhoneNumberUtil $phoneNumberUtil,\n private readonly Dispatcher $eventDispatcher,\n ) {\n }\n\n public function setVendorValues(array $values): void\n {\n $this->vendorValues = $values;\n }\n\n public function setAccessToken(AccessTokenInterface $accessToken): void\n {\n $this->accessToken = $accessToken;\n // Todo: Also set these other params from this token e.g. refreshToken\n }\n\n public function setToken(?string $token): void\n {\n $this->token = $token;\n }\n\n public function setRefreshToken(?string $refreshToken): void\n {\n $this->refreshToken = $refreshToken;\n }\n\n public function setCountryCode(string $countryCode): void\n {\n $this->countryCode = $countryCode;\n }\n\n public function setTimezone(string $timezone): void\n {\n $this->timezone = $timezone;\n }\n\n public function setExpires(?int $expiry): void\n {\n $this->expires = $expiry;\n }\n\n public function setRefreshTokenExpires(array $values): void\n {\n $this->refreshTokenExpires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getProvider(string $provider): AbstractProvider\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n return new LinkedIn(config('services.linkedin'));\n\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n $socialProvider = new LinkedIn(config('services.linkedin-conference'));\n $socialProvider->withFields([\n 'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',\n ]);\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_SALESFORCE:\n return new Salesforce(config('services.salesforce'));\n\n case SocialAccount::PROVIDER_GOOGLE:\n return new Google(config('services.google'));\n\n case SocialAccount::PROVIDER_SLACK:\n return new Slack(config('services.slack'));\n\n case SocialAccount::PROVIDER_OFFICE:\n $config = config('services.office');\n\n // Convert string scope to array format expected by Azure provider\n if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {\n $config['scopes'] = array_filter(preg_split('/\\s+/', trim($config['scope'])));\n unset($config['scope']);\n }\n\n $socialProvider = new Azure($config);\n $socialProvider->urlAPI = 'https://graph.microsoft.com/v1.0/';\n $socialProvider->API_VERSION = '1.0';\n $socialProvider->defaultEndPointVersion = Azure::ENDPOINT_VERSION_2_0;\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_HUBSPOT:\n return new HubSpot(config('services.hubspot'));\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n return new Pipedrive(config('services.pipedrive'));\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n return new Zoom(config('services.zoom-phone'));\n\n case SocialAccount::PROVIDER_OUTREACH:\n return new Outreach(config('services.outreach'));\n\n case SocialAccount::PROVIDER_SALESLOFT:\n return new Salesloft(config('services.salesloft'));\n\n case SocialAccount::PROVIDER_AIRCALL:\n return new Aircall(config('services.aircall'));\n\n case SocialAccount::PROVIDER_DIALPAD:\n return new Dialpad(config('services.dialpad'));\n\n case SocialAccount::PROVIDER_GONG:\n return new BasicAuth(config('services.gong'));\n\n case SocialAccount::PROVIDER_CLOSE:\n return new BasicAuth(config('services.close'));\n\n case SocialAccount::PROVIDER_AVAYA:\n // Avaya is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.avaya'));\n\n case SocialAccount::PROVIDER_TELUS:\n // Telus is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.telus'));\n\n case SocialAccount::PROVIDER_RINGCENTRAL:\n return new RingCentral(config('services.ringcentral'));\n\n case SocialAccount::PROVIDER_BULLHORN:\n return new Bullhorn(config('services.bullhorn'));\n\n case SocialAccount::PROVIDER_TALKDESK:\n return new Talkdesk(config('services.talkdesk'), [\n // Automatically concatenate Basic token to AuthToken requests\n 'optionProvider' => new HttpBasicAuthOptionProvider(),\n ]);\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n /**\n *\n *\n * @throws Exception\n */\n public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n /** @var LinkedInResourceOwner $providerUser */\n return $this->mapLinkedInUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESFORCE:\n /** @var SalesforceResourceOwner $providerUser */\n return $this->mapSalesforceUserData($providerUser);\n\n case SocialAccount::PROVIDER_HUBSPOT:\n /** @var HubSpotResourceOwner $providerUser */\n return $this->mapHubSpotUserData($providerUser);\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n /** @var PipedriveResourceOwner $providerUser */\n return $this->mapPipedriveUserData($providerUser);\n\n case SocialAccount::PROVIDER_GOOGLE:\n /** @var GoogleUser $providerUser */\n return $this->mapGoogleUserData($providerUser);\n\n case SocialAccount::PROVIDER_SLACK:\n /** @var SlackResourceOwner $providerUser */\n return $this->mapSlackUserData($providerUser);\n\n case SocialAccount::PROVIDER_OFFICE:\n /** @var AzureResourceOwner $providerUser */\n return $this->mapOfficeUserData($providerUser);\n\n case SocialAccount::PROVIDER_OUTREACH:\n return $this->mapOutreachUserData($providerUser);\n\n case SocialAccount::PROVIDER_DIALPAD:\n /** @var DialpadResourceOwner $providerUser*/\n return $this->mapDialpadUserData($providerUser);\n\n case SocialAccount::PROVIDER_AIRCALL:\n /** @var AircallResourceOwner $providerUser */\n return $this->mapAircallUserData($providerUser);\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n /** @var ZoomResourceOwner $providerUser */\n return $this->mapZoomPhoneUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESLOFT:\n /** @var SalesloftResourceOwner $providerUser */\n return $this->mapSalesloftUserData($providerUser);\n\n case SocialAccount::PROVIDER_BULLHORN:\n return $this->mapBullhornUserData();\n\n case SocialAccount::PROVIDER_TALKDESK:\n /** @var TalkdeskResourceOwner $providerUser */\n return $this->mapTalkdeskUserData($providerUser);\n\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_TELUS:\n /** @var RingcentralResourceOwner $providerUser */\n return $this->mapRingCentralUserData($providerUser);\n default:\n throw new InvalidEnumException('Unknown provider.');\n }\n }\n\n /**\n * Returns a new random string to use as the state parameter in an\n * authorization flow.\n *\n * @param int $length Length of the random string to be generated.\n *\n * @throws RandomException\n */\n public function getRandomState(int $length = 32): string\n {\n // Converting bytes to hex will always double length. Hence, we can reduce\n // the amount of bytes by half to produce the correct length.\n return bin2hex(random_bytes($length / 2));\n }\n\n private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount\n {\n return SocialAccount::where([\n 'provider' => $provider,\n 'provider_user_id' => $providerUser->getId(),\n ])->first();\n }\n\n /**\n * Based on the provider data, try to match to a sociable entity based on email.\n * If a match is made, create the social account under that entity.\n *\n * @throws AuthenticationException\n */\n public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User\n {\n $account = $this->getAssociation($provider, $providerUser);\n if ($account !== null && $account->hasUser()) {\n return $account->getUser();\n }\n $userData = $this->mapUserData($provider, $providerUser);\n\n // Check if we have an actual user with this email.\n /** @var User|null $user */\n $user = User::where('email', $userData['email'])->first();\n\n // If the user is trying to connect to LinkedIn, don't allow this.\n // Todo: have an interstitial page to perform 2FA to connect.\n if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {\n throw new AuthenticationException(\n 'Sorry, you\\'ll need to login through your Jiminny account to access the Conference.',\n );\n }\n\n return $user;\n }\n\n /**\n * @throws JsonException\n */\n public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount\n {\n /** @var SocialAccount $account */\n $account = $user->socialAccounts()->firstOrNew([\n 'provider' => $provider,\n ]);\n\n $account->fill([\n 'provider_user_id' => $providerUser->getId(),\n 'provider_user_token' => $this->token,\n 'expires' => $this->expires,\n 'state' => SocialAccount::STATE_CONNECTED,\n 'retry_after' => null,\n ]);\n\n // This is an optional parameter, don't overwrite the existing one with null if we don't get it.\n if ($this->refreshToken) {\n $account->fill([\n 'provider_refresh_token' => $this->refreshToken,\n 'refresh_token_expires' => $this->refreshTokenExpires,\n ]);\n }\n\n if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {\n $account->fill([\n 'auth_scope' => is_scalar($this->vendorValues['scope'])\n ? $this->vendorValues['scope']\n : json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),\n ]);\n } else {\n $account->fill([\n 'auth_scope' => null,\n ]);\n\n $this->logger->warning(\n '[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',\n // pulling directly from the token, just to avoid potential masking of the issue\n ['token_values' => $this->accessToken->getValues()],\n );\n }\n\n $account->save();\n\n // Association can be from an updated token so don't re-announce this.\n if (\n $account->wasRecentlyCreated\n && in_array($provider, SocialAccount::CRM_PROVIDERS, true)\n && $provider !== SocialAccount::PROVIDER_HUBSPOT\n && $providerUser->getId() !== null\n ) {\n $crm = $user->team->crm;\n $data = [\n 'crm_configuration_id' => $crm->id,\n 'log_notes' => Profile::LOG_NOTE_ENHANCED,\n ];\n\n $crmProfile = $user->crmProfile()->where([\n 'crm_provider_id' => $providerUser->getId(),\n ])->first();\n\n $user->crmProfile()->updateOrCreate([\n 'crm_provider_id' => $providerUser->getId(),\n ], $data);\n\n // If updated, fire reconnected\n if ($crmProfile !== null) {\n $this->eventDispatcher->dispatch(new CrmAccountReconnected($account));\n }\n }\n\n $this->eventDispatcher->dispatch(new SocialAccountConnected($account));\n\n return $account;\n }\n\n public function integrate(string $provider, User $user, Team $team): void\n {\n if ($provider === SocialAccount::PROVIDER_SLACK) {\n if (! isset($this->vendorValues['ok'])\n || $this->vendorValues['ok'] !== true\n || ! isset($this->vendorValues['token_type'])\n || $this->vendorValues['token_type'] !== 'bot'\n ) {\n // code expects V2 token, which differs slightly from V1\n throw new LogicException('Invalid token received from Slack OAuth v2 API');\n }\n\n $webhook = $this->vendorValues['incoming_webhook'];\n\n $slackTeamId = $this->vendorValues['team']['id'];\n\n $botData = [\n 'channel' => $webhook['channel'],\n 'channel_id' => $webhook['channel_id'],\n 'config_url' => $webhook['configuration_url'],\n 'webhook_url' => $webhook['url'],\n 'bot_user_id' => $this->vendorValues['bot_user_id'],\n 'bot_access_token' => $this->accessToken->getToken(),\n ];\n\n $slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);\n\n if ($slackBot->wasRecentlyCreated) {\n // Send Slack notification.\n $user->notify(new SlackBotAdded());\n }\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);\n\n $this->logger->info('[SocialAccountService] Fetching token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $account->refresh();\n\n if (\n ! $forceRefresh\n && ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))\n ) {\n $this->logger->info('[SocialAccountService] Token retrieved', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);\n\n return $this->encryptedTokenManager->getAccessToken($account);\n }\n\n try {\n $this->logger->info('[SocialAccountService] Token needs refreshing', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n return $this->refreshToken($account, $forceRefresh);\n } catch (IdentityProviderException $exception) {\n $responseBody = $exception->getResponseBody();\n\n if ($responseBody instanceof Response) {\n $responseBody = $responseBody->getBody();\n }\n\n if (is_object($responseBody) && method_exists($responseBody, '__toString')) {\n $responseBody = $responseBody->__toString();\n }\n\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'responseBody' => $responseBody,\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logger->error('[SocialAccountService] Cannot obtain token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception::class,\n 'errorMessage' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {\n $this->logger->error('[SocialAccountService] Full refresh required', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n // Something terrible happened their token, they need to reconnect.\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n $this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));\n }\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n }\n }\n\n public function refreshSocialAccountToken(SocialAccount $socialAccount): void\n {\n try {\n $this->getToken($socialAccount);\n } catch (Throwable $e) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $socialAccount->getId(),\n 'provider' => $socialAccount->getProviderName(),\n 'reason' => $e->getMessage(),\n ]);\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);\n\n $newToken = null;\n\n Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)\n ->block(8, function () use ($account, $forceRefresh, &$newToken): void {\n try {\n $account->refresh();\n $token = $this->encryptedTokenManager->getAccessToken($account);\n\n if (! $forceRefresh && $this->hasValidToken($account)) {\n $newToken = $token;\n\n return;\n }\n\n if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {\n $this->logger->error('[SocialAccountService] Refresh token not found', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog(\n $account,\n self::TOKEN_STATE_REFRESH,\n self::TOKEN_RESULT_FAILURE,\n );\n\n throw new SocialAccountTokenInvalidException(\n 'Refresh token is not set, re-connection required.',\n );\n }\n\n $this->logger->info('[SocialAccountService] Refreshing token from provider', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),\n 'state' => $account->getState(),\n ]);\n\n $newToken = $this->getProvider($account->provider)\n ->getAccessToken('refresh_token', [\n 'refresh_token' => $token->getRefreshToken(),\n ])\n ;\n\n if ($newToken->getToken() === $token->getToken()) {\n $this->logger->info('[SocialAccountService] Refreshed with an identical token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n }\n } catch (ConnectException | RequestException $exception) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n // This usually occurs due to SSL errors.\n throw new SocialAccountTokenInvalidException(\n 'Token could not be refreshed.',\n $exception->getCode(),\n $exception,\n );\n }\n\n $account->provider_user_token = $newToken->getToken();\n $account->expires = $newToken->getExpires();\n $account->state = SocialAccount::STATE_CONNECTED;\n\n if ($newToken->getRefreshToken()) {\n $account->provider_refresh_token = $newToken->getRefreshToken();\n $values = $newToken->getValues();\n $account->refresh_token_expires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n $account->save();\n });\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);\n\n $this->logger->info('[SocialAccountService] Token refreshed', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'state' => $account->getState(),\n ]);\n\n return $newToken;\n }\n\n /**\n * @return string[]\n */\n private function getAccessScope(string $provider): array\n {\n $scopes = [];\n $providerScopes = config('services.' . $provider . '.scope');\n\n if ($providerScopes) {\n $scopes = preg_split('/\\s+/', $providerScopes);\n }\n\n return $scopes;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getAuthorizationOptions(string $provider): array\n {\n $scopes = ['scope' => $this->getAccessScope($provider)];\n\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n case SocialAccount::PROVIDER_SALESFORCE:\n case SocialAccount::PROVIDER_HUBSPOT:\n case SocialAccount::PROVIDER_OUTREACH:\n case SocialAccount::PROVIDER_SALESLOFT:\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n case SocialAccount::PROVIDER_PIPEDRIVE:\n case SocialAccount::PROVIDER_SLACK:\n case SocialAccount::PROVIDER_AIRCALL:\n case SocialAccount::PROVIDER_BULLHORN:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_TELUS:\n case SocialAccount::PROVIDER_DIALPAD:\n case SocialAccount::PROVIDER_TALKDESK:\n return $scopes;\n\n case SocialAccount::PROVIDER_OFFICE:\n return $scopes + [\n 'access_type' => 'offline',\n ];\n\n case SocialAccount::PROVIDER_GOOGLE:\n return $scopes + [\n 'access_type' => 'offline',\n 'include_granted_scopes' => 'true',\n 'approval_prompt' => null,\n ];\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n private function tokenDoesNotExpire(SocialAccount $account): bool\n {\n return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);\n }\n\n private function hasValidToken(SocialAccount $account): bool\n {\n return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();\n }\n\n private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void\n {\n Datadog::increment('jiminny.access_token', 1, [\n 'provider' => $account->getProviderName(),\n 'state' => $state,\n 'result' => $result,\n ]);\n }\n\n private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),\n ];\n }\n\n private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n try {\n $parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);\n $number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);\n } catch (NumberParseException) {\n $number = null;\n }\n\n // Todo: this should check the `organization_id` matches the parent crm configuration.\n\n return [\n 'country_code' => $this->countryCode,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),\n 'phone' => $number,\n 'crm_provider_id' => $rawUserData['organization_id'],\n 'crm_base_url' => $this->vendorValues['instance_url'],\n ];\n }\n\n /**\n * Todo: this should check the `getHubId` matches the parent crm configuration.\n */\n private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array\n {\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $providerUser->getHubId(),\n 'crm_base_url' => $providerUser->toArray()['hub_domain'],\n ];\n }\n\n /**\n * Todo: this should check the `getCompanyId` matches the parent crm configuration.\n */\n private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $rawUserData['data']['company_id'],\n 'crm_base_url' => 'https://' . $rawUserData['data']['company_domain'] . '.pipedrive.com',\n ];\n }\n\n private function mapGoogleUserData(GoogleUser $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($providerUser->getEmail()),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapSlackUserData(SlackResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getRealName(),\n ];\n }\n\n private function mapOfficeUserData(AzureResourceOwner $providerUser): array\n {\n $email = $providerUser->getUpn() ?? $providerUser->claim('email');\n\n $this->logger->info('[Office] User authenticated', $providerUser->toArray());\n\n $name = $providerUser->claim('name') ??\n $providerUser->getFirstName() . ' ' . $providerUser->getLastName();\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($email),\n 'name' => $name,\n ];\n }\n\n private function mapOutreachUserData(ResourceOwnerInterface $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n $socialProvider = $this->getProvider(SocialAccount::PROVIDER_OUTREACH);\n $url = 'https://api.outreach.io/api/v2/profiles/';\n\n try {\n $request = $socialProvider->getAuthenticatedRequest(\n 'get',\n $url . $rawUserData['meta']['user']['id'],\n $this->accessToken,\n );\n\n $response = $socialProvider->getParsedResponse($request);\n\n $this->logger->info('[Outreach] User authenticated', $response);\n } catch (Exception) {\n //Just ignore\n }\n\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapDialpadUserData(DialpadResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n // They need to be Super Admin to access the Company APIs.\n $this->logger->info('[Dialpad] User authenticated', $rawUserData);\n\n if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Dialpad Super Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapAircallUserData(AircallResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array\n {\n if ($providerUser->toArray()['data']['team_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Team Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapBullhornUserData(): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n\n private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Services;\n\n/**\n * @todo cleanup after #slack-oauth-v2\n */\n\nuse AdamPaterson\\OAuth2\\Client\\Provider\\SlackResourceOwner;\nuse Chadhutchins\\OAuth2\\Client\\Provider\\Slack;\nuse ChaseConey\\LaravelDatadogHelper\\Datadog;\nuse Daniti\\OAuth2\\Client\\Provider\\Pipedrive;\nuse Daniti\\OAuth2\\Client\\Provider\\PipedriveResourceOwner;\nuse Exception;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpot;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpotResourceOwner;\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Psr7\\Response;\nuse Illuminate\\Auth\\AuthenticationException;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Support\\Facades\\Cache;\nuse Jiminny\\Component\\Encryption\\EncryptedTokenManager;\nuse Jiminny\\Events\\Users\\CrmAccountReconnected;\nuse Jiminny\\Events\\Users\\SocialAccountConnected;\nuse Jiminny\\Events\\Users\\SocialAccountDisconnected;\nuse Jiminny\\Exceptions\\ActivityProviderException;\nuse Jiminny\\Exceptions\\InvalidEnumException;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Models\\SocialAccount;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Notifications\\SlackBotAdded;\nuse Jiminny\\OAuth2\\Client\\Provider\\Aircall;\nuse Jiminny\\OAuth2\\Client\\Provider\\AircallResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Bullhorn;\nuse Jiminny\\OAuth2\\Client\\Provider\\Dialpad;\nuse Jiminny\\OAuth2\\Client\\Provider\\DialpadResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Salesloft;\nuse Jiminny\\OAuth2\\Client\\Provider\\SalesloftResourceOwner;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\Talkdesk;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\TalkdeskResourceOwner;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\Zoom;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\ZoomResourceOwner;\nuse Jiminny\\Services\\OAuth2\\Provider\\BasicAuth;\nuse Jiminny\\Services\\OAuth2\\Provider\\Outreach;\nuse JsonException;\nuse League\\OAuth2\\Client\\OptionProvider\\HttpBasicAuthOptionProvider;\nuse League\\OAuth2\\Client\\Provider\\AbstractProvider;\nuse League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException;\nuse League\\OAuth2\\Client\\Provider\\Google;\nuse League\\OAuth2\\Client\\Provider\\GoogleUser;\nuse League\\OAuth2\\Client\\Provider\\LinkedIn;\nuse League\\OAuth2\\Client\\Provider\\LinkedInResourceOwner;\nuse League\\OAuth2\\Client\\Provider\\ResourceOwnerInterface;\nuse League\\OAuth2\\Client\\Token\\AccessToken;\nuse League\\OAuth2\\Client\\Token\\AccessTokenInterface;\nuse libphonenumber\\NumberParseException;\nuse libphonenumber\\PhoneNumberFormat;\nuse libphonenumber\\PhoneNumberUtil;\nuse LogicException;\nuse Psr\\Log\\LoggerInterface;\nuse Random\\RandomException;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\Salesforce;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\SalesforceResourceOwner;\nuse TheNetworg\\OAuth2\\Client\\Provider\\Azure;\nuse TheNetworg\\OAuth2\\Client\\Provider\\AzureResourceOwner;\nuse Throwable;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingCentral;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingcentralResourceOwner;\n\nclass SocialAccountService\n{\n /**\n * Get a fresh tokens 5 minutes before it expires\n * That should minimise the number of failed requests due to expired token\n * for long-running jobs that reuse the same token for pulling lots of data.\n */\n private const int REFRESH_OFFSET_MIN = 5;\n\n private const string TOKEN_STATE_FETCH = 'fetch';\n private const string TOKEN_STATE_REFRESH = 'refresh';\n private const string TOKEN_RESULT_ATTEMPT = 'attempt';\n private const string TOKEN_RESULT_SUCCESS = 'success';\n private const string TOKEN_RESULT_FAILURE = 'failure';\n\n private ?AccessTokenInterface $accessToken = null;\n private ?string $token = null;\n private ?string $refreshToken = null;\n private ?int $expires = null;\n private ?string $countryCode = null;\n private ?string $timezone = null;\n private ?array $vendorValues = null;\n\n private ?int $refreshTokenExpires = null;\n\n public function __construct(\n private readonly EncryptedTokenManager $encryptedTokenManager,\n private readonly LoggerInterface $logger,\n private readonly PhoneNumberUtil $phoneNumberUtil,\n private readonly Dispatcher $eventDispatcher,\n ) {\n }\n\n public function setVendorValues(array $values): void\n {\n $this->vendorValues = $values;\n }\n\n public function setAccessToken(AccessTokenInterface $accessToken): void\n {\n $this->accessToken = $accessToken;\n // Todo: Also set these other params from this token e.g. refreshToken\n }\n\n public function setToken(?string $token): void\n {\n $this->token = $token;\n }\n\n public function setRefreshToken(?string $refreshToken): void\n {\n $this->refreshToken = $refreshToken;\n }\n\n public function setCountryCode(string $countryCode): void\n {\n $this->countryCode = $countryCode;\n }\n\n public function setTimezone(string $timezone): void\n {\n $this->timezone = $timezone;\n }\n\n public function setExpires(?int $expiry): void\n {\n $this->expires = $expiry;\n }\n\n public function setRefreshTokenExpires(array $values): void\n {\n $this->refreshTokenExpires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getProvider(string $provider): AbstractProvider\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n return new LinkedIn(config('services.linkedin'));\n\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n $socialProvider = new LinkedIn(config('services.linkedin-conference'));\n $socialProvider->withFields([\n 'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',\n ]);\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_SALESFORCE:\n return new Salesforce(config('services.salesforce'));\n\n case SocialAccount::PROVIDER_GOOGLE:\n return new Google(config('services.google'));\n\n case SocialAccount::PROVIDER_SLACK:\n return new Slack(config('services.slack'));\n\n case SocialAccount::PROVIDER_OFFICE:\n $config = config('services.office');\n\n // Convert string scope to array format expected by Azure provider\n if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {\n $config['scopes'] = array_filter(preg_split('/\\s+/', trim($config['scope'])));\n unset($config['scope']);\n }\n\n $socialProvider = new Azure($config);\n $socialProvider->urlAPI = 'https://graph.microsoft.com/v1.0/';\n $socialProvider->API_VERSION = '1.0';\n $socialProvider->defaultEndPointVersion = Azure::ENDPOINT_VERSION_2_0;\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_HUBSPOT:\n return new HubSpot(config('services.hubspot'));\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n return new Pipedrive(config('services.pipedrive'));\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n return new Zoom(config('services.zoom-phone'));\n\n case SocialAccount::PROVIDER_OUTREACH:\n return new Outreach(config('services.outreach'));\n\n case SocialAccount::PROVIDER_SALESLOFT:\n return new Salesloft(config('services.salesloft'));\n\n case SocialAccount::PROVIDER_AIRCALL:\n return new Aircall(config('services.aircall'));\n\n case SocialAccount::PROVIDER_DIALPAD:\n return new Dialpad(config('services.dialpad'));\n\n case SocialAccount::PROVIDER_GONG:\n return new BasicAuth(config('services.gong'));\n\n case SocialAccount::PROVIDER_CLOSE:\n return new BasicAuth(config('services.close'));\n\n case SocialAccount::PROVIDER_AVAYA:\n // Avaya is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.avaya'));\n\n case SocialAccount::PROVIDER_TELUS:\n // Telus is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.telus'));\n\n case SocialAccount::PROVIDER_RINGCENTRAL:\n return new RingCentral(config('services.ringcentral'));\n\n case SocialAccount::PROVIDER_BULLHORN:\n return new Bullhorn(config('services.bullhorn'));\n\n case SocialAccount::PROVIDER_TALKDESK:\n return new Talkdesk(config('services.talkdesk'), [\n // Automatically concatenate Basic token to AuthToken requests\n 'optionProvider' => new HttpBasicAuthOptionProvider(),\n ]);\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n /**\n *\n *\n * @throws Exception\n */\n public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n /** @var LinkedInResourceOwner $providerUser */\n return $this->mapLinkedInUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESFORCE:\n /** @var SalesforceResourceOwner $providerUser */\n return $this->mapSalesforceUserData($providerUser);\n\n case SocialAccount::PROVIDER_HUBSPOT:\n /** @var HubSpotResourceOwner $providerUser */\n return $this->mapHubSpotUserData($providerUser);\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n /** @var PipedriveResourceOwner $providerUser */\n return $this->mapPipedriveUserData($providerUser);\n\n case SocialAccount::PROVIDER_GOOGLE:\n /** @var GoogleUser $providerUser */\n return $this->mapGoogleUserData($providerUser);\n\n case SocialAccount::PROVIDER_SLACK:\n /** @var SlackResourceOwner $providerUser */\n return $this->mapSlackUserData($providerUser);\n\n case SocialAccount::PROVIDER_OFFICE:\n /** @var AzureResourceOwner $providerUser */\n return $this->mapOfficeUserData($providerUser);\n\n case SocialAccount::PROVIDER_OUTREACH:\n return $this->mapOutreachUserData($providerUser);\n\n case SocialAccount::PROVIDER_DIALPAD:\n /** @var DialpadResourceOwner $providerUser*/\n return $this->mapDialpadUserData($providerUser);\n\n case SocialAccount::PROVIDER_AIRCALL:\n /** @var AircallResourceOwner $providerUser */\n return $this->mapAircallUserData($providerUser);\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n /** @var ZoomResourceOwner $providerUser */\n return $this->mapZoomPhoneUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESLOFT:\n /** @var SalesloftResourceOwner $providerUser */\n return $this->mapSalesloftUserData($providerUser);\n\n case SocialAccount::PROVIDER_BULLHORN:\n return $this->mapBullhornUserData();\n\n case SocialAccount::PROVIDER_TALKDESK:\n /** @var TalkdeskResourceOwner $providerUser */\n return $this->mapTalkdeskUserData($providerUser);\n\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_TELUS:\n /** @var RingcentralResourceOwner $providerUser */\n return $this->mapRingCentralUserData($providerUser);\n default:\n throw new InvalidEnumException('Unknown provider.');\n }\n }\n\n /**\n * Returns a new random string to use as the state parameter in an\n * authorization flow.\n *\n * @param int $length Length of the random string to be generated.\n *\n * @throws RandomException\n */\n public function getRandomState(int $length = 32): string\n {\n // Converting bytes to hex will always double length. Hence, we can reduce\n // the amount of bytes by half to produce the correct length.\n return bin2hex(random_bytes($length / 2));\n }\n\n private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount\n {\n return SocialAccount::where([\n 'provider' => $provider,\n 'provider_user_id' => $providerUser->getId(),\n ])->first();\n }\n\n /**\n * Based on the provider data, try to match to a sociable entity based on email.\n * If a match is made, create the social account under that entity.\n *\n * @throws AuthenticationException\n */\n public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User\n {\n $account = $this->getAssociation($provider, $providerUser);\n if ($account !== null && $account->hasUser()) {\n return $account->getUser();\n }\n $userData = $this->mapUserData($provider, $providerUser);\n\n // Check if we have an actual user with this email.\n /** @var User|null $user */\n $user = User::where('email', $userData['email'])->first();\n\n // If the user is trying to connect to LinkedIn, don't allow this.\n // Todo: have an interstitial page to perform 2FA to connect.\n if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {\n throw new AuthenticationException(\n 'Sorry, you\\'ll need to login through your Jiminny account to access the Conference.',\n );\n }\n\n return $user;\n }\n\n /**\n * @throws JsonException\n */\n public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount\n {\n /** @var SocialAccount $account */\n $account = $user->socialAccounts()->firstOrNew([\n 'provider' => $provider,\n ]);\n\n $account->fill([\n 'provider_user_id' => $providerUser->getId(),\n 'provider_user_token' => $this->token,\n 'expires' => $this->expires,\n 'state' => SocialAccount::STATE_CONNECTED,\n 'retry_after' => null,\n ]);\n\n // This is an optional parameter, don't overwrite the existing one with null if we don't get it.\n if ($this->refreshToken) {\n $account->fill([\n 'provider_refresh_token' => $this->refreshToken,\n 'refresh_token_expires' => $this->refreshTokenExpires,\n ]);\n }\n\n if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {\n $account->fill([\n 'auth_scope' => is_scalar($this->vendorValues['scope'])\n ? $this->vendorValues['scope']\n : json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),\n ]);\n } else {\n $account->fill([\n 'auth_scope' => null,\n ]);\n\n $this->logger->warning(\n '[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',\n // pulling directly from the token, just to avoid potential masking of the issue\n ['token_values' => $this->accessToken->getValues()],\n );\n }\n\n $account->save();\n\n // Association can be from an updated token so don't re-announce this.\n if (\n $account->wasRecentlyCreated\n && in_array($provider, SocialAccount::CRM_PROVIDERS, true)\n && $provider !== SocialAccount::PROVIDER_HUBSPOT\n && $providerUser->getId() !== null\n ) {\n $crm = $user->team->crm;\n $data = [\n 'crm_configuration_id' => $crm->id,\n 'log_notes' => Profile::LOG_NOTE_ENHANCED,\n ];\n\n $crmProfile = $user->crmProfile()->where([\n 'crm_provider_id' => $providerUser->getId(),\n ])->first();\n\n $user->crmProfile()->updateOrCreate([\n 'crm_provider_id' => $providerUser->getId(),\n ], $data);\n\n // If updated, fire reconnected\n if ($crmProfile !== null) {\n $this->eventDispatcher->dispatch(new CrmAccountReconnected($account));\n }\n }\n\n $this->eventDispatcher->dispatch(new SocialAccountConnected($account));\n\n return $account;\n }\n\n public function integrate(string $provider, User $user, Team $team): void\n {\n if ($provider === SocialAccount::PROVIDER_SLACK) {\n if (! isset($this->vendorValues['ok'])\n || $this->vendorValues['ok'] !== true\n || ! isset($this->vendorValues['token_type'])\n || $this->vendorValues['token_type'] !== 'bot'\n ) {\n // code expects V2 token, which differs slightly from V1\n throw new LogicException('Invalid token received from Slack OAuth v2 API');\n }\n\n $webhook = $this->vendorValues['incoming_webhook'];\n\n $slackTeamId = $this->vendorValues['team']['id'];\n\n $botData = [\n 'channel' => $webhook['channel'],\n 'channel_id' => $webhook['channel_id'],\n 'config_url' => $webhook['configuration_url'],\n 'webhook_url' => $webhook['url'],\n 'bot_user_id' => $this->vendorValues['bot_user_id'],\n 'bot_access_token' => $this->accessToken->getToken(),\n ];\n\n $slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);\n\n if ($slackBot->wasRecentlyCreated) {\n // Send Slack notification.\n $user->notify(new SlackBotAdded());\n }\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);\n\n $this->logger->info('[SocialAccountService] Fetching token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $account->refresh();\n\n if (\n ! $forceRefresh\n && ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))\n ) {\n $this->logger->info('[SocialAccountService] Token retrieved', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);\n\n return $this->encryptedTokenManager->getAccessToken($account);\n }\n\n try {\n $this->logger->info('[SocialAccountService] Token needs refreshing', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n return $this->refreshToken($account, $forceRefresh);\n } catch (IdentityProviderException $exception) {\n $responseBody = $exception->getResponseBody();\n\n if ($responseBody instanceof Response) {\n $responseBody = $responseBody->getBody();\n }\n\n if (is_object($responseBody) && method_exists($responseBody, '__toString')) {\n $responseBody = $responseBody->__toString();\n }\n\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'responseBody' => $responseBody,\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logger->error('[SocialAccountService] Cannot obtain token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception::class,\n 'errorMessage' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {\n $this->logger->error('[SocialAccountService] Full refresh required', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n // Something terrible happened their token, they need to reconnect.\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n $this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));\n }\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n }\n }\n\n public function refreshSocialAccountToken(SocialAccount $socialAccount): void\n {\n try {\n $this->getToken($socialAccount);\n } catch (Throwable $e) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $socialAccount->getId(),\n 'provider' => $socialAccount->getProviderName(),\n 'reason' => $e->getMessage(),\n ]);\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);\n\n $newToken = null;\n\n Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)\n ->block(8, function () use ($account, $forceRefresh, &$newToken): void {\n try {\n $account->refresh();\n $token = $this->encryptedTokenManager->getAccessToken($account);\n\n if (! $forceRefresh && $this->hasValidToken($account)) {\n $newToken = $token;\n\n return;\n }\n\n if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {\n $this->logger->error('[SocialAccountService] Refresh token not found', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog(\n $account,\n self::TOKEN_STATE_REFRESH,\n self::TOKEN_RESULT_FAILURE,\n );\n\n throw new SocialAccountTokenInvalidException(\n 'Refresh token is not set, re-connection required.',\n );\n }\n\n $this->logger->info('[SocialAccountService] Refreshing token from provider', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),\n 'state' => $account->getState(),\n ]);\n\n $newToken = $this->getProvider($account->provider)\n ->getAccessToken('refresh_token', [\n 'refresh_token' => $token->getRefreshToken(),\n ])\n ;\n\n if ($newToken->getToken() === $token->getToken()) {\n $this->logger->info('[SocialAccountService] Refreshed with an identical token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n }\n } catch (ConnectException | RequestException $exception) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n // This usually occurs due to SSL errors.\n throw new SocialAccountTokenInvalidException(\n 'Token could not be refreshed.',\n $exception->getCode(),\n $exception,\n );\n }\n\n $account->provider_user_token = $newToken->getToken();\n $account->expires = $newToken->getExpires();\n $account->state = SocialAccount::STATE_CONNECTED;\n\n if ($newToken->getRefreshToken()) {\n $account->provider_refresh_token = $newToken->getRefreshToken();\n $values = $newToken->getValues();\n $account->refresh_token_expires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n $account->save();\n });\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);\n\n $this->logger->info('[SocialAccountService] Token refreshed', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'state' => $account->getState(),\n ]);\n\n return $newToken;\n }\n\n /**\n * @return string[]\n */\n private function getAccessScope(string $provider): array\n {\n $scopes = [];\n $providerScopes = config('services.' . $provider . '.scope');\n\n if ($providerScopes) {\n $scopes = preg_split('/\\s+/', $providerScopes);\n }\n\n return $scopes;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getAuthorizationOptions(string $provider): array\n {\n $scopes = ['scope' => $this->getAccessScope($provider)];\n\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n case SocialAccount::PROVIDER_SALESFORCE:\n case SocialAccount::PROVIDER_HUBSPOT:\n case SocialAccount::PROVIDER_OUTREACH:\n case SocialAccount::PROVIDER_SALESLOFT:\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n case SocialAccount::PROVIDER_PIPEDRIVE:\n case SocialAccount::PROVIDER_SLACK:\n case SocialAccount::PROVIDER_AIRCALL:\n case SocialAccount::PROVIDER_BULLHORN:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_TELUS:\n case SocialAccount::PROVIDER_DIALPAD:\n case SocialAccount::PROVIDER_TALKDESK:\n return $scopes;\n\n case SocialAccount::PROVIDER_OFFICE:\n return $scopes + [\n 'access_type' => 'offline',\n ];\n\n case SocialAccount::PROVIDER_GOOGLE:\n return $scopes + [\n 'access_type' => 'offline',\n 'include_granted_scopes' => 'true',\n 'approval_prompt' => null,\n ];\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n private function tokenDoesNotExpire(SocialAccount $account): bool\n {\n return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);\n }\n\n private function hasValidToken(SocialAccount $account): bool\n {\n return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();\n }\n\n private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void\n {\n Datadog::increment('jiminny.access_token', 1, [\n 'provider' => $account->getProviderName(),\n 'state' => $state,\n 'result' => $result,\n ]);\n }\n\n private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),\n ];\n }\n\n private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n try {\n $parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);\n $number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);\n } catch (NumberParseException) {\n $number = null;\n }\n\n // Todo: this should check the `organization_id` matches the parent crm configuration.\n\n return [\n 'country_code' => $this->countryCode,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),\n 'phone' => $number,\n 'crm_provider_id' => $rawUserData['organization_id'],\n 'crm_base_url' => $this->vendorValues['instance_url'],\n ];\n }\n\n /**\n * Todo: this should check the `getHubId` matches the parent crm configuration.\n */\n private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array\n {\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $providerUser->getHubId(),\n 'crm_base_url' => $providerUser->toArray()['hub_domain'],\n ];\n }\n\n /**\n * Todo: this should check the `getCompanyId` matches the parent crm configuration.\n */\n private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $rawUserData['data']['company_id'],\n 'crm_base_url' => 'https://' . $rawUserData['data']['company_domain'] . '.pipedrive.com',\n ];\n }\n\n private function mapGoogleUserData(GoogleUser $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($providerUser->getEmail()),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapSlackUserData(SlackResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getRealName(),\n ];\n }\n\n private function mapOfficeUserData(AzureResourceOwner $providerUser): array\n {\n $email = $providerUser->getUpn() ?? $providerUser->claim('email');\n\n $this->logger->info('[Office] User authenticated', $providerUser->toArray());\n\n $name = $providerUser->claim('name') ??\n $providerUser->getFirstName() . ' ' . $providerUser->getLastName();\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($email),\n 'name' => $name,\n ];\n }\n\n private function mapOutreachUserData(ResourceOwnerInterface $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n $socialProvider = $this->getProvider(SocialAccount::PROVIDER_OUTREACH);\n $url = 'https://api.outreach.io/api/v2/profiles/';\n\n try {\n $request = $socialProvider->getAuthenticatedRequest(\n 'get',\n $url . $rawUserData['meta']['user']['id'],\n $this->accessToken,\n );\n\n $response = $socialProvider->getParsedResponse($request);\n\n $this->logger->info('[Outreach] User authenticated', $response);\n } catch (Exception) {\n //Just ignore\n }\n\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapDialpadUserData(DialpadResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n // They need to be Super Admin to access the Company APIs.\n $this->logger->info('[Dialpad] User authenticated', $rawUserData);\n\n if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Dialpad Super Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapAircallUserData(AircallResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array\n {\n if ($providerUser->toArray()['data']['team_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Team Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapBullhornUserData(): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n\n private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
-1193490926271754211
|
-8880471945877483717
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
namespace Jiminny\Services;
/**
* @todo cleanup after #slack-oauth-v2
*/
use AdamPaterson\OAuth2\Client\Provider\SlackResourceOwner;
use Chadhutchins\OAuth2\Client\Provider\Slack;
use ChaseConey\LaravelDatadogHelper\Datadog;
use Daniti\OAuth2\Client\Provider\Pipedrive;
use Daniti\OAuth2\Client\Provider\PipedriveResourceOwner;
use Exception;
use Flipbox\OAuth2\Client\Provider\HubSpot;
use Flipbox\OAuth2\Client\Provider\HubSpotResourceOwner;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Response;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Support\Facades\Cache;
use Jiminny\Component\Encryption\EncryptedTokenManager;
use Jiminny\Events\Users\CrmAccountReconnected;
use Jiminny\Events\Users\SocialAccountConnected;
use Jiminny\Events\Users\SocialAccountDisconnected;
use Jiminny\Exceptions\ActivityProviderException;
use Jiminny\Exceptions\InvalidEnumException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Models\Crm\Profile;
use Jiminny\Models\SocialAccount;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Notifications\SlackBotAdded;
use Jiminny\OAuth2\Client\Provider\Aircall;
use Jiminny\OAuth2\Client\Provider\AircallResourceOwner;
use Jiminny\OAuth2\Client\Provider\Bullhorn;
use Jiminny\OAuth2\Client\Provider\Dialpad;
use Jiminny\OAuth2\Client\Provider\DialpadResourceOwner;
use Jiminny\OAuth2\Client\Provider\Salesloft;
use Jiminny\OAuth2\Client\Provider\SalesloftResourceOwner;
use Jiminny\Services\Activity\Talkdesk\Provider\Talkdesk;
use Jiminny\Services\Activity\Talkdesk\Provider\TalkdeskResourceOwner;
use Jiminny\Services\Activity\Zoom\Provider\Zoom;
use Jiminny\Services\Activity\Zoom\Provider\ZoomResourceOwner;
use Jiminny\Services\OAuth2\Provider\BasicAuth;
use Jiminny\Services\OAuth2\Provider\Outreach;
use JsonException;
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\Google;
use League\OAuth2\Client\Provider\GoogleUser;
use League\OAuth2\Client\Provider\LinkedIn;
use League\OAuth2\Client\Provider\LinkedInResourceOwner;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Token\AccessTokenInterface;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberUtil;
use LogicException;
use Psr\Log\LoggerInterface;
use Random\RandomException;
use Stevenmaguire\OAuth2\Client\Provider\Salesforce;
use Stevenmaguire\OAuth2\Client\Provider\SalesforceResourceOwner;
use TheNetworg\OAuth2\Client\Provider\Azure;
use TheNetworg\OAuth2\Client\Provider\AzureResourceOwner;
use Throwable;
use TMannherz\OAuth2\Client\Provider\RingCentral;
use TMannherz\OAuth2\Client\Provider\RingcentralResourceOwner;
class SocialAccountService
{
/**
* Get a fresh tokens 5 minutes before it expires
* That should minimise the number of failed requests due to expired token
* for long-running jobs that reuse the same token for pulling lots of data.
*/
private const int REFRESH_OFFSET_MIN = 5;
private const string TOKEN_STATE_FETCH = 'fetch';
private const string TOKEN_STATE_REFRESH = 'refresh';
private const string TOKEN_RESULT_ATTEMPT = 'attempt';
private const string TOKEN_RESULT_SUCCESS = 'success';
private const string TOKEN_RESULT_FAILURE = 'failure';
private ?AccessTokenInterface $accessToken = null;
private ?string $token = null;
private ?string $refreshToken = null;
private ?int $expires = null;
private ?string $countryCode = null;
private ?string $timezone = null;
private ?array $vendorValues = null;
private ?int $refreshTokenExpires = null;
public function __construct(
private readonly EncryptedTokenManager $encryptedTokenManager,
private readonly LoggerInterface $logger,
private readonly PhoneNumberUtil $phoneNumberUtil,
private readonly Dispatcher $eventDispatcher,
) {
}
public function setVendorValues(array $values): void
{
$this->vendorValues = $values;
}
public function setAccessToken(AccessTokenInterface $accessToken): void
{
$this->accessToken = $accessToken;
// Todo: Also set these other params from this token e.g. refreshToken
}
public function setToken(?string $token): void
{
$this->token = $token;
}
public function setRefreshToken(?string $refreshToken): void
{
$this->refreshToken = $refreshToken;
}
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
public function setTimezone(string $timezone): void
{
$this->timezone = $timezone;
}
public function setExpires(?int $expiry): void
{
$this->expires = $expiry;
}
public function setRefreshTokenExpires(array $values): void
{
$this->refreshTokenExpires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
/**
* @throws InvalidEnumException
*/
public function getProvider(string $provider): AbstractProvider
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
return new LinkedIn(config('services.linkedin'));
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
$socialProvider = new LinkedIn(config('services.linkedin-conference'));
$socialProvider->withFields([
'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',
]);
return $socialProvider;
case SocialAccount::PROVIDER_SALESFORCE:
return new Salesforce(config('services.salesforce'));
case SocialAccount::PROVIDER_GOOGLE:
return new Google(config('services.google'));
case SocialAccount::PROVIDER_SLACK:
return new Slack(config('services.slack'));
case SocialAccount::PROVIDER_OFFICE:
$config = config('services.office');
// Convert string scope to array format expected by Azure provider
if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {
$config['scopes'] = array_filter(preg_split('/\s+/', trim($config['scope'])));
unset($config['scope']);
}
$socialProvider = new Azure($config);
$socialProvider->urlAPI = '[URL_WITH_CREDENTIALS] Exception
*/
public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
/** @var LinkedInResourceOwner $providerUser */
return $this->mapLinkedInUserData($providerUser);
case SocialAccount::PROVIDER_SALESFORCE:
/** @var SalesforceResourceOwner $providerUser */
return $this->mapSalesforceUserData($providerUser);
case SocialAccount::PROVIDER_HUBSPOT:
/** @var HubSpotResourceOwner $providerUser */
return $this->mapHubSpotUserData($providerUser);
case SocialAccount::PROVIDER_PIPEDRIVE:
/** @var PipedriveResourceOwner $providerUser */
return $this->mapPipedriveUserData($providerUser);
case SocialAccount::PROVIDER_GOOGLE:
/** @var GoogleUser $providerUser */
return $this->mapGoogleUserData($providerUser);
case SocialAccount::PROVIDER_SLACK:
/** @var SlackResourceOwner $providerUser */
return $this->mapSlackUserData($providerUser);
case SocialAccount::PROVIDER_OFFICE:
/** @var AzureResourceOwner $providerUser */
return $this->mapOfficeUserData($providerUser);
case SocialAccount::PROVIDER_OUTREACH:
return $this->mapOutreachUserData($providerUser);
case SocialAccount::PROVIDER_DIALPAD:
/** @var DialpadResourceOwner $providerUser*/
return $this->mapDialpadUserData($providerUser);
case SocialAccount::PROVIDER_AIRCALL:
/** @var AircallResourceOwner $providerUser */
return $this->mapAircallUserData($providerUser);
case SocialAccount::PROVIDER_ZOOM_PHONE:
/** @var ZoomResourceOwner $providerUser */
return $this->mapZoomPhoneUserData($providerUser);
case SocialAccount::PROVIDER_SALESLOFT:
/** @var SalesloftResourceOwner $providerUser */
return $this->mapSalesloftUserData($providerUser);
case SocialAccount::PROVIDER_BULLHORN:
return $this->mapBullhornUserData();
case SocialAccount::PROVIDER_TALKDESK:
/** @var TalkdeskResourceOwner $providerUser */
return $this->mapTalkdeskUserData($providerUser);
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_TELUS:
/** @var RingcentralResourceOwner $providerUser */
return $this->mapRingCentralUserData($providerUser);
default:
throw new InvalidEnumException('Unknown provider.');
}
}
/**
* Returns a new random string to use as the state parameter in an
* authorization flow.
*
* @param int $length Length of the random string to be generated.
*
* @throws RandomException
*/
public function getRandomState(int $length = 32): string
{
// Converting bytes to hex will always double length. Hence, we can reduce
// the amount of bytes by half to produce the correct length.
return bin2hex(random_bytes($length / 2));
}
private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount
{
return SocialAccount::where([
'provider' => $provider,
'provider_user_id' => $providerUser->getId(),
])->first();
}
/**
* Based on the provider data, try to match to a sociable entity based on email.
* If a match is made, create the social account under that entity.
*
* @throws AuthenticationException
*/
public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User
{
$account = $this->getAssociation($provider, $providerUser);
if ($account !== null && $account->hasUser()) {
return $account->getUser();
}
$userData = $this->mapUserData($provider, $providerUser);
// Check if we have an actual user with this email.
/** @var User|null $user */
$user = User::where('email', $userData['email'])->first();
// If the user is trying to connect to LinkedIn, don't allow this.
// Todo: have an interstitial page to perform 2FA to connect.
if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {
throw new AuthenticationException(
'Sorry, you\'ll need to login through your Jiminny account to access the Conference.',
);
}
return $user;
}
/**
* @throws JsonException
*/
public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount
{
/** @var SocialAccount $account */
$account = $user->socialAccounts()->firstOrNew([
'provider' => $provider,
]);
$account->fill([
'provider_user_id' => $providerUser->getId(),
'provider_user_token' => $this->token,
'expires' => $this->expires,
'state' => SocialAccount::STATE_CONNECTED,
'retry_after' => null,
]);
// This is an optional parameter, don't overwrite the existing one with null if we don't get it.
if ($this->refreshToken) {
$account->fill([
'provider_refresh_token' => $this->refreshToken,
'refresh_token_expires' => $this->refreshTokenExpires,
]);
}
if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {
$account->fill([
'auth_scope' => is_scalar($this->vendorValues['scope'])
? $this->vendorValues['scope']
: json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),
]);
} else {
$account->fill([
'auth_scope' => null,
]);
$this->logger->warning(
'[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',
// pulling directly from the token, just to avoid potential masking of the issue
['token_values' => $this->accessToken->getValues()],
);
}
$account->save();
// Association can be from an updated token so don't re-announce this.
if (
$account->wasRecentlyCreated
&& in_array($provider, SocialAccount::CRM_PROVIDERS, true)
&& $provider !== SocialAccount::PROVIDER_HUBSPOT
&& $providerUser->getId() !== null
) {
$crm = $user->team->crm;
$data = [
'crm_configuration_id' => $crm->id,
'log_notes' => Profile::LOG_NOTE_ENHANCED,
];
$crmProfile = $user->crmProfile()->where([
'crm_provider_id' => $providerUser->getId(),
])->first();
$user->crmProfile()->updateOrCreate([
'crm_provider_id' => $providerUser->getId(),
], $data);
// If updated, fire reconnected
if ($crmProfile !== null) {
$this->eventDispatcher->dispatch(new CrmAccountReconnected($account));
}
}
$this->eventDispatcher->dispatch(new SocialAccountConnected($account));
return $account;
}
public function integrate(string $provider, User $user, Team $team): void
{
if ($provider === SocialAccount::PROVIDER_SLACK) {
if (! isset($this->vendorValues['ok'])
|| $this->vendorValues['ok'] !== true
|| ! isset($this->vendorValues['token_type'])
|| $this->vendorValues['token_type'] !== 'bot'
) {
// code expects V2 token, which differs slightly from V1
throw new LogicException('Invalid token received from Slack OAuth v2 API');
}
$webhook = $this->vendorValues['incoming_webhook'];
$slackTeamId = $this->vendorValues['team']['id'];
$botData = [
'channel' => $webhook['channel'],
'channel_id' => $webhook['channel_id'],
'config_url' => $webhook['configuration_url'],
'webhook_url' => $webhook['url'],
'bot_user_id' => $this->vendorValues['bot_user_id'],
'bot_access_token' => $this->accessToken->getToken(),
];
$slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);
if ($slackBot->wasRecentlyCreated) {
// Send Slack notification.
$user->notify(new SlackBotAdded());
}
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);
$this->logger->info('[SocialAccountService] Fetching token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$account->refresh();
if (
! $forceRefresh
&& ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))
) {
$this->logger->info('[SocialAccountService] Token retrieved', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);
return $this->encryptedTokenManager->getAccessToken($account);
}
try {
$this->logger->info('[SocialAccountService] Token needs refreshing', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
return $this->refreshToken($account, $forceRefresh);
} catch (IdentityProviderException $exception) {
$responseBody = $exception->getResponseBody();
if ($responseBody instanceof Response) {
$responseBody = $responseBody->getBody();
}
if (is_object($responseBody) && method_exists($responseBody, '__toString')) {
$responseBody = $responseBody->__toString();
}
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'responseBody' => $responseBody,
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logger->error('[SocialAccountService] Cannot obtain token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception::class,
'errorMessage' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {
$this->logger->error('[SocialAccountService] Full refresh required', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
// Something terrible happened their token, they need to reconnect.
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
$this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));
}
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
}
}
public function refreshSocialAccountToken(SocialAccount $socialAccount): void
{
try {
$this->getToken($socialAccount);
} catch (Throwable $e) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $socialAccount->getId(),
'provider' => $socialAccount->getProviderName(),
'reason' => $e->getMessage(),
]);
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);
$newToken = null;
Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)
->block(8, function () use ($account, $forceRefresh, &$newToken): void {
try {
$account->refresh();
$token = $this->encryptedTokenManager->getAccessToken($account);
if (! $forceRefresh && $this->hasValidToken($account)) {
$newToken = $token;
return;
}
if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {
$this->logger->error('[SocialAccountService] Refresh token not found', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog(
$account,
self::TOKEN_STATE_REFRESH,
self::TOKEN_RESULT_FAILURE,
);
throw new SocialAccountTokenInvalidException(
'Refresh token is not set, re-connection required.',
);
}
$this->logger->info('[SocialAccountService] Refreshing token from provider', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),
'state' => $account->getState(),
]);
$newToken = $this->getProvider($account->provider)
->getAccessToken('refresh_token', [
'refresh_token' => $token->getRefreshToken(),
])
;
if ($newToken->getToken() === $token->getToken()) {
$this->logger->info('[SocialAccountService] Refreshed with an identical token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
}
} catch (ConnectException | RequestException $exception) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
// This usually occurs due to SSL errors.
throw new SocialAccountTokenInvalidException(
'Token could not be refreshed.',
$exception->getCode(),
$exception,
);
}
$account->provider_user_token = $newToken->getToken();
$account->expires = $newToken->getExpires();
$account->state = SocialAccount::STATE_CONNECTED;
if ($newToken->getRefreshToken()) {
$account->provider_refresh_token = $newToken->getRefreshToken();
$values = $newToken->getValues();
$account->refresh_token_expires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
$account->save();
});
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);
$this->logger->info('[SocialAccountService] Token refreshed', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'state' => $account->getState(),
]);
return $newToken;
}
/**
* @return string[]
*/
private function getAccessScope(string $provider): array
{
$scopes = [];
$providerScopes = config('services.' . $provider . '.scope');
if ($providerScopes) {
$scopes = preg_split('/\s+/', $providerScopes);
}
return $scopes;
}
/**
* @throws InvalidEnumException
*/
public function getAuthorizationOptions(string $provider): array
{
$scopes = ['scope' => $this->getAccessScope($provider)];
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
case SocialAccount::PROVIDER_SALESFORCE:
case SocialAccount::PROVIDER_HUBSPOT:
case SocialAccount::PROVIDER_OUTREACH:
case SocialAccount::PROVIDER_SALESLOFT:
case SocialAccount::PROVIDER_ZOOM_PHONE:
case SocialAccount::PROVIDER_PIPEDRIVE:
case SocialAccount::PROVIDER_SLACK:
case SocialAccount::PROVIDER_AIRCALL:
case SocialAccount::PROVIDER_BULLHORN:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_TELUS:
case SocialAccount::PROVIDER_DIALPAD:
case SocialAccount::PROVIDER_TALKDESK:
return $scopes;
case SocialAccount::PROVIDER_OFFICE:
return $scopes + [
'access_type' => 'offline',
];
case SocialAccount::PROVIDER_GOOGLE:
return $scopes + [
'access_type' => 'offline',
'include_granted_scopes' => 'true',
'approval_prompt' => null,
];
default:
throw new InvalidEnumException();
}
}
private function tokenDoesNotExpire(SocialAccount $account): bool
{
return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);
}
private function hasValidToken(SocialAccount $account): bool
{
return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();
}
private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void
{
Datadog::increment('jiminny.access_token', 1, [
'provider' => $account->getProviderName(),
'state' => $state,
'result' => $result,
]);
}
private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),
];
}
private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
try {
$parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);
$number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);
} catch (NumberParseException) {
$number = null;
}
// Todo: this should check the `organization_id` matches the parent crm configuration.
return [
'country_code' => $this->countryCode,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),
'phone' => $number,
'crm_provider_id' => $rawUserData['organization_id'],
'crm_base_url' => $this->vendorValues['instance_url'],
];
}
/**
* Todo: this should check the `getHubId` matches the parent crm configuration.
*/
private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $providerUser->getHubId(),
'crm_base_url' => $providerUser->toArray()['hub_domain'],
];
}
/**
* Todo: this should check the `getCompanyId` matches the parent crm configuration.
*/
private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $rawUserData['data']['company_id'],
'crm_base_url' => '[URL_WITH_CREDENTIALS] ActivityProviderException
*/
private function mapDialpadUserData(DialpadResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
// They need to be Super Admin to access the Company APIs.
$this->logger->info('[Dialpad] User authenticated', $rawUserData);
if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Dialpad Super Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapAircallUserData(AircallResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
/**
* @throws ActivityProviderException
*/
private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array
{
if ($providerUser->toArray()['data']['team_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Team Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapBullhornUserData(): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
];
}
private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
}...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
34715
|
1299
|
7
|
2026-05-13T11:34:54.529052+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778672094529_m1.jpg...
|
PhpStorm
|
faVsco.js – SocialAccountService.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
6
8
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Services;
/**
* @todo cleanup after #slack-oauth-v2
*/
use AdamPaterson\OAuth2\Client\Provider\SlackResourceOwner;
use Chadhutchins\OAuth2\Client\Provider\Slack;
use ChaseConey\LaravelDatadogHelper\Datadog;
use Daniti\OAuth2\Client\Provider\Pipedrive;
use Daniti\OAuth2\Client\Provider\PipedriveResourceOwner;
use Exception;
use Flipbox\OAuth2\Client\Provider\HubSpot;
use Flipbox\OAuth2\Client\Provider\HubSpotResourceOwner;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Response;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Support\Facades\Cache;
use Jiminny\Component\Encryption\EncryptedTokenManager;
use Jiminny\Events\Users\CrmAccountReconnected;
use Jiminny\Events\Users\SocialAccountConnected;
use Jiminny\Events\Users\SocialAccountDisconnected;
use Jiminny\Exceptions\ActivityProviderException;
use Jiminny\Exceptions\InvalidEnumException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Models\Crm\Profile;
use Jiminny\Models\SocialAccount;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Notifications\SlackBotAdded;
use Jiminny\OAuth2\Client\Provider\Aircall;
use Jiminny\OAuth2\Client\Provider\AircallResourceOwner;
use Jiminny\OAuth2\Client\Provider\Bullhorn;
use Jiminny\OAuth2\Client\Provider\Dialpad;
use Jiminny\OAuth2\Client\Provider\DialpadResourceOwner;
use Jiminny\OAuth2\Client\Provider\Salesloft;
use Jiminny\OAuth2\Client\Provider\SalesloftResourceOwner;
use Jiminny\Services\Activity\Talkdesk\Provider\Talkdesk;
use Jiminny\Services\Activity\Talkdesk\Provider\TalkdeskResourceOwner;
use Jiminny\Services\Activity\Zoom\Provider\Zoom;
use Jiminny\Services\Activity\Zoom\Provider\ZoomResourceOwner;
use Jiminny\Services\OAuth2\Provider\BasicAuth;
use Jiminny\Services\OAuth2\Provider\Outreach;
use JsonException;
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\Google;
use League\OAuth2\Client\Provider\GoogleUser;
use League\OAuth2\Client\Provider\LinkedIn;
use League\OAuth2\Client\Provider\LinkedInResourceOwner;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Token\AccessTokenInterface;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberUtil;
use LogicException;
use Psr\Log\LoggerInterface;
use Random\RandomException;
use Stevenmaguire\OAuth2\Client\Provider\Salesforce;
use Stevenmaguire\OAuth2\Client\Provider\SalesforceResourceOwner;
use TheNetworg\OAuth2\Client\Provider\Azure;
use TheNetworg\OAuth2\Client\Provider\AzureResourceOwner;
use Throwable;
use TMannherz\OAuth2\Client\Provider\RingCentral;
use TMannherz\OAuth2\Client\Provider\RingcentralResourceOwner;
class SocialAccountService
{
/**
* Get a fresh tokens 5 minutes before it expires
* That should minimise the number of failed requests due to expired token
* for long-running jobs that reuse the same token for pulling lots of data.
*/
private const int REFRESH_OFFSET_MIN = 5;
private const string TOKEN_STATE_FETCH = 'fetch';
private const string TOKEN_STATE_REFRESH = 'refresh';
private const string TOKEN_RESULT_ATTEMPT = 'attempt';
private const string TOKEN_RESULT_SUCCESS = 'success';
private const string TOKEN_RESULT_FAILURE = 'failure';
private ?AccessTokenInterface $accessToken = null;
private ?string $token = null;
private ?string $refreshToken = null;
private ?int $expires = null;
private ?string $countryCode = null;
private ?string $timezone = null;
private ?array $vendorValues = null;
private ?int $refreshTokenExpires = null;
public function __construct(
private readonly EncryptedTokenManager $encryptedTokenManager,
private readonly LoggerInterface $logger,
private readonly PhoneNumberUtil $phoneNumberUtil,
private readonly Dispatcher $eventDispatcher,
) {
}
public function setVendorValues(array $values): void
{
$this->vendorValues = $values;
}
public function setAccessToken(AccessTokenInterface $accessToken): void
{
$this->accessToken = $accessToken;
// Todo: Also set these other params from this token e.g. refreshToken
}
public function setToken(?string $token): void
{
$this->token = $token;
}
public function setRefreshToken(?string $refreshToken): void
{
$this->refreshToken = $refreshToken;
}
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
public function setTimezone(string $timezone): void
{
$this->timezone = $timezone;
}
public function setExpires(?int $expiry): void
{
$this->expires = $expiry;
}
public function setRefreshTokenExpires(array $values): void
{
$this->refreshTokenExpires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
/**
* @throws InvalidEnumException
*/
public function getProvider(string $provider): AbstractProvider
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
return new LinkedIn(config('services.linkedin'));
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
$socialProvider = new LinkedIn(config('services.linkedin-conference'));
$socialProvider->withFields([
'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',
]);
return $socialProvider;
case SocialAccount::PROVIDER_SALESFORCE:
return new Salesforce(config('services.salesforce'));
case SocialAccount::PROVIDER_GOOGLE:
return new Google(config('services.google'));
case SocialAccount::PROVIDER_SLACK:
return new Slack(config('services.slack'));
case SocialAccount::PROVIDER_OFFICE:
$config = config('services.office');
// Convert string scope to array format expected by Azure provider
if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {
$config['scopes'] = array_filter(preg_split('/\s+/', trim($config['scope'])));
unset($config['scope']);
}
$socialProvider = new Azure($config);
$socialProvider->urlAPI = '[URL_WITH_CREDENTIALS] Exception
*/
public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
/** @var LinkedInResourceOwner $providerUser */
return $this->mapLinkedInUserData($providerUser);
case SocialAccount::PROVIDER_SALESFORCE:
/** @var SalesforceResourceOwner $providerUser */
return $this->mapSalesforceUserData($providerUser);
case SocialAccount::PROVIDER_HUBSPOT:
/** @var HubSpotResourceOwner $providerUser */
return $this->mapHubSpotUserData($providerUser);
case SocialAccount::PROVIDER_PIPEDRIVE:
/** @var PipedriveResourceOwner $providerUser */
return $this->mapPipedriveUserData($providerUser);
case SocialAccount::PROVIDER_GOOGLE:
/** @var GoogleUser $providerUser */
return $this->mapGoogleUserData($providerUser);
case SocialAccount::PROVIDER_SLACK:
/** @var SlackResourceOwner $providerUser */
return $this->mapSlackUserData($providerUser);
case SocialAccount::PROVIDER_OFFICE:
/** @var AzureResourceOwner $providerUser */
return $this->mapOfficeUserData($providerUser);
case SocialAccount::PROVIDER_OUTREACH:
return $this->mapOutreachUserData($providerUser);
case SocialAccount::PROVIDER_DIALPAD:
/** @var DialpadResourceOwner $providerUser*/
return $this->mapDialpadUserData($providerUser);
case SocialAccount::PROVIDER_AIRCALL:
/** @var AircallResourceOwner $providerUser */
return $this->mapAircallUserData($providerUser);
case SocialAccount::PROVIDER_ZOOM_PHONE:
/** @var ZoomResourceOwner $providerUser */
return $this->mapZoomPhoneUserData($providerUser);
case SocialAccount::PROVIDER_SALESLOFT:
/** @var SalesloftResourceOwner $providerUser */
return $this->mapSalesloftUserData($providerUser);
case SocialAccount::PROVIDER_BULLHORN:
return $this->mapBullhornUserData();
case SocialAccount::PROVIDER_TALKDESK:
/** @var TalkdeskResourceOwner $providerUser */
return $this->mapTalkdeskUserData($providerUser);
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_TELUS:
/** @var RingcentralResourceOwner $providerUser */
return $this->mapRingCentralUserData($providerUser);
default:
throw new InvalidEnumException('Unknown provider.');
}
}
/**
* Returns a new random string to use as the state parameter in an
* authorization flow.
*
* @param int $length Length of the random string to be generated.
*
* @throws RandomException
*/
public function getRandomState(int $length = 32): string
{
// Converting bytes to hex will always double length. Hence, we can reduce
// the amount of bytes by half to produce the correct length.
return bin2hex(random_bytes($length / 2));
}
private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount
{
return SocialAccount::where([
'provider' => $provider,
'provider_user_id' => $providerUser->getId(),
])->first();
}
/**
* Based on the provider data, try to match to a sociable entity based on email.
* If a match is made, create the social account under that entity.
*
* @throws AuthenticationException
*/
public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User
{
$account = $this->getAssociation($provider, $providerUser);
if ($account !== null && $account->hasUser()) {
return $account->getUser();
}
$userData = $this->mapUserData($provider, $providerUser);
// Check if we have an actual user with this email.
/** @var User|null $user */
$user = User::where('email', $userData['email'])->first();
// If the user is trying to connect to LinkedIn, don't allow this.
// Todo: have an interstitial page to perform 2FA to connect.
if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {
throw new AuthenticationException(
'Sorry, you\'ll need to login through your Jiminny account to access the Conference.',
);
}
return $user;
}
/**
* @throws JsonException
*/
public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount
{
/** @var SocialAccount $account */
$account = $user->socialAccounts()->firstOrNew([
'provider' => $provider,
]);
$account->fill([
'provider_user_id' => $providerUser->getId(),
'provider_user_token' => $this->token,
'expires' => $this->expires,
'state' => SocialAccount::STATE_CONNECTED,
'retry_after' => null,
]);
// This is an optional parameter, don't overwrite the existing one with null if we don't get it.
if ($this->refreshToken) {
$account->fill([
'provider_refresh_token' => $this->refreshToken,
'refresh_token_expires' => $this->refreshTokenExpires,
]);
}
if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {
$account->fill([
'auth_scope' => is_scalar($this->vendorValues['scope'])
? $this->vendorValues['scope']
: json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),
]);
} else {
$account->fill([
'auth_scope' => null,
]);
$this->logger->warning(
'[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',
// pulling directly from the token, just to avoid potential masking of the issue
['token_values' => $this->accessToken->getValues()],
);
}
$account->save();
// Association can be from an updated token so don't re-announce this.
if (
$account->wasRecentlyCreated
&& in_array($provider, SocialAccount::CRM_PROVIDERS, true)
&& $provider !== SocialAccount::PROVIDER_HUBSPOT
&& $providerUser->getId() !== null
) {
$crm = $user->team->crm;
$data = [
'crm_configuration_id' => $crm->id,
'log_notes' => Profile::LOG_NOTE_ENHANCED,
];
$crmProfile = $user->crmProfile()->where([
'crm_provider_id' => $providerUser->getId(),
])->first();
$user->crmProfile()->updateOrCreate([
'crm_provider_id' => $providerUser->getId(),
], $data);
// If updated, fire reconnected
if ($crmProfile !== null) {
$this->eventDispatcher->dispatch(new CrmAccountReconnected($account));
}
}
$this->eventDispatcher->dispatch(new SocialAccountConnected($account));
return $account;
}
public function integrate(string $provider, User $user, Team $team): void
{
if ($provider === SocialAccount::PROVIDER_SLACK) {
if (! isset($this->vendorValues['ok'])
|| $this->vendorValues['ok'] !== true
|| ! isset($this->vendorValues['token_type'])
|| $this->vendorValues['token_type'] !== 'bot'
) {
// code expects V2 token, which differs slightly from V1
throw new LogicException('Invalid token received from Slack OAuth v2 API');
}
$webhook = $this->vendorValues['incoming_webhook'];
$slackTeamId = $this->vendorValues['team']['id'];
$botData = [
'channel' => $webhook['channel'],
'channel_id' => $webhook['channel_id'],
'config_url' => $webhook['configuration_url'],
'webhook_url' => $webhook['url'],
'bot_user_id' => $this->vendorValues['bot_user_id'],
'bot_access_token' => $this->accessToken->getToken(),
];
$slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);
if ($slackBot->wasRecentlyCreated) {
// Send Slack notification.
$user->notify(new SlackBotAdded());
}
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);
$this->logger->info('[SocialAccountService] Fetching token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$account->refresh();
if (
! $forceRefresh
&& ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))
) {
$this->logger->info('[SocialAccountService] Token retrieved', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);
return $this->encryptedTokenManager->getAccessToken($account);
}
try {
$this->logger->info('[SocialAccountService] Token needs refreshing', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
return $this->refreshToken($account, $forceRefresh);
} catch (IdentityProviderException $exception) {
$responseBody = $exception->getResponseBody();
if ($responseBody instanceof Response) {
$responseBody = $responseBody->getBody();
}
if (is_object($responseBody) && method_exists($responseBody, '__toString')) {
$responseBody = $responseBody->__toString();
}
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'responseBody' => $responseBody,
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logger->error('[SocialAccountService] Cannot obtain token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception::class,
'errorMessage' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {
$this->logger->error('[SocialAccountService] Full refresh required', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
// Something terrible happened their token, they need to reconnect.
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
$this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));
}
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
}
}
public function refreshSocialAccountToken(SocialAccount $socialAccount): void
{
try {
$this->getToken($socialAccount);
} catch (Throwable $e) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $socialAccount->getId(),
'provider' => $socialAccount->getProviderName(),
'reason' => $e->getMessage(),
]);
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);
$newToken = null;
Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)
->block(8, function () use ($account, $forceRefresh, &$newToken): void {
try {
$account->refresh();
$token = $this->encryptedTokenManager->getAccessToken($account);
if (! $forceRefresh && $this->hasValidToken($account)) {
$newToken = $token;
return;
}
if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {
$this->logger->error('[SocialAccountService] Refresh token not found', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog(
$account,
self::TOKEN_STATE_REFRESH,
self::TOKEN_RESULT_FAILURE,
);
throw new SocialAccountTokenInvalidException(
'Refresh token is not set, re-connection required.',
);
}
$this->logger->info('[SocialAccountService] Refreshing token from provider', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),
'state' => $account->getState(),
]);
$newToken = $this->getProvider($account->provider)
->getAccessToken('refresh_token', [
'refresh_token' => $token->getRefreshToken(),
])
;
if ($newToken->getToken() === $token->getToken()) {
$this->logger->info('[SocialAccountService] Refreshed with an identical token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
}
} catch (ConnectException | RequestException $exception) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
// This usually occurs due to SSL errors.
throw new SocialAccountTokenInvalidException(
'Token could not be refreshed.',
$exception->getCode(),
$exception,
);
}
$account->provider_user_token = $newToken->getToken();
$account->expires = $newToken->getExpires();
$account->state = SocialAccount::STATE_CONNECTED;
if ($newToken->getRefreshToken()) {
$account->provider_refresh_token = $newToken->getRefreshToken();
$values = $newToken->getValues();
$account->refresh_token_expires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
$account->save();
});
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);
$this->logger->info('[SocialAccountService] Token refreshed', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'state' => $account->getState(),
]);
return $newToken;
}
/**
* @return string[]
*/
private function getAccessScope(string $provider): array
{
$scopes = [];
$providerScopes = config('services.' . $provider . '.scope');
if ($providerScopes) {
$scopes = preg_split('/\s+/', $providerScopes);
}
return $scopes;
}
/**
* @throws InvalidEnumException
*/
public function getAuthorizationOptions(string $provider): array
{
$scopes = ['scope' => $this->getAccessScope($provider)];
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
case SocialAccount::PROVIDER_SALESFORCE:
case SocialAccount::PROVIDER_HUBSPOT:
case SocialAccount::PROVIDER_OUTREACH:
case SocialAccount::PROVIDER_SALESLOFT:
case SocialAccount::PROVIDER_ZOOM_PHONE:
case SocialAccount::PROVIDER_PIPEDRIVE:
case SocialAccount::PROVIDER_SLACK:
case SocialAccount::PROVIDER_AIRCALL:
case SocialAccount::PROVIDER_BULLHORN:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_TELUS:
case SocialAccount::PROVIDER_DIALPAD:
case SocialAccount::PROVIDER_TALKDESK:
return $scopes;
case SocialAccount::PROVIDER_OFFICE:
return $scopes + [
'access_type' => 'offline',
];
case SocialAccount::PROVIDER_GOOGLE:
return $scopes + [
'access_type' => 'offline',
'include_granted_scopes' => 'true',
'approval_prompt' => null,
];
default:
throw new InvalidEnumException();
}
}
private function tokenDoesNotExpire(SocialAccount $account): bool
{
return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);
}
private function hasValidToken(SocialAccount $account): bool
{
return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();
}
private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void
{
Datadog::increment('jiminny.access_token', 1, [
'provider' => $account->getProviderName(),
'state' => $state,
'result' => $result,
]);
}
private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),
];
}
private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
try {
$parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);
$number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);
} catch (NumberParseException) {
$number = null;
}
// Todo: this should check the `organization_id` matches the parent crm configuration.
return [
'country_code' => $this->countryCode,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),
'phone' => $number,
'crm_provider_id' => $rawUserData['organization_id'],
'crm_base_url' => $this->vendorValues['instance_url'],
];
}
/**
* Todo: this should check the `getHubId` matches the parent crm configuration.
*/
private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $providerUser->getHubId(),
'crm_base_url' => $providerUser->toArray()['hub_domain'],
];
}
/**
* Todo: this should check the `getCompanyId` matches the parent crm configuration.
*/
private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $rawUserData['data']['company_id'],
'crm_base_url' => '[URL_WITH_CREDENTIALS] ActivityProviderException
*/
private function mapDialpadUserData(DialpadResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
// They need to be Super Admin to access the Company APIs.
$this->logger->info('[Dialpad] User authenticated', $rawUserData);
if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Dialpad Super Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapAircallUserData(AircallResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
/**
* @throws ActivityProviderException
*/
private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array
{
if ($providerUser->toArray()['data']['team_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Team Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapBullhornUserData(): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
];
}
private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
}
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":"JY-20891-improve-sms-text-relays, menu","depth":5,"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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":"AskJiminnyReportActivityServiceTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'AskJiminnyReportActivityServiceTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'AskJiminnyReportActivityServiceTest'","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":"6","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"8","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":"<?php\n\nnamespace Jiminny\\Services;\n\n/**\n * @todo cleanup after #slack-oauth-v2\n */\n\nuse AdamPaterson\\OAuth2\\Client\\Provider\\SlackResourceOwner;\nuse Chadhutchins\\OAuth2\\Client\\Provider\\Slack;\nuse ChaseConey\\LaravelDatadogHelper\\Datadog;\nuse Daniti\\OAuth2\\Client\\Provider\\Pipedrive;\nuse Daniti\\OAuth2\\Client\\Provider\\PipedriveResourceOwner;\nuse Exception;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpot;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpotResourceOwner;\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Psr7\\Response;\nuse Illuminate\\Auth\\AuthenticationException;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Support\\Facades\\Cache;\nuse Jiminny\\Component\\Encryption\\EncryptedTokenManager;\nuse Jiminny\\Events\\Users\\CrmAccountReconnected;\nuse Jiminny\\Events\\Users\\SocialAccountConnected;\nuse Jiminny\\Events\\Users\\SocialAccountDisconnected;\nuse Jiminny\\Exceptions\\ActivityProviderException;\nuse Jiminny\\Exceptions\\InvalidEnumException;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Models\\SocialAccount;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Notifications\\SlackBotAdded;\nuse Jiminny\\OAuth2\\Client\\Provider\\Aircall;\nuse Jiminny\\OAuth2\\Client\\Provider\\AircallResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Bullhorn;\nuse Jiminny\\OAuth2\\Client\\Provider\\Dialpad;\nuse Jiminny\\OAuth2\\Client\\Provider\\DialpadResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Salesloft;\nuse Jiminny\\OAuth2\\Client\\Provider\\SalesloftResourceOwner;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\Talkdesk;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\TalkdeskResourceOwner;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\Zoom;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\ZoomResourceOwner;\nuse Jiminny\\Services\\OAuth2\\Provider\\BasicAuth;\nuse Jiminny\\Services\\OAuth2\\Provider\\Outreach;\nuse JsonException;\nuse League\\OAuth2\\Client\\OptionProvider\\HttpBasicAuthOptionProvider;\nuse League\\OAuth2\\Client\\Provider\\AbstractProvider;\nuse League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException;\nuse League\\OAuth2\\Client\\Provider\\Google;\nuse League\\OAuth2\\Client\\Provider\\GoogleUser;\nuse League\\OAuth2\\Client\\Provider\\LinkedIn;\nuse League\\OAuth2\\Client\\Provider\\LinkedInResourceOwner;\nuse League\\OAuth2\\Client\\Provider\\ResourceOwnerInterface;\nuse League\\OAuth2\\Client\\Token\\AccessToken;\nuse League\\OAuth2\\Client\\Token\\AccessTokenInterface;\nuse libphonenumber\\NumberParseException;\nuse libphonenumber\\PhoneNumberFormat;\nuse libphonenumber\\PhoneNumberUtil;\nuse LogicException;\nuse Psr\\Log\\LoggerInterface;\nuse Random\\RandomException;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\Salesforce;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\SalesforceResourceOwner;\nuse TheNetworg\\OAuth2\\Client\\Provider\\Azure;\nuse TheNetworg\\OAuth2\\Client\\Provider\\AzureResourceOwner;\nuse Throwable;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingCentral;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingcentralResourceOwner;\n\nclass SocialAccountService\n{\n /**\n * Get a fresh tokens 5 minutes before it expires\n * That should minimise the number of failed requests due to expired token\n * for long-running jobs that reuse the same token for pulling lots of data.\n */\n private const int REFRESH_OFFSET_MIN = 5;\n\n private const string TOKEN_STATE_FETCH = 'fetch';\n private const string TOKEN_STATE_REFRESH = 'refresh';\n private const string TOKEN_RESULT_ATTEMPT = 'attempt';\n private const string TOKEN_RESULT_SUCCESS = 'success';\n private const string TOKEN_RESULT_FAILURE = 'failure';\n\n private ?AccessTokenInterface $accessToken = null;\n private ?string $token = null;\n private ?string $refreshToken = null;\n private ?int $expires = null;\n private ?string $countryCode = null;\n private ?string $timezone = null;\n private ?array $vendorValues = null;\n\n private ?int $refreshTokenExpires = null;\n\n public function __construct(\n private readonly EncryptedTokenManager $encryptedTokenManager,\n private readonly LoggerInterface $logger,\n private readonly PhoneNumberUtil $phoneNumberUtil,\n private readonly Dispatcher $eventDispatcher,\n ) {\n }\n\n public function setVendorValues(array $values): void\n {\n $this->vendorValues = $values;\n }\n\n public function setAccessToken(AccessTokenInterface $accessToken): void\n {\n $this->accessToken = $accessToken;\n // Todo: Also set these other params from this token e.g. refreshToken\n }\n\n public function setToken(?string $token): void\n {\n $this->token = $token;\n }\n\n public function setRefreshToken(?string $refreshToken): void\n {\n $this->refreshToken = $refreshToken;\n }\n\n public function setCountryCode(string $countryCode): void\n {\n $this->countryCode = $countryCode;\n }\n\n public function setTimezone(string $timezone): void\n {\n $this->timezone = $timezone;\n }\n\n public function setExpires(?int $expiry): void\n {\n $this->expires = $expiry;\n }\n\n public function setRefreshTokenExpires(array $values): void\n {\n $this->refreshTokenExpires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getProvider(string $provider): AbstractProvider\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n return new LinkedIn(config('services.linkedin'));\n\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n $socialProvider = new LinkedIn(config('services.linkedin-conference'));\n $socialProvider->withFields([\n 'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',\n ]);\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_SALESFORCE:\n return new Salesforce(config('services.salesforce'));\n\n case SocialAccount::PROVIDER_GOOGLE:\n return new Google(config('services.google'));\n\n case SocialAccount::PROVIDER_SLACK:\n return new Slack(config('services.slack'));\n\n case SocialAccount::PROVIDER_OFFICE:\n $config = config('services.office');\n\n // Convert string scope to array format expected by Azure provider\n if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {\n $config['scopes'] = array_filter(preg_split('/\\s+/', trim($config['scope'])));\n unset($config['scope']);\n }\n\n $socialProvider = new Azure($config);\n $socialProvider->urlAPI = 'https://graph.microsoft.com/v1.0/';\n $socialProvider->API_VERSION = '1.0';\n $socialProvider->defaultEndPointVersion = Azure::ENDPOINT_VERSION_2_0;\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_HUBSPOT:\n return new HubSpot(config('services.hubspot'));\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n return new Pipedrive(config('services.pipedrive'));\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n return new Zoom(config('services.zoom-phone'));\n\n case SocialAccount::PROVIDER_OUTREACH:\n return new Outreach(config('services.outreach'));\n\n case SocialAccount::PROVIDER_SALESLOFT:\n return new Salesloft(config('services.salesloft'));\n\n case SocialAccount::PROVIDER_AIRCALL:\n return new Aircall(config('services.aircall'));\n\n case SocialAccount::PROVIDER_DIALPAD:\n return new Dialpad(config('services.dialpad'));\n\n case SocialAccount::PROVIDER_GONG:\n return new BasicAuth(config('services.gong'));\n\n case SocialAccount::PROVIDER_CLOSE:\n return new BasicAuth(config('services.close'));\n\n case SocialAccount::PROVIDER_AVAYA:\n // Avaya is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.avaya'));\n\n case SocialAccount::PROVIDER_TELUS:\n // Telus is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.telus'));\n\n case SocialAccount::PROVIDER_RINGCENTRAL:\n return new RingCentral(config('services.ringcentral'));\n\n case SocialAccount::PROVIDER_BULLHORN:\n return new Bullhorn(config('services.bullhorn'));\n\n case SocialAccount::PROVIDER_TALKDESK:\n return new Talkdesk(config('services.talkdesk'), [\n // Automatically concatenate Basic token to AuthToken requests\n 'optionProvider' => new HttpBasicAuthOptionProvider(),\n ]);\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n /**\n *\n *\n * @throws Exception\n */\n public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n /** @var LinkedInResourceOwner $providerUser */\n return $this->mapLinkedInUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESFORCE:\n /** @var SalesforceResourceOwner $providerUser */\n return $this->mapSalesforceUserData($providerUser);\n\n case SocialAccount::PROVIDER_HUBSPOT:\n /** @var HubSpotResourceOwner $providerUser */\n return $this->mapHubSpotUserData($providerUser);\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n /** @var PipedriveResourceOwner $providerUser */\n return $this->mapPipedriveUserData($providerUser);\n\n case SocialAccount::PROVIDER_GOOGLE:\n /** @var GoogleUser $providerUser */\n return $this->mapGoogleUserData($providerUser);\n\n case SocialAccount::PROVIDER_SLACK:\n /** @var SlackResourceOwner $providerUser */\n return $this->mapSlackUserData($providerUser);\n\n case SocialAccount::PROVIDER_OFFICE:\n /** @var AzureResourceOwner $providerUser */\n return $this->mapOfficeUserData($providerUser);\n\n case SocialAccount::PROVIDER_OUTREACH:\n return $this->mapOutreachUserData($providerUser);\n\n case SocialAccount::PROVIDER_DIALPAD:\n /** @var DialpadResourceOwner $providerUser*/\n return $this->mapDialpadUserData($providerUser);\n\n case SocialAccount::PROVIDER_AIRCALL:\n /** @var AircallResourceOwner $providerUser */\n return $this->mapAircallUserData($providerUser);\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n /** @var ZoomResourceOwner $providerUser */\n return $this->mapZoomPhoneUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESLOFT:\n /** @var SalesloftResourceOwner $providerUser */\n return $this->mapSalesloftUserData($providerUser);\n\n case SocialAccount::PROVIDER_BULLHORN:\n return $this->mapBullhornUserData();\n\n case SocialAccount::PROVIDER_TALKDESK:\n /** @var TalkdeskResourceOwner $providerUser */\n return $this->mapTalkdeskUserData($providerUser);\n\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_TELUS:\n /** @var RingcentralResourceOwner $providerUser */\n return $this->mapRingCentralUserData($providerUser);\n default:\n throw new InvalidEnumException('Unknown provider.');\n }\n }\n\n /**\n * Returns a new random string to use as the state parameter in an\n * authorization flow.\n *\n * @param int $length Length of the random string to be generated.\n *\n * @throws RandomException\n */\n public function getRandomState(int $length = 32): string\n {\n // Converting bytes to hex will always double length. Hence, we can reduce\n // the amount of bytes by half to produce the correct length.\n return bin2hex(random_bytes($length / 2));\n }\n\n private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount\n {\n return SocialAccount::where([\n 'provider' => $provider,\n 'provider_user_id' => $providerUser->getId(),\n ])->first();\n }\n\n /**\n * Based on the provider data, try to match to a sociable entity based on email.\n * If a match is made, create the social account under that entity.\n *\n * @throws AuthenticationException\n */\n public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User\n {\n $account = $this->getAssociation($provider, $providerUser);\n if ($account !== null && $account->hasUser()) {\n return $account->getUser();\n }\n $userData = $this->mapUserData($provider, $providerUser);\n\n // Check if we have an actual user with this email.\n /** @var User|null $user */\n $user = User::where('email', $userData['email'])->first();\n\n // If the user is trying to connect to LinkedIn, don't allow this.\n // Todo: have an interstitial page to perform 2FA to connect.\n if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {\n throw new AuthenticationException(\n 'Sorry, you\\'ll need to login through your Jiminny account to access the Conference.',\n );\n }\n\n return $user;\n }\n\n /**\n * @throws JsonException\n */\n public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount\n {\n /** @var SocialAccount $account */\n $account = $user->socialAccounts()->firstOrNew([\n 'provider' => $provider,\n ]);\n\n $account->fill([\n 'provider_user_id' => $providerUser->getId(),\n 'provider_user_token' => $this->token,\n 'expires' => $this->expires,\n 'state' => SocialAccount::STATE_CONNECTED,\n 'retry_after' => null,\n ]);\n\n // This is an optional parameter, don't overwrite the existing one with null if we don't get it.\n if ($this->refreshToken) {\n $account->fill([\n 'provider_refresh_token' => $this->refreshToken,\n 'refresh_token_expires' => $this->refreshTokenExpires,\n ]);\n }\n\n if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {\n $account->fill([\n 'auth_scope' => is_scalar($this->vendorValues['scope'])\n ? $this->vendorValues['scope']\n : json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),\n ]);\n } else {\n $account->fill([\n 'auth_scope' => null,\n ]);\n\n $this->logger->warning(\n '[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',\n // pulling directly from the token, just to avoid potential masking of the issue\n ['token_values' => $this->accessToken->getValues()],\n );\n }\n\n $account->save();\n\n // Association can be from an updated token so don't re-announce this.\n if (\n $account->wasRecentlyCreated\n && in_array($provider, SocialAccount::CRM_PROVIDERS, true)\n && $provider !== SocialAccount::PROVIDER_HUBSPOT\n && $providerUser->getId() !== null\n ) {\n $crm = $user->team->crm;\n $data = [\n 'crm_configuration_id' => $crm->id,\n 'log_notes' => Profile::LOG_NOTE_ENHANCED,\n ];\n\n $crmProfile = $user->crmProfile()->where([\n 'crm_provider_id' => $providerUser->getId(),\n ])->first();\n\n $user->crmProfile()->updateOrCreate([\n 'crm_provider_id' => $providerUser->getId(),\n ], $data);\n\n // If updated, fire reconnected\n if ($crmProfile !== null) {\n $this->eventDispatcher->dispatch(new CrmAccountReconnected($account));\n }\n }\n\n $this->eventDispatcher->dispatch(new SocialAccountConnected($account));\n\n return $account;\n }\n\n public function integrate(string $provider, User $user, Team $team): void\n {\n if ($provider === SocialAccount::PROVIDER_SLACK) {\n if (! isset($this->vendorValues['ok'])\n || $this->vendorValues['ok'] !== true\n || ! isset($this->vendorValues['token_type'])\n || $this->vendorValues['token_type'] !== 'bot'\n ) {\n // code expects V2 token, which differs slightly from V1\n throw new LogicException('Invalid token received from Slack OAuth v2 API');\n }\n\n $webhook = $this->vendorValues['incoming_webhook'];\n\n $slackTeamId = $this->vendorValues['team']['id'];\n\n $botData = [\n 'channel' => $webhook['channel'],\n 'channel_id' => $webhook['channel_id'],\n 'config_url' => $webhook['configuration_url'],\n 'webhook_url' => $webhook['url'],\n 'bot_user_id' => $this->vendorValues['bot_user_id'],\n 'bot_access_token' => $this->accessToken->getToken(),\n ];\n\n $slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);\n\n if ($slackBot->wasRecentlyCreated) {\n // Send Slack notification.\n $user->notify(new SlackBotAdded());\n }\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);\n\n $this->logger->info('[SocialAccountService] Fetching token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $account->refresh();\n\n if (\n ! $forceRefresh\n && ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))\n ) {\n $this->logger->info('[SocialAccountService] Token retrieved', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);\n\n return $this->encryptedTokenManager->getAccessToken($account);\n }\n\n try {\n $this->logger->info('[SocialAccountService] Token needs refreshing', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n return $this->refreshToken($account, $forceRefresh);\n } catch (IdentityProviderException $exception) {\n $responseBody = $exception->getResponseBody();\n\n if ($responseBody instanceof Response) {\n $responseBody = $responseBody->getBody();\n }\n\n if (is_object($responseBody) && method_exists($responseBody, '__toString')) {\n $responseBody = $responseBody->__toString();\n }\n\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'responseBody' => $responseBody,\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logger->error('[SocialAccountService] Cannot obtain token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception::class,\n 'errorMessage' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {\n $this->logger->error('[SocialAccountService] Full refresh required', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n // Something terrible happened their token, they need to reconnect.\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n $this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));\n }\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n }\n }\n\n public function refreshSocialAccountToken(SocialAccount $socialAccount): void\n {\n try {\n $this->getToken($socialAccount);\n } catch (Throwable $e) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $socialAccount->getId(),\n 'provider' => $socialAccount->getProviderName(),\n 'reason' => $e->getMessage(),\n ]);\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);\n\n $newToken = null;\n\n Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)\n ->block(8, function () use ($account, $forceRefresh, &$newToken): void {\n try {\n $account->refresh();\n $token = $this->encryptedTokenManager->getAccessToken($account);\n\n if (! $forceRefresh && $this->hasValidToken($account)) {\n $newToken = $token;\n\n return;\n }\n\n if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {\n $this->logger->error('[SocialAccountService] Refresh token not found', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog(\n $account,\n self::TOKEN_STATE_REFRESH,\n self::TOKEN_RESULT_FAILURE,\n );\n\n throw new SocialAccountTokenInvalidException(\n 'Refresh token is not set, re-connection required.',\n );\n }\n\n $this->logger->info('[SocialAccountService] Refreshing token from provider', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),\n 'state' => $account->getState(),\n ]);\n\n $newToken = $this->getProvider($account->provider)\n ->getAccessToken('refresh_token', [\n 'refresh_token' => $token->getRefreshToken(),\n ])\n ;\n\n if ($newToken->getToken() === $token->getToken()) {\n $this->logger->info('[SocialAccountService] Refreshed with an identical token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n }\n } catch (ConnectException | RequestException $exception) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n // This usually occurs due to SSL errors.\n throw new SocialAccountTokenInvalidException(\n 'Token could not be refreshed.',\n $exception->getCode(),\n $exception,\n );\n }\n\n $account->provider_user_token = $newToken->getToken();\n $account->expires = $newToken->getExpires();\n $account->state = SocialAccount::STATE_CONNECTED;\n\n if ($newToken->getRefreshToken()) {\n $account->provider_refresh_token = $newToken->getRefreshToken();\n $values = $newToken->getValues();\n $account->refresh_token_expires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n $account->save();\n });\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);\n\n $this->logger->info('[SocialAccountService] Token refreshed', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'state' => $account->getState(),\n ]);\n\n return $newToken;\n }\n\n /**\n * @return string[]\n */\n private function getAccessScope(string $provider): array\n {\n $scopes = [];\n $providerScopes = config('services.' . $provider . '.scope');\n\n if ($providerScopes) {\n $scopes = preg_split('/\\s+/', $providerScopes);\n }\n\n return $scopes;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getAuthorizationOptions(string $provider): array\n {\n $scopes = ['scope' => $this->getAccessScope($provider)];\n\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n case SocialAccount::PROVIDER_SALESFORCE:\n case SocialAccount::PROVIDER_HUBSPOT:\n case SocialAccount::PROVIDER_OUTREACH:\n case SocialAccount::PROVIDER_SALESLOFT:\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n case SocialAccount::PROVIDER_PIPEDRIVE:\n case SocialAccount::PROVIDER_SLACK:\n case SocialAccount::PROVIDER_AIRCALL:\n case SocialAccount::PROVIDER_BULLHORN:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_TELUS:\n case SocialAccount::PROVIDER_DIALPAD:\n case SocialAccount::PROVIDER_TALKDESK:\n return $scopes;\n\n case SocialAccount::PROVIDER_OFFICE:\n return $scopes + [\n 'access_type' => 'offline',\n ];\n\n case SocialAccount::PROVIDER_GOOGLE:\n return $scopes + [\n 'access_type' => 'offline',\n 'include_granted_scopes' => 'true',\n 'approval_prompt' => null,\n ];\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n private function tokenDoesNotExpire(SocialAccount $account): bool\n {\n return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);\n }\n\n private function hasValidToken(SocialAccount $account): bool\n {\n return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();\n }\n\n private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void\n {\n Datadog::increment('jiminny.access_token', 1, [\n 'provider' => $account->getProviderName(),\n 'state' => $state,\n 'result' => $result,\n ]);\n }\n\n private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),\n ];\n }\n\n private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n try {\n $parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);\n $number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);\n } catch (NumberParseException) {\n $number = null;\n }\n\n // Todo: this should check the `organization_id` matches the parent crm configuration.\n\n return [\n 'country_code' => $this->countryCode,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),\n 'phone' => $number,\n 'crm_provider_id' => $rawUserData['organization_id'],\n 'crm_base_url' => $this->vendorValues['instance_url'],\n ];\n }\n\n /**\n * Todo: this should check the `getHubId` matches the parent crm configuration.\n */\n private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array\n {\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $providerUser->getHubId(),\n 'crm_base_url' => $providerUser->toArray()['hub_domain'],\n ];\n }\n\n /**\n * Todo: this should check the `getCompanyId` matches the parent crm configuration.\n */\n private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $rawUserData['data']['company_id'],\n 'crm_base_url' => 'https://' . $rawUserData['data']['company_domain'] . '.pipedrive.com',\n ];\n }\n\n private function mapGoogleUserData(GoogleUser $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($providerUser->getEmail()),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapSlackUserData(SlackResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getRealName(),\n ];\n }\n\n private function mapOfficeUserData(AzureResourceOwner $providerUser): array\n {\n $email = $providerUser->getUpn() ?? $providerUser->claim('email');\n\n $this->logger->info('[Office] User authenticated', $providerUser->toArray());\n\n $name = $providerUser->claim('name') ??\n $providerUser->getFirstName() . ' ' . $providerUser->getLastName();\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($email),\n 'name' => $name,\n ];\n }\n\n private function mapOutreachUserData(ResourceOwnerInterface $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n $socialProvider = $this->getProvider(SocialAccount::PROVIDER_OUTREACH);\n $url = 'https://api.outreach.io/api/v2/profiles/';\n\n try {\n $request = $socialProvider->getAuthenticatedRequest(\n 'get',\n $url . $rawUserData['meta']['user']['id'],\n $this->accessToken,\n );\n\n $response = $socialProvider->getParsedResponse($request);\n\n $this->logger->info('[Outreach] User authenticated', $response);\n } catch (Exception) {\n //Just ignore\n }\n\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapDialpadUserData(DialpadResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n // They need to be Super Admin to access the Company APIs.\n $this->logger->info('[Dialpad] User authenticated', $rawUserData);\n\n if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Dialpad Super Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapAircallUserData(AircallResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array\n {\n if ($providerUser->toArray()['data']['team_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Team Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapBullhornUserData(): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n\n private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Services;\n\n/**\n * @todo cleanup after #slack-oauth-v2\n */\n\nuse AdamPaterson\\OAuth2\\Client\\Provider\\SlackResourceOwner;\nuse Chadhutchins\\OAuth2\\Client\\Provider\\Slack;\nuse ChaseConey\\LaravelDatadogHelper\\Datadog;\nuse Daniti\\OAuth2\\Client\\Provider\\Pipedrive;\nuse Daniti\\OAuth2\\Client\\Provider\\PipedriveResourceOwner;\nuse Exception;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpot;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpotResourceOwner;\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Psr7\\Response;\nuse Illuminate\\Auth\\AuthenticationException;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Support\\Facades\\Cache;\nuse Jiminny\\Component\\Encryption\\EncryptedTokenManager;\nuse Jiminny\\Events\\Users\\CrmAccountReconnected;\nuse Jiminny\\Events\\Users\\SocialAccountConnected;\nuse Jiminny\\Events\\Users\\SocialAccountDisconnected;\nuse Jiminny\\Exceptions\\ActivityProviderException;\nuse Jiminny\\Exceptions\\InvalidEnumException;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Models\\SocialAccount;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Notifications\\SlackBotAdded;\nuse Jiminny\\OAuth2\\Client\\Provider\\Aircall;\nuse Jiminny\\OAuth2\\Client\\Provider\\AircallResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Bullhorn;\nuse Jiminny\\OAuth2\\Client\\Provider\\Dialpad;\nuse Jiminny\\OAuth2\\Client\\Provider\\DialpadResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Salesloft;\nuse Jiminny\\OAuth2\\Client\\Provider\\SalesloftResourceOwner;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\Talkdesk;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\TalkdeskResourceOwner;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\Zoom;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\ZoomResourceOwner;\nuse Jiminny\\Services\\OAuth2\\Provider\\BasicAuth;\nuse Jiminny\\Services\\OAuth2\\Provider\\Outreach;\nuse JsonException;\nuse League\\OAuth2\\Client\\OptionProvider\\HttpBasicAuthOptionProvider;\nuse League\\OAuth2\\Client\\Provider\\AbstractProvider;\nuse League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException;\nuse League\\OAuth2\\Client\\Provider\\Google;\nuse League\\OAuth2\\Client\\Provider\\GoogleUser;\nuse League\\OAuth2\\Client\\Provider\\LinkedIn;\nuse League\\OAuth2\\Client\\Provider\\LinkedInResourceOwner;\nuse League\\OAuth2\\Client\\Provider\\ResourceOwnerInterface;\nuse League\\OAuth2\\Client\\Token\\AccessToken;\nuse League\\OAuth2\\Client\\Token\\AccessTokenInterface;\nuse libphonenumber\\NumberParseException;\nuse libphonenumber\\PhoneNumberFormat;\nuse libphonenumber\\PhoneNumberUtil;\nuse LogicException;\nuse Psr\\Log\\LoggerInterface;\nuse Random\\RandomException;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\Salesforce;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\SalesforceResourceOwner;\nuse TheNetworg\\OAuth2\\Client\\Provider\\Azure;\nuse TheNetworg\\OAuth2\\Client\\Provider\\AzureResourceOwner;\nuse Throwable;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingCentral;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingcentralResourceOwner;\n\nclass SocialAccountService\n{\n /**\n * Get a fresh tokens 5 minutes before it expires\n * That should minimise the number of failed requests due to expired token\n * for long-running jobs that reuse the same token for pulling lots of data.\n */\n private const int REFRESH_OFFSET_MIN = 5;\n\n private const string TOKEN_STATE_FETCH = 'fetch';\n private const string TOKEN_STATE_REFRESH = 'refresh';\n private const string TOKEN_RESULT_ATTEMPT = 'attempt';\n private const string TOKEN_RESULT_SUCCESS = 'success';\n private const string TOKEN_RESULT_FAILURE = 'failure';\n\n private ?AccessTokenInterface $accessToken = null;\n private ?string $token = null;\n private ?string $refreshToken = null;\n private ?int $expires = null;\n private ?string $countryCode = null;\n private ?string $timezone = null;\n private ?array $vendorValues = null;\n\n private ?int $refreshTokenExpires = null;\n\n public function __construct(\n private readonly EncryptedTokenManager $encryptedTokenManager,\n private readonly LoggerInterface $logger,\n private readonly PhoneNumberUtil $phoneNumberUtil,\n private readonly Dispatcher $eventDispatcher,\n ) {\n }\n\n public function setVendorValues(array $values): void\n {\n $this->vendorValues = $values;\n }\n\n public function setAccessToken(AccessTokenInterface $accessToken): void\n {\n $this->accessToken = $accessToken;\n // Todo: Also set these other params from this token e.g. refreshToken\n }\n\n public function setToken(?string $token): void\n {\n $this->token = $token;\n }\n\n public function setRefreshToken(?string $refreshToken): void\n {\n $this->refreshToken = $refreshToken;\n }\n\n public function setCountryCode(string $countryCode): void\n {\n $this->countryCode = $countryCode;\n }\n\n public function setTimezone(string $timezone): void\n {\n $this->timezone = $timezone;\n }\n\n public function setExpires(?int $expiry): void\n {\n $this->expires = $expiry;\n }\n\n public function setRefreshTokenExpires(array $values): void\n {\n $this->refreshTokenExpires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getProvider(string $provider): AbstractProvider\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n return new LinkedIn(config('services.linkedin'));\n\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n $socialProvider = new LinkedIn(config('services.linkedin-conference'));\n $socialProvider->withFields([\n 'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',\n ]);\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_SALESFORCE:\n return new Salesforce(config('services.salesforce'));\n\n case SocialAccount::PROVIDER_GOOGLE:\n return new Google(config('services.google'));\n\n case SocialAccount::PROVIDER_SLACK:\n return new Slack(config('services.slack'));\n\n case SocialAccount::PROVIDER_OFFICE:\n $config = config('services.office');\n\n // Convert string scope to array format expected by Azure provider\n if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {\n $config['scopes'] = array_filter(preg_split('/\\s+/', trim($config['scope'])));\n unset($config['scope']);\n }\n\n $socialProvider = new Azure($config);\n $socialProvider->urlAPI = 'https://graph.microsoft.com/v1.0/';\n $socialProvider->API_VERSION = '1.0';\n $socialProvider->defaultEndPointVersion = Azure::ENDPOINT_VERSION_2_0;\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_HUBSPOT:\n return new HubSpot(config('services.hubspot'));\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n return new Pipedrive(config('services.pipedrive'));\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n return new Zoom(config('services.zoom-phone'));\n\n case SocialAccount::PROVIDER_OUTREACH:\n return new Outreach(config('services.outreach'));\n\n case SocialAccount::PROVIDER_SALESLOFT:\n return new Salesloft(config('services.salesloft'));\n\n case SocialAccount::PROVIDER_AIRCALL:\n return new Aircall(config('services.aircall'));\n\n case SocialAccount::PROVIDER_DIALPAD:\n return new Dialpad(config('services.dialpad'));\n\n case SocialAccount::PROVIDER_GONG:\n return new BasicAuth(config('services.gong'));\n\n case SocialAccount::PROVIDER_CLOSE:\n return new BasicAuth(config('services.close'));\n\n case SocialAccount::PROVIDER_AVAYA:\n // Avaya is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.avaya'));\n\n case SocialAccount::PROVIDER_TELUS:\n // Telus is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.telus'));\n\n case SocialAccount::PROVIDER_RINGCENTRAL:\n return new RingCentral(config('services.ringcentral'));\n\n case SocialAccount::PROVIDER_BULLHORN:\n return new Bullhorn(config('services.bullhorn'));\n\n case SocialAccount::PROVIDER_TALKDESK:\n return new Talkdesk(config('services.talkdesk'), [\n // Automatically concatenate Basic token to AuthToken requests\n 'optionProvider' => new HttpBasicAuthOptionProvider(),\n ]);\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n /**\n *\n *\n * @throws Exception\n */\n public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n /** @var LinkedInResourceOwner $providerUser */\n return $this->mapLinkedInUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESFORCE:\n /** @var SalesforceResourceOwner $providerUser */\n return $this->mapSalesforceUserData($providerUser);\n\n case SocialAccount::PROVIDER_HUBSPOT:\n /** @var HubSpotResourceOwner $providerUser */\n return $this->mapHubSpotUserData($providerUser);\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n /** @var PipedriveResourceOwner $providerUser */\n return $this->mapPipedriveUserData($providerUser);\n\n case SocialAccount::PROVIDER_GOOGLE:\n /** @var GoogleUser $providerUser */\n return $this->mapGoogleUserData($providerUser);\n\n case SocialAccount::PROVIDER_SLACK:\n /** @var SlackResourceOwner $providerUser */\n return $this->mapSlackUserData($providerUser);\n\n case SocialAccount::PROVIDER_OFFICE:\n /** @var AzureResourceOwner $providerUser */\n return $this->mapOfficeUserData($providerUser);\n\n case SocialAccount::PROVIDER_OUTREACH:\n return $this->mapOutreachUserData($providerUser);\n\n case SocialAccount::PROVIDER_DIALPAD:\n /** @var DialpadResourceOwner $providerUser*/\n return $this->mapDialpadUserData($providerUser);\n\n case SocialAccount::PROVIDER_AIRCALL:\n /** @var AircallResourceOwner $providerUser */\n return $this->mapAircallUserData($providerUser);\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n /** @var ZoomResourceOwner $providerUser */\n return $this->mapZoomPhoneUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESLOFT:\n /** @var SalesloftResourceOwner $providerUser */\n return $this->mapSalesloftUserData($providerUser);\n\n case SocialAccount::PROVIDER_BULLHORN:\n return $this->mapBullhornUserData();\n\n case SocialAccount::PROVIDER_TALKDESK:\n /** @var TalkdeskResourceOwner $providerUser */\n return $this->mapTalkdeskUserData($providerUser);\n\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_TELUS:\n /** @var RingcentralResourceOwner $providerUser */\n return $this->mapRingCentralUserData($providerUser);\n default:\n throw new InvalidEnumException('Unknown provider.');\n }\n }\n\n /**\n * Returns a new random string to use as the state parameter in an\n * authorization flow.\n *\n * @param int $length Length of the random string to be generated.\n *\n * @throws RandomException\n */\n public function getRandomState(int $length = 32): string\n {\n // Converting bytes to hex will always double length. Hence, we can reduce\n // the amount of bytes by half to produce the correct length.\n return bin2hex(random_bytes($length / 2));\n }\n\n private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount\n {\n return SocialAccount::where([\n 'provider' => $provider,\n 'provider_user_id' => $providerUser->getId(),\n ])->first();\n }\n\n /**\n * Based on the provider data, try to match to a sociable entity based on email.\n * If a match is made, create the social account under that entity.\n *\n * @throws AuthenticationException\n */\n public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User\n {\n $account = $this->getAssociation($provider, $providerUser);\n if ($account !== null && $account->hasUser()) {\n return $account->getUser();\n }\n $userData = $this->mapUserData($provider, $providerUser);\n\n // Check if we have an actual user with this email.\n /** @var User|null $user */\n $user = User::where('email', $userData['email'])->first();\n\n // If the user is trying to connect to LinkedIn, don't allow this.\n // Todo: have an interstitial page to perform 2FA to connect.\n if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {\n throw new AuthenticationException(\n 'Sorry, you\\'ll need to login through your Jiminny account to access the Conference.',\n );\n }\n\n return $user;\n }\n\n /**\n * @throws JsonException\n */\n public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount\n {\n /** @var SocialAccount $account */\n $account = $user->socialAccounts()->firstOrNew([\n 'provider' => $provider,\n ]);\n\n $account->fill([\n 'provider_user_id' => $providerUser->getId(),\n 'provider_user_token' => $this->token,\n 'expires' => $this->expires,\n 'state' => SocialAccount::STATE_CONNECTED,\n 'retry_after' => null,\n ]);\n\n // This is an optional parameter, don't overwrite the existing one with null if we don't get it.\n if ($this->refreshToken) {\n $account->fill([\n 'provider_refresh_token' => $this->refreshToken,\n 'refresh_token_expires' => $this->refreshTokenExpires,\n ]);\n }\n\n if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {\n $account->fill([\n 'auth_scope' => is_scalar($this->vendorValues['scope'])\n ? $this->vendorValues['scope']\n : json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),\n ]);\n } else {\n $account->fill([\n 'auth_scope' => null,\n ]);\n\n $this->logger->warning(\n '[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',\n // pulling directly from the token, just to avoid potential masking of the issue\n ['token_values' => $this->accessToken->getValues()],\n );\n }\n\n $account->save();\n\n // Association can be from an updated token so don't re-announce this.\n if (\n $account->wasRecentlyCreated\n && in_array($provider, SocialAccount::CRM_PROVIDERS, true)\n && $provider !== SocialAccount::PROVIDER_HUBSPOT\n && $providerUser->getId() !== null\n ) {\n $crm = $user->team->crm;\n $data = [\n 'crm_configuration_id' => $crm->id,\n 'log_notes' => Profile::LOG_NOTE_ENHANCED,\n ];\n\n $crmProfile = $user->crmProfile()->where([\n 'crm_provider_id' => $providerUser->getId(),\n ])->first();\n\n $user->crmProfile()->updateOrCreate([\n 'crm_provider_id' => $providerUser->getId(),\n ], $data);\n\n // If updated, fire reconnected\n if ($crmProfile !== null) {\n $this->eventDispatcher->dispatch(new CrmAccountReconnected($account));\n }\n }\n\n $this->eventDispatcher->dispatch(new SocialAccountConnected($account));\n\n return $account;\n }\n\n public function integrate(string $provider, User $user, Team $team): void\n {\n if ($provider === SocialAccount::PROVIDER_SLACK) {\n if (! isset($this->vendorValues['ok'])\n || $this->vendorValues['ok'] !== true\n || ! isset($this->vendorValues['token_type'])\n || $this->vendorValues['token_type'] !== 'bot'\n ) {\n // code expects V2 token, which differs slightly from V1\n throw new LogicException('Invalid token received from Slack OAuth v2 API');\n }\n\n $webhook = $this->vendorValues['incoming_webhook'];\n\n $slackTeamId = $this->vendorValues['team']['id'];\n\n $botData = [\n 'channel' => $webhook['channel'],\n 'channel_id' => $webhook['channel_id'],\n 'config_url' => $webhook['configuration_url'],\n 'webhook_url' => $webhook['url'],\n 'bot_user_id' => $this->vendorValues['bot_user_id'],\n 'bot_access_token' => $this->accessToken->getToken(),\n ];\n\n $slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);\n\n if ($slackBot->wasRecentlyCreated) {\n // Send Slack notification.\n $user->notify(new SlackBotAdded());\n }\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);\n\n $this->logger->info('[SocialAccountService] Fetching token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $account->refresh();\n\n if (\n ! $forceRefresh\n && ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))\n ) {\n $this->logger->info('[SocialAccountService] Token retrieved', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);\n\n return $this->encryptedTokenManager->getAccessToken($account);\n }\n\n try {\n $this->logger->info('[SocialAccountService] Token needs refreshing', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n return $this->refreshToken($account, $forceRefresh);\n } catch (IdentityProviderException $exception) {\n $responseBody = $exception->getResponseBody();\n\n if ($responseBody instanceof Response) {\n $responseBody = $responseBody->getBody();\n }\n\n if (is_object($responseBody) && method_exists($responseBody, '__toString')) {\n $responseBody = $responseBody->__toString();\n }\n\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'responseBody' => $responseBody,\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logger->error('[SocialAccountService] Cannot obtain token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception::class,\n 'errorMessage' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {\n $this->logger->error('[SocialAccountService] Full refresh required', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n // Something terrible happened their token, they need to reconnect.\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n $this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));\n }\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n }\n }\n\n public function refreshSocialAccountToken(SocialAccount $socialAccount): void\n {\n try {\n $this->getToken($socialAccount);\n } catch (Throwable $e) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $socialAccount->getId(),\n 'provider' => $socialAccount->getProviderName(),\n 'reason' => $e->getMessage(),\n ]);\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);\n\n $newToken = null;\n\n Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)\n ->block(8, function () use ($account, $forceRefresh, &$newToken): void {\n try {\n $account->refresh();\n $token = $this->encryptedTokenManager->getAccessToken($account);\n\n if (! $forceRefresh && $this->hasValidToken($account)) {\n $newToken = $token;\n\n return;\n }\n\n if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {\n $this->logger->error('[SocialAccountService] Refresh token not found', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog(\n $account,\n self::TOKEN_STATE_REFRESH,\n self::TOKEN_RESULT_FAILURE,\n );\n\n throw new SocialAccountTokenInvalidException(\n 'Refresh token is not set, re-connection required.',\n );\n }\n\n $this->logger->info('[SocialAccountService] Refreshing token from provider', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),\n 'state' => $account->getState(),\n ]);\n\n $newToken = $this->getProvider($account->provider)\n ->getAccessToken('refresh_token', [\n 'refresh_token' => $token->getRefreshToken(),\n ])\n ;\n\n if ($newToken->getToken() === $token->getToken()) {\n $this->logger->info('[SocialAccountService] Refreshed with an identical token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n }\n } catch (ConnectException | RequestException $exception) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n // This usually occurs due to SSL errors.\n throw new SocialAccountTokenInvalidException(\n 'Token could not be refreshed.',\n $exception->getCode(),\n $exception,\n );\n }\n\n $account->provider_user_token = $newToken->getToken();\n $account->expires = $newToken->getExpires();\n $account->state = SocialAccount::STATE_CONNECTED;\n\n if ($newToken->getRefreshToken()) {\n $account->provider_refresh_token = $newToken->getRefreshToken();\n $values = $newToken->getValues();\n $account->refresh_token_expires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n $account->save();\n });\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);\n\n $this->logger->info('[SocialAccountService] Token refreshed', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'state' => $account->getState(),\n ]);\n\n return $newToken;\n }\n\n /**\n * @return string[]\n */\n private function getAccessScope(string $provider): array\n {\n $scopes = [];\n $providerScopes = config('services.' . $provider . '.scope');\n\n if ($providerScopes) {\n $scopes = preg_split('/\\s+/', $providerScopes);\n }\n\n return $scopes;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getAuthorizationOptions(string $provider): array\n {\n $scopes = ['scope' => $this->getAccessScope($provider)];\n\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n case SocialAccount::PROVIDER_SALESFORCE:\n case SocialAccount::PROVIDER_HUBSPOT:\n case SocialAccount::PROVIDER_OUTREACH:\n case SocialAccount::PROVIDER_SALESLOFT:\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n case SocialAccount::PROVIDER_PIPEDRIVE:\n case SocialAccount::PROVIDER_SLACK:\n case SocialAccount::PROVIDER_AIRCALL:\n case SocialAccount::PROVIDER_BULLHORN:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_TELUS:\n case SocialAccount::PROVIDER_DIALPAD:\n case SocialAccount::PROVIDER_TALKDESK:\n return $scopes;\n\n case SocialAccount::PROVIDER_OFFICE:\n return $scopes + [\n 'access_type' => 'offline',\n ];\n\n case SocialAccount::PROVIDER_GOOGLE:\n return $scopes + [\n 'access_type' => 'offline',\n 'include_granted_scopes' => 'true',\n 'approval_prompt' => null,\n ];\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n private function tokenDoesNotExpire(SocialAccount $account): bool\n {\n return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);\n }\n\n private function hasValidToken(SocialAccount $account): bool\n {\n return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();\n }\n\n private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void\n {\n Datadog::increment('jiminny.access_token', 1, [\n 'provider' => $account->getProviderName(),\n 'state' => $state,\n 'result' => $result,\n ]);\n }\n\n private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),\n ];\n }\n\n private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n try {\n $parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);\n $number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);\n } catch (NumberParseException) {\n $number = null;\n }\n\n // Todo: this should check the `organization_id` matches the parent crm configuration.\n\n return [\n 'country_code' => $this->countryCode,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),\n 'phone' => $number,\n 'crm_provider_id' => $rawUserData['organization_id'],\n 'crm_base_url' => $this->vendorValues['instance_url'],\n ];\n }\n\n /**\n * Todo: this should check the `getHubId` matches the parent crm configuration.\n */\n private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array\n {\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $providerUser->getHubId(),\n 'crm_base_url' => $providerUser->toArray()['hub_domain'],\n ];\n }\n\n /**\n * Todo: this should check the `getCompanyId` matches the parent crm configuration.\n */\n private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $rawUserData['data']['company_id'],\n 'crm_base_url' => 'https://' . $rawUserData['data']['company_domain'] . '.pipedrive.com',\n ];\n }\n\n private function mapGoogleUserData(GoogleUser $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($providerUser->getEmail()),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapSlackUserData(SlackResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getRealName(),\n ];\n }\n\n private function mapOfficeUserData(AzureResourceOwner $providerUser): array\n {\n $email = $providerUser->getUpn() ?? $providerUser->claim('email');\n\n $this->logger->info('[Office] User authenticated', $providerUser->toArray());\n\n $name = $providerUser->claim('name') ??\n $providerUser->getFirstName() . ' ' . $providerUser->getLastName();\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($email),\n 'name' => $name,\n ];\n }\n\n private function mapOutreachUserData(ResourceOwnerInterface $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n $socialProvider = $this->getProvider(SocialAccount::PROVIDER_OUTREACH);\n $url = 'https://api.outreach.io/api/v2/profiles/';\n\n try {\n $request = $socialProvider->getAuthenticatedRequest(\n 'get',\n $url . $rawUserData['meta']['user']['id'],\n $this->accessToken,\n );\n\n $response = $socialProvider->getParsedResponse($request);\n\n $this->logger->info('[Outreach] User authenticated', $response);\n } catch (Exception) {\n //Just ignore\n }\n\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapDialpadUserData(DialpadResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n // They need to be Super Admin to access the Company APIs.\n $this->logger->info('[Dialpad] User authenticated', $rawUserData);\n\n if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Dialpad Super Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapAircallUserData(AircallResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array\n {\n if ($providerUser->toArray()['data']['team_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Team Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapBullhornUserData(): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n\n private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\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}]...
|
-5357074168035599503
|
-8880471945877483717
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
6
8
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Services;
/**
* @todo cleanup after #slack-oauth-v2
*/
use AdamPaterson\OAuth2\Client\Provider\SlackResourceOwner;
use Chadhutchins\OAuth2\Client\Provider\Slack;
use ChaseConey\LaravelDatadogHelper\Datadog;
use Daniti\OAuth2\Client\Provider\Pipedrive;
use Daniti\OAuth2\Client\Provider\PipedriveResourceOwner;
use Exception;
use Flipbox\OAuth2\Client\Provider\HubSpot;
use Flipbox\OAuth2\Client\Provider\HubSpotResourceOwner;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Response;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Support\Facades\Cache;
use Jiminny\Component\Encryption\EncryptedTokenManager;
use Jiminny\Events\Users\CrmAccountReconnected;
use Jiminny\Events\Users\SocialAccountConnected;
use Jiminny\Events\Users\SocialAccountDisconnected;
use Jiminny\Exceptions\ActivityProviderException;
use Jiminny\Exceptions\InvalidEnumException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Models\Crm\Profile;
use Jiminny\Models\SocialAccount;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Notifications\SlackBotAdded;
use Jiminny\OAuth2\Client\Provider\Aircall;
use Jiminny\OAuth2\Client\Provider\AircallResourceOwner;
use Jiminny\OAuth2\Client\Provider\Bullhorn;
use Jiminny\OAuth2\Client\Provider\Dialpad;
use Jiminny\OAuth2\Client\Provider\DialpadResourceOwner;
use Jiminny\OAuth2\Client\Provider\Salesloft;
use Jiminny\OAuth2\Client\Provider\SalesloftResourceOwner;
use Jiminny\Services\Activity\Talkdesk\Provider\Talkdesk;
use Jiminny\Services\Activity\Talkdesk\Provider\TalkdeskResourceOwner;
use Jiminny\Services\Activity\Zoom\Provider\Zoom;
use Jiminny\Services\Activity\Zoom\Provider\ZoomResourceOwner;
use Jiminny\Services\OAuth2\Provider\BasicAuth;
use Jiminny\Services\OAuth2\Provider\Outreach;
use JsonException;
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\Google;
use League\OAuth2\Client\Provider\GoogleUser;
use League\OAuth2\Client\Provider\LinkedIn;
use League\OAuth2\Client\Provider\LinkedInResourceOwner;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Token\AccessTokenInterface;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberUtil;
use LogicException;
use Psr\Log\LoggerInterface;
use Random\RandomException;
use Stevenmaguire\OAuth2\Client\Provider\Salesforce;
use Stevenmaguire\OAuth2\Client\Provider\SalesforceResourceOwner;
use TheNetworg\OAuth2\Client\Provider\Azure;
use TheNetworg\OAuth2\Client\Provider\AzureResourceOwner;
use Throwable;
use TMannherz\OAuth2\Client\Provider\RingCentral;
use TMannherz\OAuth2\Client\Provider\RingcentralResourceOwner;
class SocialAccountService
{
/**
* Get a fresh tokens 5 minutes before it expires
* That should minimise the number of failed requests due to expired token
* for long-running jobs that reuse the same token for pulling lots of data.
*/
private const int REFRESH_OFFSET_MIN = 5;
private const string TOKEN_STATE_FETCH = 'fetch';
private const string TOKEN_STATE_REFRESH = 'refresh';
private const string TOKEN_RESULT_ATTEMPT = 'attempt';
private const string TOKEN_RESULT_SUCCESS = 'success';
private const string TOKEN_RESULT_FAILURE = 'failure';
private ?AccessTokenInterface $accessToken = null;
private ?string $token = null;
private ?string $refreshToken = null;
private ?int $expires = null;
private ?string $countryCode = null;
private ?string $timezone = null;
private ?array $vendorValues = null;
private ?int $refreshTokenExpires = null;
public function __construct(
private readonly EncryptedTokenManager $encryptedTokenManager,
private readonly LoggerInterface $logger,
private readonly PhoneNumberUtil $phoneNumberUtil,
private readonly Dispatcher $eventDispatcher,
) {
}
public function setVendorValues(array $values): void
{
$this->vendorValues = $values;
}
public function setAccessToken(AccessTokenInterface $accessToken): void
{
$this->accessToken = $accessToken;
// Todo: Also set these other params from this token e.g. refreshToken
}
public function setToken(?string $token): void
{
$this->token = $token;
}
public function setRefreshToken(?string $refreshToken): void
{
$this->refreshToken = $refreshToken;
}
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
public function setTimezone(string $timezone): void
{
$this->timezone = $timezone;
}
public function setExpires(?int $expiry): void
{
$this->expires = $expiry;
}
public function setRefreshTokenExpires(array $values): void
{
$this->refreshTokenExpires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
/**
* @throws InvalidEnumException
*/
public function getProvider(string $provider): AbstractProvider
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
return new LinkedIn(config('services.linkedin'));
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
$socialProvider = new LinkedIn(config('services.linkedin-conference'));
$socialProvider->withFields([
'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',
]);
return $socialProvider;
case SocialAccount::PROVIDER_SALESFORCE:
return new Salesforce(config('services.salesforce'));
case SocialAccount::PROVIDER_GOOGLE:
return new Google(config('services.google'));
case SocialAccount::PROVIDER_SLACK:
return new Slack(config('services.slack'));
case SocialAccount::PROVIDER_OFFICE:
$config = config('services.office');
// Convert string scope to array format expected by Azure provider
if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {
$config['scopes'] = array_filter(preg_split('/\s+/', trim($config['scope'])));
unset($config['scope']);
}
$socialProvider = new Azure($config);
$socialProvider->urlAPI = '[URL_WITH_CREDENTIALS] Exception
*/
public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
/** @var LinkedInResourceOwner $providerUser */
return $this->mapLinkedInUserData($providerUser);
case SocialAccount::PROVIDER_SALESFORCE:
/** @var SalesforceResourceOwner $providerUser */
return $this->mapSalesforceUserData($providerUser);
case SocialAccount::PROVIDER_HUBSPOT:
/** @var HubSpotResourceOwner $providerUser */
return $this->mapHubSpotUserData($providerUser);
case SocialAccount::PROVIDER_PIPEDRIVE:
/** @var PipedriveResourceOwner $providerUser */
return $this->mapPipedriveUserData($providerUser);
case SocialAccount::PROVIDER_GOOGLE:
/** @var GoogleUser $providerUser */
return $this->mapGoogleUserData($providerUser);
case SocialAccount::PROVIDER_SLACK:
/** @var SlackResourceOwner $providerUser */
return $this->mapSlackUserData($providerUser);
case SocialAccount::PROVIDER_OFFICE:
/** @var AzureResourceOwner $providerUser */
return $this->mapOfficeUserData($providerUser);
case SocialAccount::PROVIDER_OUTREACH:
return $this->mapOutreachUserData($providerUser);
case SocialAccount::PROVIDER_DIALPAD:
/** @var DialpadResourceOwner $providerUser*/
return $this->mapDialpadUserData($providerUser);
case SocialAccount::PROVIDER_AIRCALL:
/** @var AircallResourceOwner $providerUser */
return $this->mapAircallUserData($providerUser);
case SocialAccount::PROVIDER_ZOOM_PHONE:
/** @var ZoomResourceOwner $providerUser */
return $this->mapZoomPhoneUserData($providerUser);
case SocialAccount::PROVIDER_SALESLOFT:
/** @var SalesloftResourceOwner $providerUser */
return $this->mapSalesloftUserData($providerUser);
case SocialAccount::PROVIDER_BULLHORN:
return $this->mapBullhornUserData();
case SocialAccount::PROVIDER_TALKDESK:
/** @var TalkdeskResourceOwner $providerUser */
return $this->mapTalkdeskUserData($providerUser);
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_TELUS:
/** @var RingcentralResourceOwner $providerUser */
return $this->mapRingCentralUserData($providerUser);
default:
throw new InvalidEnumException('Unknown provider.');
}
}
/**
* Returns a new random string to use as the state parameter in an
* authorization flow.
*
* @param int $length Length of the random string to be generated.
*
* @throws RandomException
*/
public function getRandomState(int $length = 32): string
{
// Converting bytes to hex will always double length. Hence, we can reduce
// the amount of bytes by half to produce the correct length.
return bin2hex(random_bytes($length / 2));
}
private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount
{
return SocialAccount::where([
'provider' => $provider,
'provider_user_id' => $providerUser->getId(),
])->first();
}
/**
* Based on the provider data, try to match to a sociable entity based on email.
* If a match is made, create the social account under that entity.
*
* @throws AuthenticationException
*/
public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User
{
$account = $this->getAssociation($provider, $providerUser);
if ($account !== null && $account->hasUser()) {
return $account->getUser();
}
$userData = $this->mapUserData($provider, $providerUser);
// Check if we have an actual user with this email.
/** @var User|null $user */
$user = User::where('email', $userData['email'])->first();
// If the user is trying to connect to LinkedIn, don't allow this.
// Todo: have an interstitial page to perform 2FA to connect.
if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {
throw new AuthenticationException(
'Sorry, you\'ll need to login through your Jiminny account to access the Conference.',
);
}
return $user;
}
/**
* @throws JsonException
*/
public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount
{
/** @var SocialAccount $account */
$account = $user->socialAccounts()->firstOrNew([
'provider' => $provider,
]);
$account->fill([
'provider_user_id' => $providerUser->getId(),
'provider_user_token' => $this->token,
'expires' => $this->expires,
'state' => SocialAccount::STATE_CONNECTED,
'retry_after' => null,
]);
// This is an optional parameter, don't overwrite the existing one with null if we don't get it.
if ($this->refreshToken) {
$account->fill([
'provider_refresh_token' => $this->refreshToken,
'refresh_token_expires' => $this->refreshTokenExpires,
]);
}
if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {
$account->fill([
'auth_scope' => is_scalar($this->vendorValues['scope'])
? $this->vendorValues['scope']
: json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),
]);
} else {
$account->fill([
'auth_scope' => null,
]);
$this->logger->warning(
'[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',
// pulling directly from the token, just to avoid potential masking of the issue
['token_values' => $this->accessToken->getValues()],
);
}
$account->save();
// Association can be from an updated token so don't re-announce this.
if (
$account->wasRecentlyCreated
&& in_array($provider, SocialAccount::CRM_PROVIDERS, true)
&& $provider !== SocialAccount::PROVIDER_HUBSPOT
&& $providerUser->getId() !== null
) {
$crm = $user->team->crm;
$data = [
'crm_configuration_id' => $crm->id,
'log_notes' => Profile::LOG_NOTE_ENHANCED,
];
$crmProfile = $user->crmProfile()->where([
'crm_provider_id' => $providerUser->getId(),
])->first();
$user->crmProfile()->updateOrCreate([
'crm_provider_id' => $providerUser->getId(),
], $data);
// If updated, fire reconnected
if ($crmProfile !== null) {
$this->eventDispatcher->dispatch(new CrmAccountReconnected($account));
}
}
$this->eventDispatcher->dispatch(new SocialAccountConnected($account));
return $account;
}
public function integrate(string $provider, User $user, Team $team): void
{
if ($provider === SocialAccount::PROVIDER_SLACK) {
if (! isset($this->vendorValues['ok'])
|| $this->vendorValues['ok'] !== true
|| ! isset($this->vendorValues['token_type'])
|| $this->vendorValues['token_type'] !== 'bot'
) {
// code expects V2 token, which differs slightly from V1
throw new LogicException('Invalid token received from Slack OAuth v2 API');
}
$webhook = $this->vendorValues['incoming_webhook'];
$slackTeamId = $this->vendorValues['team']['id'];
$botData = [
'channel' => $webhook['channel'],
'channel_id' => $webhook['channel_id'],
'config_url' => $webhook['configuration_url'],
'webhook_url' => $webhook['url'],
'bot_user_id' => $this->vendorValues['bot_user_id'],
'bot_access_token' => $this->accessToken->getToken(),
];
$slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);
if ($slackBot->wasRecentlyCreated) {
// Send Slack notification.
$user->notify(new SlackBotAdded());
}
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);
$this->logger->info('[SocialAccountService] Fetching token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$account->refresh();
if (
! $forceRefresh
&& ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))
) {
$this->logger->info('[SocialAccountService] Token retrieved', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);
return $this->encryptedTokenManager->getAccessToken($account);
}
try {
$this->logger->info('[SocialAccountService] Token needs refreshing', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
return $this->refreshToken($account, $forceRefresh);
} catch (IdentityProviderException $exception) {
$responseBody = $exception->getResponseBody();
if ($responseBody instanceof Response) {
$responseBody = $responseBody->getBody();
}
if (is_object($responseBody) && method_exists($responseBody, '__toString')) {
$responseBody = $responseBody->__toString();
}
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'responseBody' => $responseBody,
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logger->error('[SocialAccountService] Cannot obtain token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception::class,
'errorMessage' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {
$this->logger->error('[SocialAccountService] Full refresh required', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
// Something terrible happened their token, they need to reconnect.
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
$this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));
}
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
}
}
public function refreshSocialAccountToken(SocialAccount $socialAccount): void
{
try {
$this->getToken($socialAccount);
} catch (Throwable $e) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $socialAccount->getId(),
'provider' => $socialAccount->getProviderName(),
'reason' => $e->getMessage(),
]);
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);
$newToken = null;
Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)
->block(8, function () use ($account, $forceRefresh, &$newToken): void {
try {
$account->refresh();
$token = $this->encryptedTokenManager->getAccessToken($account);
if (! $forceRefresh && $this->hasValidToken($account)) {
$newToken = $token;
return;
}
if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {
$this->logger->error('[SocialAccountService] Refresh token not found', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog(
$account,
self::TOKEN_STATE_REFRESH,
self::TOKEN_RESULT_FAILURE,
);
throw new SocialAccountTokenInvalidException(
'Refresh token is not set, re-connection required.',
);
}
$this->logger->info('[SocialAccountService] Refreshing token from provider', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),
'state' => $account->getState(),
]);
$newToken = $this->getProvider($account->provider)
->getAccessToken('refresh_token', [
'refresh_token' => $token->getRefreshToken(),
])
;
if ($newToken->getToken() === $token->getToken()) {
$this->logger->info('[SocialAccountService] Refreshed with an identical token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
}
} catch (ConnectException | RequestException $exception) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
// This usually occurs due to SSL errors.
throw new SocialAccountTokenInvalidException(
'Token could not be refreshed.',
$exception->getCode(),
$exception,
);
}
$account->provider_user_token = $newToken->getToken();
$account->expires = $newToken->getExpires();
$account->state = SocialAccount::STATE_CONNECTED;
if ($newToken->getRefreshToken()) {
$account->provider_refresh_token = $newToken->getRefreshToken();
$values = $newToken->getValues();
$account->refresh_token_expires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
$account->save();
});
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);
$this->logger->info('[SocialAccountService] Token refreshed', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'state' => $account->getState(),
]);
return $newToken;
}
/**
* @return string[]
*/
private function getAccessScope(string $provider): array
{
$scopes = [];
$providerScopes = config('services.' . $provider . '.scope');
if ($providerScopes) {
$scopes = preg_split('/\s+/', $providerScopes);
}
return $scopes;
}
/**
* @throws InvalidEnumException
*/
public function getAuthorizationOptions(string $provider): array
{
$scopes = ['scope' => $this->getAccessScope($provider)];
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
case SocialAccount::PROVIDER_SALESFORCE:
case SocialAccount::PROVIDER_HUBSPOT:
case SocialAccount::PROVIDER_OUTREACH:
case SocialAccount::PROVIDER_SALESLOFT:
case SocialAccount::PROVIDER_ZOOM_PHONE:
case SocialAccount::PROVIDER_PIPEDRIVE:
case SocialAccount::PROVIDER_SLACK:
case SocialAccount::PROVIDER_AIRCALL:
case SocialAccount::PROVIDER_BULLHORN:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_TELUS:
case SocialAccount::PROVIDER_DIALPAD:
case SocialAccount::PROVIDER_TALKDESK:
return $scopes;
case SocialAccount::PROVIDER_OFFICE:
return $scopes + [
'access_type' => 'offline',
];
case SocialAccount::PROVIDER_GOOGLE:
return $scopes + [
'access_type' => 'offline',
'include_granted_scopes' => 'true',
'approval_prompt' => null,
];
default:
throw new InvalidEnumException();
}
}
private function tokenDoesNotExpire(SocialAccount $account): bool
{
return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);
}
private function hasValidToken(SocialAccount $account): bool
{
return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();
}
private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void
{
Datadog::increment('jiminny.access_token', 1, [
'provider' => $account->getProviderName(),
'state' => $state,
'result' => $result,
]);
}
private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),
];
}
private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
try {
$parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);
$number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);
} catch (NumberParseException) {
$number = null;
}
// Todo: this should check the `organization_id` matches the parent crm configuration.
return [
'country_code' => $this->countryCode,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),
'phone' => $number,
'crm_provider_id' => $rawUserData['organization_id'],
'crm_base_url' => $this->vendorValues['instance_url'],
];
}
/**
* Todo: this should check the `getHubId` matches the parent crm configuration.
*/
private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $providerUser->getHubId(),
'crm_base_url' => $providerUser->toArray()['hub_domain'],
];
}
/**
* Todo: this should check the `getCompanyId` matches the parent crm configuration.
*/
private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $rawUserData['data']['company_id'],
'crm_base_url' => '[URL_WITH_CREDENTIALS] ActivityProviderException
*/
private function mapDialpadUserData(DialpadResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
// They need to be Super Admin to access the Company APIs.
$this->logger->info('[Dialpad] User authenticated', $rawUserData);
if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Dialpad Super Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapAircallUserData(AircallResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
/**
* @throws ActivityProviderException
*/
private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array
{
if ($providerUser->toArray()['data']['team_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Team Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapBullhornUserData(): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
];
}
private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
}
Execute
Explain Plan...
|
34713
|
NULL
|
NULL
|
NULL
|
|
34716
|
1300
|
6
|
2026-05-13T11:34:54.528746+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-13/1778 /Users/lukas/.screenpipe/data/data/2026-05-13/1778672094528_m2.jpg...
|
PhpStorm
|
faVsco.js – SocialAccountService.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
6
8
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Services;
/**
* @todo cleanup after #slack-oauth-v2
*/
use AdamPaterson\OAuth2\Client\Provider\SlackResourceOwner;
use Chadhutchins\OAuth2\Client\Provider\Slack;
use ChaseConey\LaravelDatadogHelper\Datadog;
use Daniti\OAuth2\Client\Provider\Pipedrive;
use Daniti\OAuth2\Client\Provider\PipedriveResourceOwner;
use Exception;
use Flipbox\OAuth2\Client\Provider\HubSpot;
use Flipbox\OAuth2\Client\Provider\HubSpotResourceOwner;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Response;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Support\Facades\Cache;
use Jiminny\Component\Encryption\EncryptedTokenManager;
use Jiminny\Events\Users\CrmAccountReconnected;
use Jiminny\Events\Users\SocialAccountConnected;
use Jiminny\Events\Users\SocialAccountDisconnected;
use Jiminny\Exceptions\ActivityProviderException;
use Jiminny\Exceptions\InvalidEnumException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Models\Crm\Profile;
use Jiminny\Models\SocialAccount;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Notifications\SlackBotAdded;
use Jiminny\OAuth2\Client\Provider\Aircall;
use Jiminny\OAuth2\Client\Provider\AircallResourceOwner;
use Jiminny\OAuth2\Client\Provider\Bullhorn;
use Jiminny\OAuth2\Client\Provider\Dialpad;
use Jiminny\OAuth2\Client\Provider\DialpadResourceOwner;
use Jiminny\OAuth2\Client\Provider\Salesloft;
use Jiminny\OAuth2\Client\Provider\SalesloftResourceOwner;
use Jiminny\Services\Activity\Talkdesk\Provider\Talkdesk;
use Jiminny\Services\Activity\Talkdesk\Provider\TalkdeskResourceOwner;
use Jiminny\Services\Activity\Zoom\Provider\Zoom;
use Jiminny\Services\Activity\Zoom\Provider\ZoomResourceOwner;
use Jiminny\Services\OAuth2\Provider\BasicAuth;
use Jiminny\Services\OAuth2\Provider\Outreach;
use JsonException;
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\Google;
use League\OAuth2\Client\Provider\GoogleUser;
use League\OAuth2\Client\Provider\LinkedIn;
use League\OAuth2\Client\Provider\LinkedInResourceOwner;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Token\AccessTokenInterface;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberUtil;
use LogicException;
use Psr\Log\LoggerInterface;
use Random\RandomException;
use Stevenmaguire\OAuth2\Client\Provider\Salesforce;
use Stevenmaguire\OAuth2\Client\Provider\SalesforceResourceOwner;
use TheNetworg\OAuth2\Client\Provider\Azure;
use TheNetworg\OAuth2\Client\Provider\AzureResourceOwner;
use Throwable;
use TMannherz\OAuth2\Client\Provider\RingCentral;
use TMannherz\OAuth2\Client\Provider\RingcentralResourceOwner;
class SocialAccountService
{
/**
* Get a fresh tokens 5 minutes before it expires
* That should minimise the number of failed requests due to expired token
* for long-running jobs that reuse the same token for pulling lots of data.
*/
private const int REFRESH_OFFSET_MIN = 5;
private const string TOKEN_STATE_FETCH = 'fetch';
private const string TOKEN_STATE_REFRESH = 'refresh';
private const string TOKEN_RESULT_ATTEMPT = 'attempt';
private const string TOKEN_RESULT_SUCCESS = 'success';
private const string TOKEN_RESULT_FAILURE = 'failure';
private ?AccessTokenInterface $accessToken = null;
private ?string $token = null;
private ?string $refreshToken = null;
private ?int $expires = null;
private ?string $countryCode = null;
private ?string $timezone = null;
private ?array $vendorValues = null;
private ?int $refreshTokenExpires = null;
public function __construct(
private readonly EncryptedTokenManager $encryptedTokenManager,
private readonly LoggerInterface $logger,
private readonly PhoneNumberUtil $phoneNumberUtil,
private readonly Dispatcher $eventDispatcher,
) {
}
public function setVendorValues(array $values): void
{
$this->vendorValues = $values;
}
public function setAccessToken(AccessTokenInterface $accessToken): void
{
$this->accessToken = $accessToken;
// Todo: Also set these other params from this token e.g. refreshToken
}
public function setToken(?string $token): void
{
$this->token = $token;
}
public function setRefreshToken(?string $refreshToken): void
{
$this->refreshToken = $refreshToken;
}
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
public function setTimezone(string $timezone): void
{
$this->timezone = $timezone;
}
public function setExpires(?int $expiry): void
{
$this->expires = $expiry;
}
public function setRefreshTokenExpires(array $values): void
{
$this->refreshTokenExpires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
/**
* @throws InvalidEnumException
*/
public function getProvider(string $provider): AbstractProvider
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
return new LinkedIn(config('services.linkedin'));
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
$socialProvider = new LinkedIn(config('services.linkedin-conference'));
$socialProvider->withFields([
'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',
]);
return $socialProvider;
case SocialAccount::PROVIDER_SALESFORCE:
return new Salesforce(config('services.salesforce'));
case SocialAccount::PROVIDER_GOOGLE:
return new Google(config('services.google'));
case SocialAccount::PROVIDER_SLACK:
return new Slack(config('services.slack'));
case SocialAccount::PROVIDER_OFFICE:
$config = config('services.office');
// Convert string scope to array format expected by Azure provider
if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {
$config['scopes'] = array_filter(preg_split('/\s+/', trim($config['scope'])));
unset($config['scope']);
}
$socialProvider = new Azure($config);
$socialProvider->urlAPI = '[URL_WITH_CREDENTIALS] Exception
*/
public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
/** @var LinkedInResourceOwner $providerUser */
return $this->mapLinkedInUserData($providerUser);
case SocialAccount::PROVIDER_SALESFORCE:
/** @var SalesforceResourceOwner $providerUser */
return $this->mapSalesforceUserData($providerUser);
case SocialAccount::PROVIDER_HUBSPOT:
/** @var HubSpotResourceOwner $providerUser */
return $this->mapHubSpotUserData($providerUser);
case SocialAccount::PROVIDER_PIPEDRIVE:
/** @var PipedriveResourceOwner $providerUser */
return $this->mapPipedriveUserData($providerUser);
case SocialAccount::PROVIDER_GOOGLE:
/** @var GoogleUser $providerUser */
return $this->mapGoogleUserData($providerUser);
case SocialAccount::PROVIDER_SLACK:
/** @var SlackResourceOwner $providerUser */
return $this->mapSlackUserData($providerUser);
case SocialAccount::PROVIDER_OFFICE:
/** @var AzureResourceOwner $providerUser */
return $this->mapOfficeUserData($providerUser);
case SocialAccount::PROVIDER_OUTREACH:
return $this->mapOutreachUserData($providerUser);
case SocialAccount::PROVIDER_DIALPAD:
/** @var DialpadResourceOwner $providerUser*/
return $this->mapDialpadUserData($providerUser);
case SocialAccount::PROVIDER_AIRCALL:
/** @var AircallResourceOwner $providerUser */
return $this->mapAircallUserData($providerUser);
case SocialAccount::PROVIDER_ZOOM_PHONE:
/** @var ZoomResourceOwner $providerUser */
return $this->mapZoomPhoneUserData($providerUser);
case SocialAccount::PROVIDER_SALESLOFT:
/** @var SalesloftResourceOwner $providerUser */
return $this->mapSalesloftUserData($providerUser);
case SocialAccount::PROVIDER_BULLHORN:
return $this->mapBullhornUserData();
case SocialAccount::PROVIDER_TALKDESK:
/** @var TalkdeskResourceOwner $providerUser */
return $this->mapTalkdeskUserData($providerUser);
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_TELUS:
/** @var RingcentralResourceOwner $providerUser */
return $this->mapRingCentralUserData($providerUser);
default:
throw new InvalidEnumException('Unknown provider.');
}
}
/**
* Returns a new random string to use as the state parameter in an
* authorization flow.
*
* @param int $length Length of the random string to be generated.
*
* @throws RandomException
*/
public function getRandomState(int $length = 32): string
{
// Converting bytes to hex will always double length. Hence, we can reduce
// the amount of bytes by half to produce the correct length.
return bin2hex(random_bytes($length / 2));
}
private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount
{
return SocialAccount::where([
'provider' => $provider,
'provider_user_id' => $providerUser->getId(),
])->first();
}
/**
* Based on the provider data, try to match to a sociable entity based on email.
* If a match is made, create the social account under that entity.
*
* @throws AuthenticationException
*/
public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User
{
$account = $this->getAssociation($provider, $providerUser);
if ($account !== null && $account->hasUser()) {
return $account->getUser();
}
$userData = $this->mapUserData($provider, $providerUser);
// Check if we have an actual user with this email.
/** @var User|null $user */
$user = User::where('email', $userData['email'])->first();
// If the user is trying to connect to LinkedIn, don't allow this.
// Todo: have an interstitial page to perform 2FA to connect.
if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {
throw new AuthenticationException(
'Sorry, you\'ll need to login through your Jiminny account to access the Conference.',
);
}
return $user;
}
/**
* @throws JsonException
*/
public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount
{
/** @var SocialAccount $account */
$account = $user->socialAccounts()->firstOrNew([
'provider' => $provider,
]);
$account->fill([
'provider_user_id' => $providerUser->getId(),
'provider_user_token' => $this->token,
'expires' => $this->expires,
'state' => SocialAccount::STATE_CONNECTED,
'retry_after' => null,
]);
// This is an optional parameter, don't overwrite the existing one with null if we don't get it.
if ($this->refreshToken) {
$account->fill([
'provider_refresh_token' => $this->refreshToken,
'refresh_token_expires' => $this->refreshTokenExpires,
]);
}
if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {
$account->fill([
'auth_scope' => is_scalar($this->vendorValues['scope'])
? $this->vendorValues['scope']
: json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),
]);
} else {
$account->fill([
'auth_scope' => null,
]);
$this->logger->warning(
'[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',
// pulling directly from the token, just to avoid potential masking of the issue
['token_values' => $this->accessToken->getValues()],
);
}
$account->save();
// Association can be from an updated token so don't re-announce this.
if (
$account->wasRecentlyCreated
&& in_array($provider, SocialAccount::CRM_PROVIDERS, true)
&& $provider !== SocialAccount::PROVIDER_HUBSPOT
&& $providerUser->getId() !== null
) {
$crm = $user->team->crm;
$data = [
'crm_configuration_id' => $crm->id,
'log_notes' => Profile::LOG_NOTE_ENHANCED,
];
$crmProfile = $user->crmProfile()->where([
'crm_provider_id' => $providerUser->getId(),
])->first();
$user->crmProfile()->updateOrCreate([
'crm_provider_id' => $providerUser->getId(),
], $data);
// If updated, fire reconnected
if ($crmProfile !== null) {
$this->eventDispatcher->dispatch(new CrmAccountReconnected($account));
}
}
$this->eventDispatcher->dispatch(new SocialAccountConnected($account));
return $account;
}
public function integrate(string $provider, User $user, Team $team): void
{
if ($provider === SocialAccount::PROVIDER_SLACK) {
if (! isset($this->vendorValues['ok'])
|| $this->vendorValues['ok'] !== true
|| ! isset($this->vendorValues['token_type'])
|| $this->vendorValues['token_type'] !== 'bot'
) {
// code expects V2 token, which differs slightly from V1
throw new LogicException('Invalid token received from Slack OAuth v2 API');
}
$webhook = $this->vendorValues['incoming_webhook'];
$slackTeamId = $this->vendorValues['team']['id'];
$botData = [
'channel' => $webhook['channel'],
'channel_id' => $webhook['channel_id'],
'config_url' => $webhook['configuration_url'],
'webhook_url' => $webhook['url'],
'bot_user_id' => $this->vendorValues['bot_user_id'],
'bot_access_token' => $this->accessToken->getToken(),
];
$slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);
if ($slackBot->wasRecentlyCreated) {
// Send Slack notification.
$user->notify(new SlackBotAdded());
}
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);
$this->logger->info('[SocialAccountService] Fetching token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$account->refresh();
if (
! $forceRefresh
&& ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))
) {
$this->logger->info('[SocialAccountService] Token retrieved', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);
return $this->encryptedTokenManager->getAccessToken($account);
}
try {
$this->logger->info('[SocialAccountService] Token needs refreshing', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
return $this->refreshToken($account, $forceRefresh);
} catch (IdentityProviderException $exception) {
$responseBody = $exception->getResponseBody();
if ($responseBody instanceof Response) {
$responseBody = $responseBody->getBody();
}
if (is_object($responseBody) && method_exists($responseBody, '__toString')) {
$responseBody = $responseBody->__toString();
}
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'responseBody' => $responseBody,
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logger->error('[SocialAccountService] Cannot obtain token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception::class,
'errorMessage' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {
$this->logger->error('[SocialAccountService] Full refresh required', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
// Something terrible happened their token, they need to reconnect.
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
$this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));
}
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
}
}
public function refreshSocialAccountToken(SocialAccount $socialAccount): void
{
try {
$this->getToken($socialAccount);
} catch (Throwable $e) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $socialAccount->getId(),
'provider' => $socialAccount->getProviderName(),
'reason' => $e->getMessage(),
]);
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);
$newToken = null;
Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)
->block(8, function () use ($account, $forceRefresh, &$newToken): void {
try {
$account->refresh();
$token = $this->encryptedTokenManager->getAccessToken($account);
if (! $forceRefresh && $this->hasValidToken($account)) {
$newToken = $token;
return;
}
if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {
$this->logger->error('[SocialAccountService] Refresh token not found', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog(
$account,
self::TOKEN_STATE_REFRESH,
self::TOKEN_RESULT_FAILURE,
);
throw new SocialAccountTokenInvalidException(
'Refresh token is not set, re-connection required.',
);
}
$this->logger->info('[SocialAccountService] Refreshing token from provider', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),
'state' => $account->getState(),
]);
$newToken = $this->getProvider($account->provider)
->getAccessToken('refresh_token', [
'refresh_token' => $token->getRefreshToken(),
])
;
if ($newToken->getToken() === $token->getToken()) {
$this->logger->info('[SocialAccountService] Refreshed with an identical token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
}
} catch (ConnectException | RequestException $exception) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
// This usually occurs due to SSL errors.
throw new SocialAccountTokenInvalidException(
'Token could not be refreshed.',
$exception->getCode(),
$exception,
);
}
$account->provider_user_token = $newToken->getToken();
$account->expires = $newToken->getExpires();
$account->state = SocialAccount::STATE_CONNECTED;
if ($newToken->getRefreshToken()) {
$account->provider_refresh_token = $newToken->getRefreshToken();
$values = $newToken->getValues();
$account->refresh_token_expires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
$account->save();
});
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);
$this->logger->info('[SocialAccountService] Token refreshed', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'state' => $account->getState(),
]);
return $newToken;
}
/**
* @return string[]
*/
private function getAccessScope(string $provider): array
{
$scopes = [];
$providerScopes = config('services.' . $provider . '.scope');
if ($providerScopes) {
$scopes = preg_split('/\s+/', $providerScopes);
}
return $scopes;
}
/**
* @throws InvalidEnumException
*/
public function getAuthorizationOptions(string $provider): array
{
$scopes = ['scope' => $this->getAccessScope($provider)];
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
case SocialAccount::PROVIDER_SALESFORCE:
case SocialAccount::PROVIDER_HUBSPOT:
case SocialAccount::PROVIDER_OUTREACH:
case SocialAccount::PROVIDER_SALESLOFT:
case SocialAccount::PROVIDER_ZOOM_PHONE:
case SocialAccount::PROVIDER_PIPEDRIVE:
case SocialAccount::PROVIDER_SLACK:
case SocialAccount::PROVIDER_AIRCALL:
case SocialAccount::PROVIDER_BULLHORN:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_TELUS:
case SocialAccount::PROVIDER_DIALPAD:
case SocialAccount::PROVIDER_TALKDESK:
return $scopes;
case SocialAccount::PROVIDER_OFFICE:
return $scopes + [
'access_type' => 'offline',
];
case SocialAccount::PROVIDER_GOOGLE:
return $scopes + [
'access_type' => 'offline',
'include_granted_scopes' => 'true',
'approval_prompt' => null,
];
default:
throw new InvalidEnumException();
}
}
private function tokenDoesNotExpire(SocialAccount $account): bool
{
return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);
}
private function hasValidToken(SocialAccount $account): bool
{
return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();
}
private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void
{
Datadog::increment('jiminny.access_token', 1, [
'provider' => $account->getProviderName(),
'state' => $state,
'result' => $result,
]);
}
private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),
];
}
private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
try {
$parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);
$number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);
} catch (NumberParseException) {
$number = null;
}
// Todo: this should check the `organization_id` matches the parent crm configuration.
return [
'country_code' => $this->countryCode,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),
'phone' => $number,
'crm_provider_id' => $rawUserData['organization_id'],
'crm_base_url' => $this->vendorValues['instance_url'],
];
}
/**
* Todo: this should check the `getHubId` matches the parent crm configuration.
*/
private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $providerUser->getHubId(),
'crm_base_url' => $providerUser->toArray()['hub_domain'],
];
}
/**
* Todo: this should check the `getCompanyId` matches the parent crm configuration.
*/
private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $rawUserData['data']['company_id'],
'crm_base_url' => '[URL_WITH_CREDENTIALS] ActivityProviderException
*/
private function mapDialpadUserData(DialpadResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
// They need to be Super Admin to access the Company APIs.
$this->logger->info('[Dialpad] User authenticated', $rawUserData);
if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Dialpad Super Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapAircallUserData(AircallResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
/**
* @throws ActivityProviderException
*/
private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array
{
if ($providerUser->toArray()['data']['team_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Team Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapBullhornUserData(): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
];
}
private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
}...
|
[{"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":"JY-20891-improve-sms-text-relays, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.08843085,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: JY-20891-improve-sms-text-relays","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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 'AskJiminnyReportActivityServiceTest'","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":"6","depth":4,"bounds":{"left":0.37400267,"top":0.15003991,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"8","depth":4,"bounds":{"left":0.38397607,"top":0.15003991,"width":0.007978723,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.39361703,"top":0.14844373,"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.40093085,"top":0.14844373,"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":"<?php\n\nnamespace Jiminny\\Services;\n\n/**\n * @todo cleanup after #slack-oauth-v2\n */\n\nuse AdamPaterson\\OAuth2\\Client\\Provider\\SlackResourceOwner;\nuse Chadhutchins\\OAuth2\\Client\\Provider\\Slack;\nuse ChaseConey\\LaravelDatadogHelper\\Datadog;\nuse Daniti\\OAuth2\\Client\\Provider\\Pipedrive;\nuse Daniti\\OAuth2\\Client\\Provider\\PipedriveResourceOwner;\nuse Exception;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpot;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpotResourceOwner;\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Psr7\\Response;\nuse Illuminate\\Auth\\AuthenticationException;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Support\\Facades\\Cache;\nuse Jiminny\\Component\\Encryption\\EncryptedTokenManager;\nuse Jiminny\\Events\\Users\\CrmAccountReconnected;\nuse Jiminny\\Events\\Users\\SocialAccountConnected;\nuse Jiminny\\Events\\Users\\SocialAccountDisconnected;\nuse Jiminny\\Exceptions\\ActivityProviderException;\nuse Jiminny\\Exceptions\\InvalidEnumException;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Models\\SocialAccount;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Notifications\\SlackBotAdded;\nuse Jiminny\\OAuth2\\Client\\Provider\\Aircall;\nuse Jiminny\\OAuth2\\Client\\Provider\\AircallResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Bullhorn;\nuse Jiminny\\OAuth2\\Client\\Provider\\Dialpad;\nuse Jiminny\\OAuth2\\Client\\Provider\\DialpadResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Salesloft;\nuse Jiminny\\OAuth2\\Client\\Provider\\SalesloftResourceOwner;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\Talkdesk;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\TalkdeskResourceOwner;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\Zoom;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\ZoomResourceOwner;\nuse Jiminny\\Services\\OAuth2\\Provider\\BasicAuth;\nuse Jiminny\\Services\\OAuth2\\Provider\\Outreach;\nuse JsonException;\nuse League\\OAuth2\\Client\\OptionProvider\\HttpBasicAuthOptionProvider;\nuse League\\OAuth2\\Client\\Provider\\AbstractProvider;\nuse League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException;\nuse League\\OAuth2\\Client\\Provider\\Google;\nuse League\\OAuth2\\Client\\Provider\\GoogleUser;\nuse League\\OAuth2\\Client\\Provider\\LinkedIn;\nuse League\\OAuth2\\Client\\Provider\\LinkedInResourceOwner;\nuse League\\OAuth2\\Client\\Provider\\ResourceOwnerInterface;\nuse League\\OAuth2\\Client\\Token\\AccessToken;\nuse League\\OAuth2\\Client\\Token\\AccessTokenInterface;\nuse libphonenumber\\NumberParseException;\nuse libphonenumber\\PhoneNumberFormat;\nuse libphonenumber\\PhoneNumberUtil;\nuse LogicException;\nuse Psr\\Log\\LoggerInterface;\nuse Random\\RandomException;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\Salesforce;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\SalesforceResourceOwner;\nuse TheNetworg\\OAuth2\\Client\\Provider\\Azure;\nuse TheNetworg\\OAuth2\\Client\\Provider\\AzureResourceOwner;\nuse Throwable;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingCentral;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingcentralResourceOwner;\n\nclass SocialAccountService\n{\n /**\n * Get a fresh tokens 5 minutes before it expires\n * That should minimise the number of failed requests due to expired token\n * for long-running jobs that reuse the same token for pulling lots of data.\n */\n private const int REFRESH_OFFSET_MIN = 5;\n\n private const string TOKEN_STATE_FETCH = 'fetch';\n private const string TOKEN_STATE_REFRESH = 'refresh';\n private const string TOKEN_RESULT_ATTEMPT = 'attempt';\n private const string TOKEN_RESULT_SUCCESS = 'success';\n private const string TOKEN_RESULT_FAILURE = 'failure';\n\n private ?AccessTokenInterface $accessToken = null;\n private ?string $token = null;\n private ?string $refreshToken = null;\n private ?int $expires = null;\n private ?string $countryCode = null;\n private ?string $timezone = null;\n private ?array $vendorValues = null;\n\n private ?int $refreshTokenExpires = null;\n\n public function __construct(\n private readonly EncryptedTokenManager $encryptedTokenManager,\n private readonly LoggerInterface $logger,\n private readonly PhoneNumberUtil $phoneNumberUtil,\n private readonly Dispatcher $eventDispatcher,\n ) {\n }\n\n public function setVendorValues(array $values): void\n {\n $this->vendorValues = $values;\n }\n\n public function setAccessToken(AccessTokenInterface $accessToken): void\n {\n $this->accessToken = $accessToken;\n // Todo: Also set these other params from this token e.g. refreshToken\n }\n\n public function setToken(?string $token): void\n {\n $this->token = $token;\n }\n\n public function setRefreshToken(?string $refreshToken): void\n {\n $this->refreshToken = $refreshToken;\n }\n\n public function setCountryCode(string $countryCode): void\n {\n $this->countryCode = $countryCode;\n }\n\n public function setTimezone(string $timezone): void\n {\n $this->timezone = $timezone;\n }\n\n public function setExpires(?int $expiry): void\n {\n $this->expires = $expiry;\n }\n\n public function setRefreshTokenExpires(array $values): void\n {\n $this->refreshTokenExpires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getProvider(string $provider): AbstractProvider\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n return new LinkedIn(config('services.linkedin'));\n\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n $socialProvider = new LinkedIn(config('services.linkedin-conference'));\n $socialProvider->withFields([\n 'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',\n ]);\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_SALESFORCE:\n return new Salesforce(config('services.salesforce'));\n\n case SocialAccount::PROVIDER_GOOGLE:\n return new Google(config('services.google'));\n\n case SocialAccount::PROVIDER_SLACK:\n return new Slack(config('services.slack'));\n\n case SocialAccount::PROVIDER_OFFICE:\n $config = config('services.office');\n\n // Convert string scope to array format expected by Azure provider\n if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {\n $config['scopes'] = array_filter(preg_split('/\\s+/', trim($config['scope'])));\n unset($config['scope']);\n }\n\n $socialProvider = new Azure($config);\n $socialProvider->urlAPI = 'https://graph.microsoft.com/v1.0/';\n $socialProvider->API_VERSION = '1.0';\n $socialProvider->defaultEndPointVersion = Azure::ENDPOINT_VERSION_2_0;\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_HUBSPOT:\n return new HubSpot(config('services.hubspot'));\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n return new Pipedrive(config('services.pipedrive'));\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n return new Zoom(config('services.zoom-phone'));\n\n case SocialAccount::PROVIDER_OUTREACH:\n return new Outreach(config('services.outreach'));\n\n case SocialAccount::PROVIDER_SALESLOFT:\n return new Salesloft(config('services.salesloft'));\n\n case SocialAccount::PROVIDER_AIRCALL:\n return new Aircall(config('services.aircall'));\n\n case SocialAccount::PROVIDER_DIALPAD:\n return new Dialpad(config('services.dialpad'));\n\n case SocialAccount::PROVIDER_GONG:\n return new BasicAuth(config('services.gong'));\n\n case SocialAccount::PROVIDER_CLOSE:\n return new BasicAuth(config('services.close'));\n\n case SocialAccount::PROVIDER_AVAYA:\n // Avaya is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.avaya'));\n\n case SocialAccount::PROVIDER_TELUS:\n // Telus is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.telus'));\n\n case SocialAccount::PROVIDER_RINGCENTRAL:\n return new RingCentral(config('services.ringcentral'));\n\n case SocialAccount::PROVIDER_BULLHORN:\n return new Bullhorn(config('services.bullhorn'));\n\n case SocialAccount::PROVIDER_TALKDESK:\n return new Talkdesk(config('services.talkdesk'), [\n // Automatically concatenate Basic token to AuthToken requests\n 'optionProvider' => new HttpBasicAuthOptionProvider(),\n ]);\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n /**\n *\n *\n * @throws Exception\n */\n public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n /** @var LinkedInResourceOwner $providerUser */\n return $this->mapLinkedInUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESFORCE:\n /** @var SalesforceResourceOwner $providerUser */\n return $this->mapSalesforceUserData($providerUser);\n\n case SocialAccount::PROVIDER_HUBSPOT:\n /** @var HubSpotResourceOwner $providerUser */\n return $this->mapHubSpotUserData($providerUser);\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n /** @var PipedriveResourceOwner $providerUser */\n return $this->mapPipedriveUserData($providerUser);\n\n case SocialAccount::PROVIDER_GOOGLE:\n /** @var GoogleUser $providerUser */\n return $this->mapGoogleUserData($providerUser);\n\n case SocialAccount::PROVIDER_SLACK:\n /** @var SlackResourceOwner $providerUser */\n return $this->mapSlackUserData($providerUser);\n\n case SocialAccount::PROVIDER_OFFICE:\n /** @var AzureResourceOwner $providerUser */\n return $this->mapOfficeUserData($providerUser);\n\n case SocialAccount::PROVIDER_OUTREACH:\n return $this->mapOutreachUserData($providerUser);\n\n case SocialAccount::PROVIDER_DIALPAD:\n /** @var DialpadResourceOwner $providerUser*/\n return $this->mapDialpadUserData($providerUser);\n\n case SocialAccount::PROVIDER_AIRCALL:\n /** @var AircallResourceOwner $providerUser */\n return $this->mapAircallUserData($providerUser);\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n /** @var ZoomResourceOwner $providerUser */\n return $this->mapZoomPhoneUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESLOFT:\n /** @var SalesloftResourceOwner $providerUser */\n return $this->mapSalesloftUserData($providerUser);\n\n case SocialAccount::PROVIDER_BULLHORN:\n return $this->mapBullhornUserData();\n\n case SocialAccount::PROVIDER_TALKDESK:\n /** @var TalkdeskResourceOwner $providerUser */\n return $this->mapTalkdeskUserData($providerUser);\n\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_TELUS:\n /** @var RingcentralResourceOwner $providerUser */\n return $this->mapRingCentralUserData($providerUser);\n default:\n throw new InvalidEnumException('Unknown provider.');\n }\n }\n\n /**\n * Returns a new random string to use as the state parameter in an\n * authorization flow.\n *\n * @param int $length Length of the random string to be generated.\n *\n * @throws RandomException\n */\n public function getRandomState(int $length = 32): string\n {\n // Converting bytes to hex will always double length. Hence, we can reduce\n // the amount of bytes by half to produce the correct length.\n return bin2hex(random_bytes($length / 2));\n }\n\n private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount\n {\n return SocialAccount::where([\n 'provider' => $provider,\n 'provider_user_id' => $providerUser->getId(),\n ])->first();\n }\n\n /**\n * Based on the provider data, try to match to a sociable entity based on email.\n * If a match is made, create the social account under that entity.\n *\n * @throws AuthenticationException\n */\n public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User\n {\n $account = $this->getAssociation($provider, $providerUser);\n if ($account !== null && $account->hasUser()) {\n return $account->getUser();\n }\n $userData = $this->mapUserData($provider, $providerUser);\n\n // Check if we have an actual user with this email.\n /** @var User|null $user */\n $user = User::where('email', $userData['email'])->first();\n\n // If the user is trying to connect to LinkedIn, don't allow this.\n // Todo: have an interstitial page to perform 2FA to connect.\n if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {\n throw new AuthenticationException(\n 'Sorry, you\\'ll need to login through your Jiminny account to access the Conference.',\n );\n }\n\n return $user;\n }\n\n /**\n * @throws JsonException\n */\n public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount\n {\n /** @var SocialAccount $account */\n $account = $user->socialAccounts()->firstOrNew([\n 'provider' => $provider,\n ]);\n\n $account->fill([\n 'provider_user_id' => $providerUser->getId(),\n 'provider_user_token' => $this->token,\n 'expires' => $this->expires,\n 'state' => SocialAccount::STATE_CONNECTED,\n 'retry_after' => null,\n ]);\n\n // This is an optional parameter, don't overwrite the existing one with null if we don't get it.\n if ($this->refreshToken) {\n $account->fill([\n 'provider_refresh_token' => $this->refreshToken,\n 'refresh_token_expires' => $this->refreshTokenExpires,\n ]);\n }\n\n if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {\n $account->fill([\n 'auth_scope' => is_scalar($this->vendorValues['scope'])\n ? $this->vendorValues['scope']\n : json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),\n ]);\n } else {\n $account->fill([\n 'auth_scope' => null,\n ]);\n\n $this->logger->warning(\n '[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',\n // pulling directly from the token, just to avoid potential masking of the issue\n ['token_values' => $this->accessToken->getValues()],\n );\n }\n\n $account->save();\n\n // Association can be from an updated token so don't re-announce this.\n if (\n $account->wasRecentlyCreated\n && in_array($provider, SocialAccount::CRM_PROVIDERS, true)\n && $provider !== SocialAccount::PROVIDER_HUBSPOT\n && $providerUser->getId() !== null\n ) {\n $crm = $user->team->crm;\n $data = [\n 'crm_configuration_id' => $crm->id,\n 'log_notes' => Profile::LOG_NOTE_ENHANCED,\n ];\n\n $crmProfile = $user->crmProfile()->where([\n 'crm_provider_id' => $providerUser->getId(),\n ])->first();\n\n $user->crmProfile()->updateOrCreate([\n 'crm_provider_id' => $providerUser->getId(),\n ], $data);\n\n // If updated, fire reconnected\n if ($crmProfile !== null) {\n $this->eventDispatcher->dispatch(new CrmAccountReconnected($account));\n }\n }\n\n $this->eventDispatcher->dispatch(new SocialAccountConnected($account));\n\n return $account;\n }\n\n public function integrate(string $provider, User $user, Team $team): void\n {\n if ($provider === SocialAccount::PROVIDER_SLACK) {\n if (! isset($this->vendorValues['ok'])\n || $this->vendorValues['ok'] !== true\n || ! isset($this->vendorValues['token_type'])\n || $this->vendorValues['token_type'] !== 'bot'\n ) {\n // code expects V2 token, which differs slightly from V1\n throw new LogicException('Invalid token received from Slack OAuth v2 API');\n }\n\n $webhook = $this->vendorValues['incoming_webhook'];\n\n $slackTeamId = $this->vendorValues['team']['id'];\n\n $botData = [\n 'channel' => $webhook['channel'],\n 'channel_id' => $webhook['channel_id'],\n 'config_url' => $webhook['configuration_url'],\n 'webhook_url' => $webhook['url'],\n 'bot_user_id' => $this->vendorValues['bot_user_id'],\n 'bot_access_token' => $this->accessToken->getToken(),\n ];\n\n $slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);\n\n if ($slackBot->wasRecentlyCreated) {\n // Send Slack notification.\n $user->notify(new SlackBotAdded());\n }\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);\n\n $this->logger->info('[SocialAccountService] Fetching token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $account->refresh();\n\n if (\n ! $forceRefresh\n && ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))\n ) {\n $this->logger->info('[SocialAccountService] Token retrieved', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);\n\n return $this->encryptedTokenManager->getAccessToken($account);\n }\n\n try {\n $this->logger->info('[SocialAccountService] Token needs refreshing', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n return $this->refreshToken($account, $forceRefresh);\n } catch (IdentityProviderException $exception) {\n $responseBody = $exception->getResponseBody();\n\n if ($responseBody instanceof Response) {\n $responseBody = $responseBody->getBody();\n }\n\n if (is_object($responseBody) && method_exists($responseBody, '__toString')) {\n $responseBody = $responseBody->__toString();\n }\n\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'responseBody' => $responseBody,\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logger->error('[SocialAccountService] Cannot obtain token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception::class,\n 'errorMessage' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {\n $this->logger->error('[SocialAccountService] Full refresh required', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n // Something terrible happened their token, they need to reconnect.\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n $this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));\n }\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n }\n }\n\n public function refreshSocialAccountToken(SocialAccount $socialAccount): void\n {\n try {\n $this->getToken($socialAccount);\n } catch (Throwable $e) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $socialAccount->getId(),\n 'provider' => $socialAccount->getProviderName(),\n 'reason' => $e->getMessage(),\n ]);\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);\n\n $newToken = null;\n\n Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)\n ->block(8, function () use ($account, $forceRefresh, &$newToken): void {\n try {\n $account->refresh();\n $token = $this->encryptedTokenManager->getAccessToken($account);\n\n if (! $forceRefresh && $this->hasValidToken($account)) {\n $newToken = $token;\n\n return;\n }\n\n if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {\n $this->logger->error('[SocialAccountService] Refresh token not found', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog(\n $account,\n self::TOKEN_STATE_REFRESH,\n self::TOKEN_RESULT_FAILURE,\n );\n\n throw new SocialAccountTokenInvalidException(\n 'Refresh token is not set, re-connection required.',\n );\n }\n\n $this->logger->info('[SocialAccountService] Refreshing token from provider', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),\n 'state' => $account->getState(),\n ]);\n\n $newToken = $this->getProvider($account->provider)\n ->getAccessToken('refresh_token', [\n 'refresh_token' => $token->getRefreshToken(),\n ])\n ;\n\n if ($newToken->getToken() === $token->getToken()) {\n $this->logger->info('[SocialAccountService] Refreshed with an identical token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n }\n } catch (ConnectException | RequestException $exception) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n // This usually occurs due to SSL errors.\n throw new SocialAccountTokenInvalidException(\n 'Token could not be refreshed.',\n $exception->getCode(),\n $exception,\n );\n }\n\n $account->provider_user_token = $newToken->getToken();\n $account->expires = $newToken->getExpires();\n $account->state = SocialAccount::STATE_CONNECTED;\n\n if ($newToken->getRefreshToken()) {\n $account->provider_refresh_token = $newToken->getRefreshToken();\n $values = $newToken->getValues();\n $account->refresh_token_expires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n $account->save();\n });\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);\n\n $this->logger->info('[SocialAccountService] Token refreshed', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'state' => $account->getState(),\n ]);\n\n return $newToken;\n }\n\n /**\n * @return string[]\n */\n private function getAccessScope(string $provider): array\n {\n $scopes = [];\n $providerScopes = config('services.' . $provider . '.scope');\n\n if ($providerScopes) {\n $scopes = preg_split('/\\s+/', $providerScopes);\n }\n\n return $scopes;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getAuthorizationOptions(string $provider): array\n {\n $scopes = ['scope' => $this->getAccessScope($provider)];\n\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n case SocialAccount::PROVIDER_SALESFORCE:\n case SocialAccount::PROVIDER_HUBSPOT:\n case SocialAccount::PROVIDER_OUTREACH:\n case SocialAccount::PROVIDER_SALESLOFT:\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n case SocialAccount::PROVIDER_PIPEDRIVE:\n case SocialAccount::PROVIDER_SLACK:\n case SocialAccount::PROVIDER_AIRCALL:\n case SocialAccount::PROVIDER_BULLHORN:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_TELUS:\n case SocialAccount::PROVIDER_DIALPAD:\n case SocialAccount::PROVIDER_TALKDESK:\n return $scopes;\n\n case SocialAccount::PROVIDER_OFFICE:\n return $scopes + [\n 'access_type' => 'offline',\n ];\n\n case SocialAccount::PROVIDER_GOOGLE:\n return $scopes + [\n 'access_type' => 'offline',\n 'include_granted_scopes' => 'true',\n 'approval_prompt' => null,\n ];\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n private function tokenDoesNotExpire(SocialAccount $account): bool\n {\n return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);\n }\n\n private function hasValidToken(SocialAccount $account): bool\n {\n return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();\n }\n\n private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void\n {\n Datadog::increment('jiminny.access_token', 1, [\n 'provider' => $account->getProviderName(),\n 'state' => $state,\n 'result' => $result,\n ]);\n }\n\n private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),\n ];\n }\n\n private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n try {\n $parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);\n $number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);\n } catch (NumberParseException) {\n $number = null;\n }\n\n // Todo: this should check the `organization_id` matches the parent crm configuration.\n\n return [\n 'country_code' => $this->countryCode,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),\n 'phone' => $number,\n 'crm_provider_id' => $rawUserData['organization_id'],\n 'crm_base_url' => $this->vendorValues['instance_url'],\n ];\n }\n\n /**\n * Todo: this should check the `getHubId` matches the parent crm configuration.\n */\n private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array\n {\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $providerUser->getHubId(),\n 'crm_base_url' => $providerUser->toArray()['hub_domain'],\n ];\n }\n\n /**\n * Todo: this should check the `getCompanyId` matches the parent crm configuration.\n */\n private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $rawUserData['data']['company_id'],\n 'crm_base_url' => 'https://' . $rawUserData['data']['company_domain'] . '.pipedrive.com',\n ];\n }\n\n private function mapGoogleUserData(GoogleUser $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($providerUser->getEmail()),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapSlackUserData(SlackResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getRealName(),\n ];\n }\n\n private function mapOfficeUserData(AzureResourceOwner $providerUser): array\n {\n $email = $providerUser->getUpn() ?? $providerUser->claim('email');\n\n $this->logger->info('[Office] User authenticated', $providerUser->toArray());\n\n $name = $providerUser->claim('name') ??\n $providerUser->getFirstName() . ' ' . $providerUser->getLastName();\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($email),\n 'name' => $name,\n ];\n }\n\n private function mapOutreachUserData(ResourceOwnerInterface $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n $socialProvider = $this->getProvider(SocialAccount::PROVIDER_OUTREACH);\n $url = 'https://api.outreach.io/api/v2/profiles/';\n\n try {\n $request = $socialProvider->getAuthenticatedRequest(\n 'get',\n $url . $rawUserData['meta']['user']['id'],\n $this->accessToken,\n );\n\n $response = $socialProvider->getParsedResponse($request);\n\n $this->logger->info('[Outreach] User authenticated', $response);\n } catch (Exception) {\n //Just ignore\n }\n\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapDialpadUserData(DialpadResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n // They need to be Super Admin to access the Company APIs.\n $this->logger->info('[Dialpad] User authenticated', $rawUserData);\n\n if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Dialpad Super Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapAircallUserData(AircallResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array\n {\n if ($providerUser->toArray()['data']['team_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Team Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapBullhornUserData(): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n\n private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n}","depth":4,"bounds":{"left":0.122340426,"top":0.14684756,"width":0.31083778,"height":0.85315245},"on_screen":true,"value":"<?php\n\nnamespace Jiminny\\Services;\n\n/**\n * @todo cleanup after #slack-oauth-v2\n */\n\nuse AdamPaterson\\OAuth2\\Client\\Provider\\SlackResourceOwner;\nuse Chadhutchins\\OAuth2\\Client\\Provider\\Slack;\nuse ChaseConey\\LaravelDatadogHelper\\Datadog;\nuse Daniti\\OAuth2\\Client\\Provider\\Pipedrive;\nuse Daniti\\OAuth2\\Client\\Provider\\PipedriveResourceOwner;\nuse Exception;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpot;\nuse Flipbox\\OAuth2\\Client\\Provider\\HubSpotResourceOwner;\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\Psr7\\Response;\nuse Illuminate\\Auth\\AuthenticationException;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Support\\Facades\\Cache;\nuse Jiminny\\Component\\Encryption\\EncryptedTokenManager;\nuse Jiminny\\Events\\Users\\CrmAccountReconnected;\nuse Jiminny\\Events\\Users\\SocialAccountConnected;\nuse Jiminny\\Events\\Users\\SocialAccountDisconnected;\nuse Jiminny\\Exceptions\\ActivityProviderException;\nuse Jiminny\\Exceptions\\InvalidEnumException;\nuse Jiminny\\Exceptions\\SocialAccountTokenInvalidException;\nuse Jiminny\\Models\\Crm\\Profile;\nuse Jiminny\\Models\\SocialAccount;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Notifications\\SlackBotAdded;\nuse Jiminny\\OAuth2\\Client\\Provider\\Aircall;\nuse Jiminny\\OAuth2\\Client\\Provider\\AircallResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Bullhorn;\nuse Jiminny\\OAuth2\\Client\\Provider\\Dialpad;\nuse Jiminny\\OAuth2\\Client\\Provider\\DialpadResourceOwner;\nuse Jiminny\\OAuth2\\Client\\Provider\\Salesloft;\nuse Jiminny\\OAuth2\\Client\\Provider\\SalesloftResourceOwner;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\Talkdesk;\nuse Jiminny\\Services\\Activity\\Talkdesk\\Provider\\TalkdeskResourceOwner;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\Zoom;\nuse Jiminny\\Services\\Activity\\Zoom\\Provider\\ZoomResourceOwner;\nuse Jiminny\\Services\\OAuth2\\Provider\\BasicAuth;\nuse Jiminny\\Services\\OAuth2\\Provider\\Outreach;\nuse JsonException;\nuse League\\OAuth2\\Client\\OptionProvider\\HttpBasicAuthOptionProvider;\nuse League\\OAuth2\\Client\\Provider\\AbstractProvider;\nuse League\\OAuth2\\Client\\Provider\\Exception\\IdentityProviderException;\nuse League\\OAuth2\\Client\\Provider\\Google;\nuse League\\OAuth2\\Client\\Provider\\GoogleUser;\nuse League\\OAuth2\\Client\\Provider\\LinkedIn;\nuse League\\OAuth2\\Client\\Provider\\LinkedInResourceOwner;\nuse League\\OAuth2\\Client\\Provider\\ResourceOwnerInterface;\nuse League\\OAuth2\\Client\\Token\\AccessToken;\nuse League\\OAuth2\\Client\\Token\\AccessTokenInterface;\nuse libphonenumber\\NumberParseException;\nuse libphonenumber\\PhoneNumberFormat;\nuse libphonenumber\\PhoneNumberUtil;\nuse LogicException;\nuse Psr\\Log\\LoggerInterface;\nuse Random\\RandomException;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\Salesforce;\nuse Stevenmaguire\\OAuth2\\Client\\Provider\\SalesforceResourceOwner;\nuse TheNetworg\\OAuth2\\Client\\Provider\\Azure;\nuse TheNetworg\\OAuth2\\Client\\Provider\\AzureResourceOwner;\nuse Throwable;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingCentral;\nuse TMannherz\\OAuth2\\Client\\Provider\\RingcentralResourceOwner;\n\nclass SocialAccountService\n{\n /**\n * Get a fresh tokens 5 minutes before it expires\n * That should minimise the number of failed requests due to expired token\n * for long-running jobs that reuse the same token for pulling lots of data.\n */\n private const int REFRESH_OFFSET_MIN = 5;\n\n private const string TOKEN_STATE_FETCH = 'fetch';\n private const string TOKEN_STATE_REFRESH = 'refresh';\n private const string TOKEN_RESULT_ATTEMPT = 'attempt';\n private const string TOKEN_RESULT_SUCCESS = 'success';\n private const string TOKEN_RESULT_FAILURE = 'failure';\n\n private ?AccessTokenInterface $accessToken = null;\n private ?string $token = null;\n private ?string $refreshToken = null;\n private ?int $expires = null;\n private ?string $countryCode = null;\n private ?string $timezone = null;\n private ?array $vendorValues = null;\n\n private ?int $refreshTokenExpires = null;\n\n public function __construct(\n private readonly EncryptedTokenManager $encryptedTokenManager,\n private readonly LoggerInterface $logger,\n private readonly PhoneNumberUtil $phoneNumberUtil,\n private readonly Dispatcher $eventDispatcher,\n ) {\n }\n\n public function setVendorValues(array $values): void\n {\n $this->vendorValues = $values;\n }\n\n public function setAccessToken(AccessTokenInterface $accessToken): void\n {\n $this->accessToken = $accessToken;\n // Todo: Also set these other params from this token e.g. refreshToken\n }\n\n public function setToken(?string $token): void\n {\n $this->token = $token;\n }\n\n public function setRefreshToken(?string $refreshToken): void\n {\n $this->refreshToken = $refreshToken;\n }\n\n public function setCountryCode(string $countryCode): void\n {\n $this->countryCode = $countryCode;\n }\n\n public function setTimezone(string $timezone): void\n {\n $this->timezone = $timezone;\n }\n\n public function setExpires(?int $expiry): void\n {\n $this->expires = $expiry;\n }\n\n public function setRefreshTokenExpires(array $values): void\n {\n $this->refreshTokenExpires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getProvider(string $provider): AbstractProvider\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n return new LinkedIn(config('services.linkedin'));\n\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n $socialProvider = new LinkedIn(config('services.linkedin-conference'));\n $socialProvider->withFields([\n 'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',\n ]);\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_SALESFORCE:\n return new Salesforce(config('services.salesforce'));\n\n case SocialAccount::PROVIDER_GOOGLE:\n return new Google(config('services.google'));\n\n case SocialAccount::PROVIDER_SLACK:\n return new Slack(config('services.slack'));\n\n case SocialAccount::PROVIDER_OFFICE:\n $config = config('services.office');\n\n // Convert string scope to array format expected by Azure provider\n if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {\n $config['scopes'] = array_filter(preg_split('/\\s+/', trim($config['scope'])));\n unset($config['scope']);\n }\n\n $socialProvider = new Azure($config);\n $socialProvider->urlAPI = 'https://graph.microsoft.com/v1.0/';\n $socialProvider->API_VERSION = '1.0';\n $socialProvider->defaultEndPointVersion = Azure::ENDPOINT_VERSION_2_0;\n\n return $socialProvider;\n\n case SocialAccount::PROVIDER_HUBSPOT:\n return new HubSpot(config('services.hubspot'));\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n return new Pipedrive(config('services.pipedrive'));\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n return new Zoom(config('services.zoom-phone'));\n\n case SocialAccount::PROVIDER_OUTREACH:\n return new Outreach(config('services.outreach'));\n\n case SocialAccount::PROVIDER_SALESLOFT:\n return new Salesloft(config('services.salesloft'));\n\n case SocialAccount::PROVIDER_AIRCALL:\n return new Aircall(config('services.aircall'));\n\n case SocialAccount::PROVIDER_DIALPAD:\n return new Dialpad(config('services.dialpad'));\n\n case SocialAccount::PROVIDER_GONG:\n return new BasicAuth(config('services.gong'));\n\n case SocialAccount::PROVIDER_CLOSE:\n return new BasicAuth(config('services.close'));\n\n case SocialAccount::PROVIDER_AVAYA:\n // Avaya is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.avaya'));\n\n case SocialAccount::PROVIDER_TELUS:\n // Telus is owned by RingCentral and may operate under the same API\n return new RingCentral(config('services.telus'));\n\n case SocialAccount::PROVIDER_RINGCENTRAL:\n return new RingCentral(config('services.ringcentral'));\n\n case SocialAccount::PROVIDER_BULLHORN:\n return new Bullhorn(config('services.bullhorn'));\n\n case SocialAccount::PROVIDER_TALKDESK:\n return new Talkdesk(config('services.talkdesk'), [\n // Automatically concatenate Basic token to AuthToken requests\n 'optionProvider' => new HttpBasicAuthOptionProvider(),\n ]);\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n /**\n *\n *\n * @throws Exception\n */\n public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array\n {\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n /** @var LinkedInResourceOwner $providerUser */\n return $this->mapLinkedInUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESFORCE:\n /** @var SalesforceResourceOwner $providerUser */\n return $this->mapSalesforceUserData($providerUser);\n\n case SocialAccount::PROVIDER_HUBSPOT:\n /** @var HubSpotResourceOwner $providerUser */\n return $this->mapHubSpotUserData($providerUser);\n\n case SocialAccount::PROVIDER_PIPEDRIVE:\n /** @var PipedriveResourceOwner $providerUser */\n return $this->mapPipedriveUserData($providerUser);\n\n case SocialAccount::PROVIDER_GOOGLE:\n /** @var GoogleUser $providerUser */\n return $this->mapGoogleUserData($providerUser);\n\n case SocialAccount::PROVIDER_SLACK:\n /** @var SlackResourceOwner $providerUser */\n return $this->mapSlackUserData($providerUser);\n\n case SocialAccount::PROVIDER_OFFICE:\n /** @var AzureResourceOwner $providerUser */\n return $this->mapOfficeUserData($providerUser);\n\n case SocialAccount::PROVIDER_OUTREACH:\n return $this->mapOutreachUserData($providerUser);\n\n case SocialAccount::PROVIDER_DIALPAD:\n /** @var DialpadResourceOwner $providerUser*/\n return $this->mapDialpadUserData($providerUser);\n\n case SocialAccount::PROVIDER_AIRCALL:\n /** @var AircallResourceOwner $providerUser */\n return $this->mapAircallUserData($providerUser);\n\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n /** @var ZoomResourceOwner $providerUser */\n return $this->mapZoomPhoneUserData($providerUser);\n\n case SocialAccount::PROVIDER_SALESLOFT:\n /** @var SalesloftResourceOwner $providerUser */\n return $this->mapSalesloftUserData($providerUser);\n\n case SocialAccount::PROVIDER_BULLHORN:\n return $this->mapBullhornUserData();\n\n case SocialAccount::PROVIDER_TALKDESK:\n /** @var TalkdeskResourceOwner $providerUser */\n return $this->mapTalkdeskUserData($providerUser);\n\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_TELUS:\n /** @var RingcentralResourceOwner $providerUser */\n return $this->mapRingCentralUserData($providerUser);\n default:\n throw new InvalidEnumException('Unknown provider.');\n }\n }\n\n /**\n * Returns a new random string to use as the state parameter in an\n * authorization flow.\n *\n * @param int $length Length of the random string to be generated.\n *\n * @throws RandomException\n */\n public function getRandomState(int $length = 32): string\n {\n // Converting bytes to hex will always double length. Hence, we can reduce\n // the amount of bytes by half to produce the correct length.\n return bin2hex(random_bytes($length / 2));\n }\n\n private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount\n {\n return SocialAccount::where([\n 'provider' => $provider,\n 'provider_user_id' => $providerUser->getId(),\n ])->first();\n }\n\n /**\n * Based on the provider data, try to match to a sociable entity based on email.\n * If a match is made, create the social account under that entity.\n *\n * @throws AuthenticationException\n */\n public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User\n {\n $account = $this->getAssociation($provider, $providerUser);\n if ($account !== null && $account->hasUser()) {\n return $account->getUser();\n }\n $userData = $this->mapUserData($provider, $providerUser);\n\n // Check if we have an actual user with this email.\n /** @var User|null $user */\n $user = User::where('email', $userData['email'])->first();\n\n // If the user is trying to connect to LinkedIn, don't allow this.\n // Todo: have an interstitial page to perform 2FA to connect.\n if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {\n throw new AuthenticationException(\n 'Sorry, you\\'ll need to login through your Jiminny account to access the Conference.',\n );\n }\n\n return $user;\n }\n\n /**\n * @throws JsonException\n */\n public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount\n {\n /** @var SocialAccount $account */\n $account = $user->socialAccounts()->firstOrNew([\n 'provider' => $provider,\n ]);\n\n $account->fill([\n 'provider_user_id' => $providerUser->getId(),\n 'provider_user_token' => $this->token,\n 'expires' => $this->expires,\n 'state' => SocialAccount::STATE_CONNECTED,\n 'retry_after' => null,\n ]);\n\n // This is an optional parameter, don't overwrite the existing one with null if we don't get it.\n if ($this->refreshToken) {\n $account->fill([\n 'provider_refresh_token' => $this->refreshToken,\n 'refresh_token_expires' => $this->refreshTokenExpires,\n ]);\n }\n\n if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {\n $account->fill([\n 'auth_scope' => is_scalar($this->vendorValues['scope'])\n ? $this->vendorValues['scope']\n : json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),\n ]);\n } else {\n $account->fill([\n 'auth_scope' => null,\n ]);\n\n $this->logger->warning(\n '[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',\n // pulling directly from the token, just to avoid potential masking of the issue\n ['token_values' => $this->accessToken->getValues()],\n );\n }\n\n $account->save();\n\n // Association can be from an updated token so don't re-announce this.\n if (\n $account->wasRecentlyCreated\n && in_array($provider, SocialAccount::CRM_PROVIDERS, true)\n && $provider !== SocialAccount::PROVIDER_HUBSPOT\n && $providerUser->getId() !== null\n ) {\n $crm = $user->team->crm;\n $data = [\n 'crm_configuration_id' => $crm->id,\n 'log_notes' => Profile::LOG_NOTE_ENHANCED,\n ];\n\n $crmProfile = $user->crmProfile()->where([\n 'crm_provider_id' => $providerUser->getId(),\n ])->first();\n\n $user->crmProfile()->updateOrCreate([\n 'crm_provider_id' => $providerUser->getId(),\n ], $data);\n\n // If updated, fire reconnected\n if ($crmProfile !== null) {\n $this->eventDispatcher->dispatch(new CrmAccountReconnected($account));\n }\n }\n\n $this->eventDispatcher->dispatch(new SocialAccountConnected($account));\n\n return $account;\n }\n\n public function integrate(string $provider, User $user, Team $team): void\n {\n if ($provider === SocialAccount::PROVIDER_SLACK) {\n if (! isset($this->vendorValues['ok'])\n || $this->vendorValues['ok'] !== true\n || ! isset($this->vendorValues['token_type'])\n || $this->vendorValues['token_type'] !== 'bot'\n ) {\n // code expects V2 token, which differs slightly from V1\n throw new LogicException('Invalid token received from Slack OAuth v2 API');\n }\n\n $webhook = $this->vendorValues['incoming_webhook'];\n\n $slackTeamId = $this->vendorValues['team']['id'];\n\n $botData = [\n 'channel' => $webhook['channel'],\n 'channel_id' => $webhook['channel_id'],\n 'config_url' => $webhook['configuration_url'],\n 'webhook_url' => $webhook['url'],\n 'bot_user_id' => $this->vendorValues['bot_user_id'],\n 'bot_access_token' => $this->accessToken->getToken(),\n ];\n\n $slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);\n\n if ($slackBot->wasRecentlyCreated) {\n // Send Slack notification.\n $user->notify(new SlackBotAdded());\n }\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);\n\n $this->logger->info('[SocialAccountService] Fetching token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $account->refresh();\n\n if (\n ! $forceRefresh\n && ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))\n ) {\n $this->logger->info('[SocialAccountService] Token retrieved', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);\n\n return $this->encryptedTokenManager->getAccessToken($account);\n }\n\n try {\n $this->logger->info('[SocialAccountService] Token needs refreshing', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n return $this->refreshToken($account, $forceRefresh);\n } catch (IdentityProviderException $exception) {\n $responseBody = $exception->getResponseBody();\n\n if ($responseBody instanceof Response) {\n $responseBody = $responseBody->getBody();\n }\n\n if (is_object($responseBody) && method_exists($responseBody, '__toString')) {\n $responseBody = $responseBody->__toString();\n }\n\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'responseBody' => $responseBody,\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n } catch (SocialAccountTokenInvalidException $exception) {\n $this->logger->error('[SocialAccountService] Cannot obtain token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception::class,\n 'errorMessage' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {\n $this->logger->error('[SocialAccountService] Full refresh required', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n // Something terrible happened their token, they need to reconnect.\n $account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);\n $this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));\n }\n\n throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);\n }\n }\n\n public function refreshSocialAccountToken(SocialAccount $socialAccount): void\n {\n try {\n $this->getToken($socialAccount);\n } catch (Throwable $e) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $socialAccount->getId(),\n 'provider' => $socialAccount->getProviderName(),\n 'reason' => $e->getMessage(),\n ]);\n }\n }\n\n /**\n * @throws SocialAccountTokenInvalidException\n */\n public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken\n {\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);\n\n $newToken = null;\n\n Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)\n ->block(8, function () use ($account, $forceRefresh, &$newToken): void {\n try {\n $account->refresh();\n $token = $this->encryptedTokenManager->getAccessToken($account);\n\n if (! $forceRefresh && $this->hasValidToken($account)) {\n $newToken = $token;\n\n return;\n }\n\n if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {\n $this->logger->error('[SocialAccountService] Refresh token not found', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n\n $this->sendTokenStatsToDatadog(\n $account,\n self::TOKEN_STATE_REFRESH,\n self::TOKEN_RESULT_FAILURE,\n );\n\n throw new SocialAccountTokenInvalidException(\n 'Refresh token is not set, re-connection required.',\n );\n }\n\n $this->logger->info('[SocialAccountService] Refreshing token from provider', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),\n 'state' => $account->getState(),\n ]);\n\n $newToken = $this->getProvider($account->provider)\n ->getAccessToken('refresh_token', [\n 'refresh_token' => $token->getRefreshToken(),\n ])\n ;\n\n if ($newToken->getToken() === $token->getToken()) {\n $this->logger->info('[SocialAccountService] Refreshed with an identical token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n ]);\n }\n } catch (ConnectException | RequestException $exception) {\n $this->logger->error('[SocialAccountService] Failed to refresh token', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'error' => $exception->getMessage(),\n ]);\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);\n\n // This usually occurs due to SSL errors.\n throw new SocialAccountTokenInvalidException(\n 'Token could not be refreshed.',\n $exception->getCode(),\n $exception,\n );\n }\n\n $account->provider_user_token = $newToken->getToken();\n $account->expires = $newToken->getExpires();\n $account->state = SocialAccount::STATE_CONNECTED;\n\n if ($newToken->getRefreshToken()) {\n $account->provider_refresh_token = $newToken->getRefreshToken();\n $values = $newToken->getValues();\n $account->refresh_token_expires = isset($values['refresh_token_expires_in'])\n ? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()\n : null;\n }\n\n $account->save();\n });\n\n $this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);\n\n $this->logger->info('[SocialAccountService] Token refreshed', [\n 'socialAccountId' => $account->id,\n 'provider' => $account->getProviderName(),\n 'state' => $account->getState(),\n ]);\n\n return $newToken;\n }\n\n /**\n * @return string[]\n */\n private function getAccessScope(string $provider): array\n {\n $scopes = [];\n $providerScopes = config('services.' . $provider . '.scope');\n\n if ($providerScopes) {\n $scopes = preg_split('/\\s+/', $providerScopes);\n }\n\n return $scopes;\n }\n\n /**\n * @throws InvalidEnumException\n */\n public function getAuthorizationOptions(string $provider): array\n {\n $scopes = ['scope' => $this->getAccessScope($provider)];\n\n switch ($provider) {\n case SocialAccount::PROVIDER_LINKEDIN:\n case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:\n case SocialAccount::PROVIDER_SALESFORCE:\n case SocialAccount::PROVIDER_HUBSPOT:\n case SocialAccount::PROVIDER_OUTREACH:\n case SocialAccount::PROVIDER_SALESLOFT:\n case SocialAccount::PROVIDER_ZOOM_PHONE:\n case SocialAccount::PROVIDER_PIPEDRIVE:\n case SocialAccount::PROVIDER_SLACK:\n case SocialAccount::PROVIDER_AIRCALL:\n case SocialAccount::PROVIDER_BULLHORN:\n case SocialAccount::PROVIDER_RINGCENTRAL:\n case SocialAccount::PROVIDER_AVAYA:\n case SocialAccount::PROVIDER_TELUS:\n case SocialAccount::PROVIDER_DIALPAD:\n case SocialAccount::PROVIDER_TALKDESK:\n return $scopes;\n\n case SocialAccount::PROVIDER_OFFICE:\n return $scopes + [\n 'access_type' => 'offline',\n ];\n\n case SocialAccount::PROVIDER_GOOGLE:\n return $scopes + [\n 'access_type' => 'offline',\n 'include_granted_scopes' => 'true',\n 'approval_prompt' => null,\n ];\n\n default:\n throw new InvalidEnumException();\n }\n }\n\n private function tokenDoesNotExpire(SocialAccount $account): bool\n {\n return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);\n }\n\n private function hasValidToken(SocialAccount $account): bool\n {\n return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();\n }\n\n private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void\n {\n Datadog::increment('jiminny.access_token', 1, [\n 'provider' => $account->getProviderName(),\n 'state' => $state,\n 'result' => $result,\n ]);\n }\n\n private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),\n ];\n }\n\n private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n try {\n $parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);\n $number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);\n } catch (NumberParseException) {\n $number = null;\n }\n\n // Todo: this should check the `organization_id` matches the parent crm configuration.\n\n return [\n 'country_code' => $this->countryCode,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),\n 'phone' => $number,\n 'crm_provider_id' => $rawUserData['organization_id'],\n 'crm_base_url' => $this->vendorValues['instance_url'],\n ];\n }\n\n /**\n * Todo: this should check the `getHubId` matches the parent crm configuration.\n */\n private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array\n {\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $providerUser->getHubId(),\n 'crm_base_url' => $providerUser->toArray()['hub_domain'],\n ];\n }\n\n /**\n * Todo: this should check the `getCompanyId` matches the parent crm configuration.\n */\n private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'crm_provider_id' => $rawUserData['data']['company_id'],\n 'crm_base_url' => 'https://' . $rawUserData['data']['company_domain'] . '.pipedrive.com',\n ];\n }\n\n private function mapGoogleUserData(GoogleUser $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($providerUser->getEmail()),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapSlackUserData(SlackResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getRealName(),\n ];\n }\n\n private function mapOfficeUserData(AzureResourceOwner $providerUser): array\n {\n $email = $providerUser->getUpn() ?? $providerUser->claim('email');\n\n $this->logger->info('[Office] User authenticated', $providerUser->toArray());\n\n $name = $providerUser->claim('name') ??\n $providerUser->getFirstName() . ' ' . $providerUser->getLastName();\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => strtolower($email),\n 'name' => $name,\n ];\n }\n\n private function mapOutreachUserData(ResourceOwnerInterface $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n $socialProvider = $this->getProvider(SocialAccount::PROVIDER_OUTREACH);\n $url = 'https://api.outreach.io/api/v2/profiles/';\n\n try {\n $request = $socialProvider->getAuthenticatedRequest(\n 'get',\n $url . $rawUserData['meta']['user']['id'],\n $this->accessToken,\n );\n\n $response = $socialProvider->getParsedResponse($request);\n\n $this->logger->info('[Outreach] User authenticated', $response);\n } catch (Exception) {\n //Just ignore\n }\n\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapDialpadUserData(DialpadResourceOwner $providerUser): array\n {\n $rawUserData = $providerUser->toArray();\n\n // They need to be Super Admin to access the Company APIs.\n $this->logger->info('[Dialpad] User authenticated', $rawUserData);\n\n if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Dialpad Super Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapAircallUserData(AircallResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array\n {\n return[\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n /**\n * @throws ActivityProviderException\n */\n private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array\n {\n if ($providerUser->toArray()['data']['team_admin'] === false) {\n throw new ActivityProviderException(\n \"Sorry, you'll need to be a Team Admin to add this integration.\",\n );\n }\n\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n ];\n }\n\n private function mapBullhornUserData(): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n ];\n }\n\n private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n\n private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array\n {\n return [\n 'country_code' => $this->countryCode,\n 'phone' => null,\n 'timezone' => $this->timezone,\n 'email' => $providerUser->getEmail(),\n 'name' => $providerUser->getName(),\n 'id' => $providerUser->getId(),\n ];\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
8948022234986695786
|
-8880471945877483717
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
JY-20891-improve-sms-text Project: faVsco.js, menu
JY-20891-improve-sms-text-relays, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
6
8
Previous Highlighted Error
Next Highlighted Error
<?php
namespace Jiminny\Services;
/**
* @todo cleanup after #slack-oauth-v2
*/
use AdamPaterson\OAuth2\Client\Provider\SlackResourceOwner;
use Chadhutchins\OAuth2\Client\Provider\Slack;
use ChaseConey\LaravelDatadogHelper\Datadog;
use Daniti\OAuth2\Client\Provider\Pipedrive;
use Daniti\OAuth2\Client\Provider\PipedriveResourceOwner;
use Exception;
use Flipbox\OAuth2\Client\Provider\HubSpot;
use Flipbox\OAuth2\Client\Provider\HubSpotResourceOwner;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Psr7\Response;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Support\Facades\Cache;
use Jiminny\Component\Encryption\EncryptedTokenManager;
use Jiminny\Events\Users\CrmAccountReconnected;
use Jiminny\Events\Users\SocialAccountConnected;
use Jiminny\Events\Users\SocialAccountDisconnected;
use Jiminny\Exceptions\ActivityProviderException;
use Jiminny\Exceptions\InvalidEnumException;
use Jiminny\Exceptions\SocialAccountTokenInvalidException;
use Jiminny\Models\Crm\Profile;
use Jiminny\Models\SocialAccount;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Notifications\SlackBotAdded;
use Jiminny\OAuth2\Client\Provider\Aircall;
use Jiminny\OAuth2\Client\Provider\AircallResourceOwner;
use Jiminny\OAuth2\Client\Provider\Bullhorn;
use Jiminny\OAuth2\Client\Provider\Dialpad;
use Jiminny\OAuth2\Client\Provider\DialpadResourceOwner;
use Jiminny\OAuth2\Client\Provider\Salesloft;
use Jiminny\OAuth2\Client\Provider\SalesloftResourceOwner;
use Jiminny\Services\Activity\Talkdesk\Provider\Talkdesk;
use Jiminny\Services\Activity\Talkdesk\Provider\TalkdeskResourceOwner;
use Jiminny\Services\Activity\Zoom\Provider\Zoom;
use Jiminny\Services\Activity\Zoom\Provider\ZoomResourceOwner;
use Jiminny\Services\OAuth2\Provider\BasicAuth;
use Jiminny\Services\OAuth2\Provider\Outreach;
use JsonException;
use League\OAuth2\Client\OptionProvider\HttpBasicAuthOptionProvider;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\Google;
use League\OAuth2\Client\Provider\GoogleUser;
use League\OAuth2\Client\Provider\LinkedIn;
use League\OAuth2\Client\Provider\LinkedInResourceOwner;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use League\OAuth2\Client\Token\AccessTokenInterface;
use libphonenumber\NumberParseException;
use libphonenumber\PhoneNumberFormat;
use libphonenumber\PhoneNumberUtil;
use LogicException;
use Psr\Log\LoggerInterface;
use Random\RandomException;
use Stevenmaguire\OAuth2\Client\Provider\Salesforce;
use Stevenmaguire\OAuth2\Client\Provider\SalesforceResourceOwner;
use TheNetworg\OAuth2\Client\Provider\Azure;
use TheNetworg\OAuth2\Client\Provider\AzureResourceOwner;
use Throwable;
use TMannherz\OAuth2\Client\Provider\RingCentral;
use TMannherz\OAuth2\Client\Provider\RingcentralResourceOwner;
class SocialAccountService
{
/**
* Get a fresh tokens 5 minutes before it expires
* That should minimise the number of failed requests due to expired token
* for long-running jobs that reuse the same token for pulling lots of data.
*/
private const int REFRESH_OFFSET_MIN = 5;
private const string TOKEN_STATE_FETCH = 'fetch';
private const string TOKEN_STATE_REFRESH = 'refresh';
private const string TOKEN_RESULT_ATTEMPT = 'attempt';
private const string TOKEN_RESULT_SUCCESS = 'success';
private const string TOKEN_RESULT_FAILURE = 'failure';
private ?AccessTokenInterface $accessToken = null;
private ?string $token = null;
private ?string $refreshToken = null;
private ?int $expires = null;
private ?string $countryCode = null;
private ?string $timezone = null;
private ?array $vendorValues = null;
private ?int $refreshTokenExpires = null;
public function __construct(
private readonly EncryptedTokenManager $encryptedTokenManager,
private readonly LoggerInterface $logger,
private readonly PhoneNumberUtil $phoneNumberUtil,
private readonly Dispatcher $eventDispatcher,
) {
}
public function setVendorValues(array $values): void
{
$this->vendorValues = $values;
}
public function setAccessToken(AccessTokenInterface $accessToken): void
{
$this->accessToken = $accessToken;
// Todo: Also set these other params from this token e.g. refreshToken
}
public function setToken(?string $token): void
{
$this->token = $token;
}
public function setRefreshToken(?string $refreshToken): void
{
$this->refreshToken = $refreshToken;
}
public function setCountryCode(string $countryCode): void
{
$this->countryCode = $countryCode;
}
public function setTimezone(string $timezone): void
{
$this->timezone = $timezone;
}
public function setExpires(?int $expiry): void
{
$this->expires = $expiry;
}
public function setRefreshTokenExpires(array $values): void
{
$this->refreshTokenExpires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
/**
* @throws InvalidEnumException
*/
public function getProvider(string $provider): AbstractProvider
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
return new LinkedIn(config('services.linkedin'));
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
$socialProvider = new LinkedIn(config('services.linkedin-conference'));
$socialProvider->withFields([
'id', 'localizedFirstName', 'localizedLastName', 'profilePicture(displayImage~:playableStreams)',
]);
return $socialProvider;
case SocialAccount::PROVIDER_SALESFORCE:
return new Salesforce(config('services.salesforce'));
case SocialAccount::PROVIDER_GOOGLE:
return new Google(config('services.google'));
case SocialAccount::PROVIDER_SLACK:
return new Slack(config('services.slack'));
case SocialAccount::PROVIDER_OFFICE:
$config = config('services.office');
// Convert string scope to array format expected by Azure provider
if (isset($config['scope']) && is_string($config['scope']) && ! empty(trim($config['scope']))) {
$config['scopes'] = array_filter(preg_split('/\s+/', trim($config['scope'])));
unset($config['scope']);
}
$socialProvider = new Azure($config);
$socialProvider->urlAPI = '[URL_WITH_CREDENTIALS] Exception
*/
public function mapUserData(string $provider, ResourceOwnerInterface $providerUser): array
{
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
/** @var LinkedInResourceOwner $providerUser */
return $this->mapLinkedInUserData($providerUser);
case SocialAccount::PROVIDER_SALESFORCE:
/** @var SalesforceResourceOwner $providerUser */
return $this->mapSalesforceUserData($providerUser);
case SocialAccount::PROVIDER_HUBSPOT:
/** @var HubSpotResourceOwner $providerUser */
return $this->mapHubSpotUserData($providerUser);
case SocialAccount::PROVIDER_PIPEDRIVE:
/** @var PipedriveResourceOwner $providerUser */
return $this->mapPipedriveUserData($providerUser);
case SocialAccount::PROVIDER_GOOGLE:
/** @var GoogleUser $providerUser */
return $this->mapGoogleUserData($providerUser);
case SocialAccount::PROVIDER_SLACK:
/** @var SlackResourceOwner $providerUser */
return $this->mapSlackUserData($providerUser);
case SocialAccount::PROVIDER_OFFICE:
/** @var AzureResourceOwner $providerUser */
return $this->mapOfficeUserData($providerUser);
case SocialAccount::PROVIDER_OUTREACH:
return $this->mapOutreachUserData($providerUser);
case SocialAccount::PROVIDER_DIALPAD:
/** @var DialpadResourceOwner $providerUser*/
return $this->mapDialpadUserData($providerUser);
case SocialAccount::PROVIDER_AIRCALL:
/** @var AircallResourceOwner $providerUser */
return $this->mapAircallUserData($providerUser);
case SocialAccount::PROVIDER_ZOOM_PHONE:
/** @var ZoomResourceOwner $providerUser */
return $this->mapZoomPhoneUserData($providerUser);
case SocialAccount::PROVIDER_SALESLOFT:
/** @var SalesloftResourceOwner $providerUser */
return $this->mapSalesloftUserData($providerUser);
case SocialAccount::PROVIDER_BULLHORN:
return $this->mapBullhornUserData();
case SocialAccount::PROVIDER_TALKDESK:
/** @var TalkdeskResourceOwner $providerUser */
return $this->mapTalkdeskUserData($providerUser);
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_TELUS:
/** @var RingcentralResourceOwner $providerUser */
return $this->mapRingCentralUserData($providerUser);
default:
throw new InvalidEnumException('Unknown provider.');
}
}
/**
* Returns a new random string to use as the state parameter in an
* authorization flow.
*
* @param int $length Length of the random string to be generated.
*
* @throws RandomException
*/
public function getRandomState(int $length = 32): string
{
// Converting bytes to hex will always double length. Hence, we can reduce
// the amount of bytes by half to produce the correct length.
return bin2hex(random_bytes($length / 2));
}
private function getAssociation(string $provider, ResourceOwnerInterface $providerUser): ?SocialAccount
{
return SocialAccount::where([
'provider' => $provider,
'provider_user_id' => $providerUser->getId(),
])->first();
}
/**
* Based on the provider data, try to match to a sociable entity based on email.
* If a match is made, create the social account under that entity.
*
* @throws AuthenticationException
*/
public function getSociable(string $provider, ResourceOwnerInterface $providerUser): ?User
{
$account = $this->getAssociation($provider, $providerUser);
if ($account !== null && $account->hasUser()) {
return $account->getUser();
}
$userData = $this->mapUserData($provider, $providerUser);
// Check if we have an actual user with this email.
/** @var User|null $user */
$user = User::where('email', $userData['email'])->first();
// If the user is trying to connect to LinkedIn, don't allow this.
// Todo: have an interstitial page to perform 2FA to connect.
if ($provider === SocialAccount::PROVIDER_LINKEDIN_CONFERENCE) {
throw new AuthenticationException(
'Sorry, you\'ll need to login through your Jiminny account to access the Conference.',
);
}
return $user;
}
/**
* @throws JsonException
*/
public function associate(string $provider, ResourceOwnerInterface $providerUser, User $user): SocialAccount
{
/** @var SocialAccount $account */
$account = $user->socialAccounts()->firstOrNew([
'provider' => $provider,
]);
$account->fill([
'provider_user_id' => $providerUser->getId(),
'provider_user_token' => $this->token,
'expires' => $this->expires,
'state' => SocialAccount::STATE_CONNECTED,
'retry_after' => null,
]);
// This is an optional parameter, don't overwrite the existing one with null if we don't get it.
if ($this->refreshToken) {
$account->fill([
'provider_refresh_token' => $this->refreshToken,
'refresh_token_expires' => $this->refreshTokenExpires,
]);
}
if (is_array($this->vendorValues) && array_key_exists('scope', $this->vendorValues) && ! empty($this->vendorValues['scope'])) {
$account->fill([
'auth_scope' => is_scalar($this->vendorValues['scope'])
? $this->vendorValues['scope']
: json_encode($this->vendorValues['scope'], JSON_THROW_ON_ERROR),
]);
} else {
$account->fill([
'auth_scope' => null,
]);
$this->logger->warning(
'[OAuth permissions] OAuth callback is not providing information about scopes or it is in different format than expected',
// pulling directly from the token, just to avoid potential masking of the issue
['token_values' => $this->accessToken->getValues()],
);
}
$account->save();
// Association can be from an updated token so don't re-announce this.
if (
$account->wasRecentlyCreated
&& in_array($provider, SocialAccount::CRM_PROVIDERS, true)
&& $provider !== SocialAccount::PROVIDER_HUBSPOT
&& $providerUser->getId() !== null
) {
$crm = $user->team->crm;
$data = [
'crm_configuration_id' => $crm->id,
'log_notes' => Profile::LOG_NOTE_ENHANCED,
];
$crmProfile = $user->crmProfile()->where([
'crm_provider_id' => $providerUser->getId(),
])->first();
$user->crmProfile()->updateOrCreate([
'crm_provider_id' => $providerUser->getId(),
], $data);
// If updated, fire reconnected
if ($crmProfile !== null) {
$this->eventDispatcher->dispatch(new CrmAccountReconnected($account));
}
}
$this->eventDispatcher->dispatch(new SocialAccountConnected($account));
return $account;
}
public function integrate(string $provider, User $user, Team $team): void
{
if ($provider === SocialAccount::PROVIDER_SLACK) {
if (! isset($this->vendorValues['ok'])
|| $this->vendorValues['ok'] !== true
|| ! isset($this->vendorValues['token_type'])
|| $this->vendorValues['token_type'] !== 'bot'
) {
// code expects V2 token, which differs slightly from V1
throw new LogicException('Invalid token received from Slack OAuth v2 API');
}
$webhook = $this->vendorValues['incoming_webhook'];
$slackTeamId = $this->vendorValues['team']['id'];
$botData = [
'channel' => $webhook['channel'],
'channel_id' => $webhook['channel_id'],
'config_url' => $webhook['configuration_url'],
'webhook_url' => $webhook['url'],
'bot_user_id' => $this->vendorValues['bot_user_id'],
'bot_access_token' => $this->accessToken->getToken(),
];
$slackBot = $team->slackBot()->updateOrCreate(['slack_team_id' => $slackTeamId], $botData);
if ($slackBot->wasRecentlyCreated) {
// Send Slack notification.
$user->notify(new SlackBotAdded());
}
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function getToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_ATTEMPT);
$this->logger->info('[SocialAccountService] Fetching token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$account->refresh();
if (
! $forceRefresh
&& ($this->tokenDoesNotExpire($account) || $this->hasValidToken($account))
) {
$this->logger->info('[SocialAccountService] Token retrieved', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_FETCH, self::TOKEN_RESULT_SUCCESS);
return $this->encryptedTokenManager->getAccessToken($account);
}
try {
$this->logger->info('[SocialAccountService] Token needs refreshing', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
return $this->refreshToken($account, $forceRefresh);
} catch (IdentityProviderException $exception) {
$responseBody = $exception->getResponseBody();
if ($responseBody instanceof Response) {
$responseBody = $responseBody->getBody();
}
if (is_object($responseBody) && method_exists($responseBody, '__toString')) {
$responseBody = $responseBody->__toString();
}
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'responseBody' => $responseBody,
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
} catch (SocialAccountTokenInvalidException $exception) {
$this->logger->error('[SocialAccountService] Cannot obtain token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception::class,
'errorMessage' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
if ($account->state !== SocialAccount::STATE_FULL_REFRESH_REQUIRED) {
$this->logger->error('[SocialAccountService] Full refresh required', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
// Something terrible happened their token, they need to reconnect.
$account->update(['state' => SocialAccount::STATE_FULL_REFRESH_REQUIRED]);
$this->eventDispatcher->dispatch(new SocialAccountDisconnected($account));
}
throw new SocialAccountTokenInvalidException('Flow refresh required.', 1, $exception);
}
}
public function refreshSocialAccountToken(SocialAccount $socialAccount): void
{
try {
$this->getToken($socialAccount);
} catch (Throwable $e) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $socialAccount->getId(),
'provider' => $socialAccount->getProviderName(),
'reason' => $e->getMessage(),
]);
}
}
/**
* @throws SocialAccountTokenInvalidException
*/
public function refreshToken(SocialAccount $account, bool $forceRefresh = false): AccessToken
{
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_ATTEMPT);
$newToken = null;
Cache::lock(sprintf('oauth-refreshtoken-%s', $account->id), 10)
->block(8, function () use ($account, $forceRefresh, &$newToken): void {
try {
$account->refresh();
$token = $this->encryptedTokenManager->getAccessToken($account);
if (! $forceRefresh && $this->hasValidToken($account)) {
$newToken = $token;
return;
}
if (! $this->tokenDoesNotExpire($account) && ! $token->getRefreshToken()) {
$this->logger->error('[SocialAccountService] Refresh token not found', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
$this->sendTokenStatsToDatadog(
$account,
self::TOKEN_STATE_REFRESH,
self::TOKEN_RESULT_FAILURE,
);
throw new SocialAccountTokenInvalidException(
'Refresh token is not set, re-connection required.',
);
}
$this->logger->info('[SocialAccountService] Refreshing token from provider', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'refreshToken' => hash('sha256', $account->getProviderRefreshToken()),
'state' => $account->getState(),
]);
$newToken = $this->getProvider($account->provider)
->getAccessToken('refresh_token', [
'refresh_token' => $token->getRefreshToken(),
])
;
if ($newToken->getToken() === $token->getToken()) {
$this->logger->info('[SocialAccountService] Refreshed with an identical token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
]);
}
} catch (ConnectException | RequestException $exception) {
$this->logger->error('[SocialAccountService] Failed to refresh token', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'error' => $exception->getMessage(),
]);
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_FAILURE);
// This usually occurs due to SSL errors.
throw new SocialAccountTokenInvalidException(
'Token could not be refreshed.',
$exception->getCode(),
$exception,
);
}
$account->provider_user_token = $newToken->getToken();
$account->expires = $newToken->getExpires();
$account->state = SocialAccount::STATE_CONNECTED;
if ($newToken->getRefreshToken()) {
$account->provider_refresh_token = $newToken->getRefreshToken();
$values = $newToken->getValues();
$account->refresh_token_expires = isset($values['refresh_token_expires_in'])
? now()->addSeconds($values['refresh_token_expires_in'])->getTimestamp()
: null;
}
$account->save();
});
$this->sendTokenStatsToDatadog($account, self::TOKEN_STATE_REFRESH, self::TOKEN_RESULT_SUCCESS);
$this->logger->info('[SocialAccountService] Token refreshed', [
'socialAccountId' => $account->id,
'provider' => $account->getProviderName(),
'state' => $account->getState(),
]);
return $newToken;
}
/**
* @return string[]
*/
private function getAccessScope(string $provider): array
{
$scopes = [];
$providerScopes = config('services.' . $provider . '.scope');
if ($providerScopes) {
$scopes = preg_split('/\s+/', $providerScopes);
}
return $scopes;
}
/**
* @throws InvalidEnumException
*/
public function getAuthorizationOptions(string $provider): array
{
$scopes = ['scope' => $this->getAccessScope($provider)];
switch ($provider) {
case SocialAccount::PROVIDER_LINKEDIN:
case SocialAccount::PROVIDER_LINKEDIN_CONFERENCE:
case SocialAccount::PROVIDER_SALESFORCE:
case SocialAccount::PROVIDER_HUBSPOT:
case SocialAccount::PROVIDER_OUTREACH:
case SocialAccount::PROVIDER_SALESLOFT:
case SocialAccount::PROVIDER_ZOOM_PHONE:
case SocialAccount::PROVIDER_PIPEDRIVE:
case SocialAccount::PROVIDER_SLACK:
case SocialAccount::PROVIDER_AIRCALL:
case SocialAccount::PROVIDER_BULLHORN:
case SocialAccount::PROVIDER_RINGCENTRAL:
case SocialAccount::PROVIDER_AVAYA:
case SocialAccount::PROVIDER_TELUS:
case SocialAccount::PROVIDER_DIALPAD:
case SocialAccount::PROVIDER_TALKDESK:
return $scopes;
case SocialAccount::PROVIDER_OFFICE:
return $scopes + [
'access_type' => 'offline',
];
case SocialAccount::PROVIDER_GOOGLE:
return $scopes + [
'access_type' => 'offline',
'include_granted_scopes' => 'true',
'approval_prompt' => null,
];
default:
throw new InvalidEnumException();
}
}
private function tokenDoesNotExpire(SocialAccount $account): bool
{
return in_array($account->provider, SocialAccount::PROVIDERS_WITHOUT_EXPIRY, true);
}
private function hasValidToken(SocialAccount $account): bool
{
return $account->expires > now()->addMinutes(self::REFRESH_OFFSET_MIN)->getTimestamp();
}
private function sendTokenStatsToDatadog(SocialAccount $account, string $state, string $result): void
{
Datadog::increment('jiminny.access_token', 1, [
'provider' => $account->getProviderName(),
'state' => $state,
'result' => $result,
]);
}
private function mapLinkedInUserData(LinkedInResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => sprintf('%s %s', $providerUser->getFirstName(), $providerUser->getLastName()),
];
}
private function mapSalesforceUserData(SalesforceResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
try {
$parsedNumber = $this->phoneNumberUtil->parse($rawUserData['mobile_phone'], $this->countryCode);
$number = $this->phoneNumberUtil->format($parsedNumber, PhoneNumberFormat::E164);
} catch (NumberParseException) {
$number = null;
}
// Todo: this should check the `organization_id` matches the parent crm configuration.
return [
'country_code' => $this->countryCode,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getFirstName() . ' ' . $providerUser->getLastName(),
'phone' => $number,
'crm_provider_id' => $rawUserData['organization_id'],
'crm_base_url' => $this->vendorValues['instance_url'],
];
}
/**
* Todo: this should check the `getHubId` matches the parent crm configuration.
*/
private function mapHubSpotUserData(HubSpotResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $providerUser->getHubId(),
'crm_base_url' => $providerUser->toArray()['hub_domain'],
];
}
/**
* Todo: this should check the `getCompanyId` matches the parent crm configuration.
*/
private function mapPipedriveUserData(PipedriveResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'crm_provider_id' => $rawUserData['data']['company_id'],
'crm_base_url' => '[URL_WITH_CREDENTIALS] ActivityProviderException
*/
private function mapDialpadUserData(DialpadResourceOwner $providerUser): array
{
$rawUserData = $providerUser->toArray();
// They need to be Super Admin to access the Company APIs.
$this->logger->info('[Dialpad] User authenticated', $rawUserData);
if (isset($rawUserData['is_super_admin']) && $rawUserData['is_super_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Dialpad Super Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapAircallUserData(AircallResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapZoomPhoneUserData(ZoomResourceOwner $providerUser): array
{
return[
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
/**
* @throws ActivityProviderException
*/
private function mapSalesloftUserData(SalesloftResourceOwner $providerUser): array
{
if ($providerUser->toArray()['data']['team_admin'] === false) {
throw new ActivityProviderException(
"Sorry, you'll need to be a Team Admin to add this integration.",
);
}
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
];
}
private function mapBullhornUserData(): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
];
}
private function mapTalkdeskUserData(TalkdeskResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
private function mapRingCentralUserData(RingcentralResourceOwner $providerUser): array
{
return [
'country_code' => $this->countryCode,
'phone' => null,
'timezone' => $this->timezone,
'email' => $providerUser->getEmail(),
'name' => $providerUser->getName(),
'id' => $providerUser->getId(),
];
}
}...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
52824
|
1853
|
34
|
2026-05-18T11:16:42.993901+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103002993_m2.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhostormVIewINavicarecodeFV faVsco.js( #12092 on J PhostormVIewINavicarecodeFV faVsco.js( #12092 on JY-20613-allow-owner-role-on-team-setupProleteyphp api.phpM MakerileMatcnActviycmmbata.pngpackage- ock.isonE phpstan.neon.dist= phostan-oaseline.neon<» phpunit.xmlleraw_sqL_query.sqMIREADME.mdsonar-project.propertiesE test.py<> Untitled Diagram.xmlus vetur.config.jsMLWERHOOK SILTERING IMPLEMENTATION.mo› ib External Librariesv E Scratches and Consolesv C Database ConsolesV A EU& console cUlA DEAL RISKS [EU]&DI LUIA EU (EU& iminny@localhost& console [iiminnv@localhosti4D/liminny@localhostA HS local fiiminnv@localhostl4 S= liminnv@localhostlA zoho dev liminnv@localhostiV APRODconsole PRODIconsole 1PRODI# DI IPRODIServices+o cv M Databasev AEU# console 4 slGi crm_configurations 1 s 776 msHiilucors 1 c 620 mgv A jiminny@localhostA HS localV & PRODA console 4 s(ii users 2 s 554 mgV A STAGINGA console 1 ç 021 mda nokorC) User.pnpUserinvitationDTOlest.onp© ClientTest.php© EditTeamRequest.phpUserinvitationDlo.pnp xA2V4Anamespace Jiminny DTO Invitation:class Userinvitationdtouse UserEmatl.public string Semail;public ?string $secondaryEmail;public ?int $groupld;nublic int Steamtd.public bool ScrmRequiredpuoulc array sroleras,public bool $isOwner;public ?User $currentUser = null;* Qparam arrayfemail: string,secondaryEmail: string/null.groupld: int/null,teamid: 1ntstring.Outputtiò # 187, 209, 8150, [EMAIL] x Tx,di w421 rowsv00XL0DrnWMko_ybipYSPfCD8FSqDD8comeci307w5dyPpoCX3X5nUTSa.a3r.TROTeVoo5F163011BWUM1200da5Vzc6zc0F LakbJwadwisavd.wSuTP77A0TSOLM 897n.HonVSt.12erCmN08iwCaVPJTka9+SVtniKA.gxM5sz8bF0rq0g0tdfmn5ETehf0Lss5XDft2GYck1rCybqquI7LeAJ..Vw1VfrLZybHgwnBbq55UGa0_KNVMAmp7RS0wHHVBVx0acREPRWbbWl...BcNafIRUpvSSp.c0CDk3RMbwC7HiXPvZqYWMCISYiN3kHoDLDdakUi.o4aNFTaGMFWZSiKsPwTU3TELifoXBvFe6eAqu64_ckXo5WC06rtoVd.Zc4L01ZH.RV Y7xKo4v2Lo0HbYTUL04V0-ArLDMCYGNoYdomd.0to.1-SMnK84Qv.|8GGu5S¿7oECT|IvWIne63nCaPAvEWI TdhkAax7SYsok6.wFh9mdYEf4bfPxQVvD9N9qdWL7uldyzPBwEIUuz49d3VHikwKCWh2m.11 nnhKxaT2d.28JcbU1mzkoAnFMrqaJ2ocDsxkfXLJBq0_Kba7LUHfX4..sVv05fvKoornuu8t4802FkKtLH0LkkquLNPTL01SXbXXuxRntV.sb2ul6Kaw0ce8on0YwmwOWZS vRc9xmXJB0n00nX.63nXUwinbzvdNs<^.= custom.log= laravel.log« SF jiminny@localhost]& console [STAGING]« HS_local [jiminny@localhost]A console [PROD]tiò jiminny.users (PROD]]© Kernel.php# console [eu)SoftPhoneManager.php Xtiò jiminny.users [EU]tii crm_configurations (EU]namespace Jiminny Component 1w1L10 conterence conterenceManager:useuLuminate Database Eloquent:useLuminate Suoport str:use Jiminny Component\ElasticSearch \Model\Observer;use Jiminnv Comoonent Twilio Conference ConferenceManager.use Jiminny Component\Twilio\Exception\Out0fBoundsException;use Jiminnv Comoonent Twilio Excention UnexoectedValueExcention:use Jiminny Component Twilio \Resolver;luse liminnv Comnonent Twil io V0.use Jiminny\Component\UrlGenerator Webhook;use liminnv Fvents.use Jiminny Exceptions LogicExcention:use liminnv Models.use Jininny Models rarulclpant connectionluce liminnv Services Activityservice'use Jiminny services Accivity crnuwnerkesolverhuse Jininny services crn rrovlderkeclscryruse Jininny services leleonony Iwilloullentburlderuse Psr Loq Loqgerintertace:use Iw1l10 Exceptions contiqurationexceptzonAccept File & X Reject File 0%@use 1w1L10 \exceptions Restexception:Reject• supoont Dally • In 44 m100% 2Mon 18 May 14:16:42UserinvitationDTOTest vcascadeImplement Trial OwneFixing Redis Rate LimImplement Salestorkead crmownerkesolver.phpThought tor 1s >searched crmownerkesolver in ~/minny appSearched Twilio.*CRM|Twilio.*Salesforce in ~/jiminny/appTnoughttor issearched salestorce Ckm in app/services/ lelephonySearched SalesforcelCRMicrm in aoo/Comoonent/TwiliolRead SoftPhoneManager.php and TextMessagingService.phpThought for 2s3 / 7 tasks done• Identifv where CRM obiect matchina hannens for Twilio callsImplement fallback token logic in SoftPhoneManager for outbound callsThought for 2sU SoftPhoneManager.phpAsk anvthina (%4L)+ <>Code SWE-1.6+0 ..149 tokens÷ @provider_refresh_token Y5Aep861k6qv8Dh1kqb3Wa0DvfGZqc.6pxiJbE04U47bNtRKmzRYq0ASxTKm9VPEj0d.HSywWriZGqKAfiLHU4h95Aep861k6av8Dh1kab3Wa0DvfGZabM8GfB.n2fC.2owAZRGXF0YzXocRZtxKn0DctFyT0H374Ak9ni7_M6PBec.5Aep861k6qv8Dh1kgb3Wa0DvfGZgc.6pxiJbE0472.FmTr2oeTiljoniUgUCh6NNe5KHEWq3g9R1Js.MCDTvKON5Aep861k6qv8Dh1kgb3Wa0DvfGZgd_W8tbY9u8ATNVJUuw4W9xi2mgpGxMqMLW0vN0T9g1KHeRReFRfAzwU_QT25Aep861k6qv8Dh1kgb3Wa0DvfGZgbM8GfB.n2fCR9N5LD0k2hP.QG2fLkmw45DYjcJiVI9K9wahEQZkRTKv3vMo5Aep861k6av8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCTZ3AiL2S0iurvoXKncXqq6DE3Y.oVZj_ihH5XWAhr2Ze5rGb5Aep861k6av8Dh1kqb3Wa0DvfGZqbM8Gfß.n2fCozEAkk6pL4MhW11d£≥Nfcw18YXnvLHxFYoCMWkX3X.OPBeF|5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8Gfß.n2£CZsq1q1L0VHv.KaM£Q1htdX_NHRN03~FWUHvdZJ6U3GKMVvb«5Aеp861k6qv8Dh1kgb3Wa0DvfGZgbM8GfB.n2fCDcth8BSNVdnLkGUDcHQ0JyvFeBW30AeyfLaEaFputIp__ESG5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCnyuMtp0W6QBeFci_cn30hsIK8F.TaFXT90N.Bw==5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCH0ZPKDH_27ulEJ6IrWs6x5siQUaB3Ip.9AJAz9_YhZonyIpX5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCr_Bv3_TuaRiKeqLt1aJkNotcUAhwTKtHbAv9₫E4ZNF5z7afc5Aep861k6av8Dh1kab3Wa0DvfGZabM8GfB.n2fC0X7dmlErUGkoq5oKH2o7K2xKC3rvHvdxPw4t@AETVZeivTLk1expires YI• refresh_token_expires Y ÷1 provider Y<null><null><null><null><null»<null><nulls<null><null><nul1>‹null› salestorce‹null> salesforce‹null> salesforce<null> salesforce‹null> salesforce‹null> salesforce<nul salesforce<nul> salesforce<null> salesforce<null> salesforce<null> salesforce‹null> salesforce<nul> salesforcel state Y÷ m auth_scope Yfull-refreshfull-refreshfull-nefreshconnectedfull-refreshconnectedfull-refreshconnectediconnectedlconnostodlconnectedconnectedconnectediretresh token web ap1refresh_token web apirefresh_token web apirefresh token web apirefresh_token web apirefresh tokerweb aonnpfrech token weh ansnofnoch tokon woh an:nofrock tolon woh on:refresh token web am0 retry_after Y<null><null><null><nul1:<nulsenullsenults<null:1created at Y;1updated _at Y2023-12-05 15:39:342023-12-05 16:02•292023-12-14 10-35-312024-01214 12:11.112023-12-11 14:57:582023-12-14 09:55:462023-12-13 16:12:062023-12-14 12:08•372023-12-12 19-07-542003-10-13 12•52-722024-01-18 11:52:342023-12-13 12•56•172026-05-12 06:42:592025-02-03 12:50:272026-05-12 07-15-282024-05-12 07-15•442025-02-06 11:50:492026-05-18 01:15:512025-05-20 12:50:502026-05-18 01:18:472026-05-18 01-09-242024-05-19 01.10.302026-05-18 01:17:122026-05-18 01:19:132026-05-18 01•17•49WN Windsurf Teams21-1UITE.8IeyJevJneyJIeyJieyJleyJlev.heyJieyJieyJleyJlevJnev.inio 4 spaces...
|
NULL
|
-8757005832079474941
|
NULL
|
visual_change
|
ocr
|
NULL
|
PhostormVIewINavicarecodeFV faVsco.js( #12092 on J PhostormVIewINavicarecodeFV faVsco.js( #12092 on JY-20613-allow-owner-role-on-team-setupProleteyphp api.phpM MakerileMatcnActviycmmbata.pngpackage- ock.isonE phpstan.neon.dist= phostan-oaseline.neon<» phpunit.xmlleraw_sqL_query.sqMIREADME.mdsonar-project.propertiesE test.py<> Untitled Diagram.xmlus vetur.config.jsMLWERHOOK SILTERING IMPLEMENTATION.mo› ib External Librariesv E Scratches and Consolesv C Database ConsolesV A EU& console cUlA DEAL RISKS [EU]&DI LUIA EU (EU& iminny@localhost& console [iiminnv@localhosti4D/liminny@localhostA HS local fiiminnv@localhostl4 S= liminnv@localhostlA zoho dev liminnv@localhostiV APRODconsole PRODIconsole 1PRODI# DI IPRODIServices+o cv M Databasev AEU# console 4 slGi crm_configurations 1 s 776 msHiilucors 1 c 620 mgv A jiminny@localhostA HS localV & PRODA console 4 s(ii users 2 s 554 mgV A STAGINGA console 1 ç 021 mda nokorC) User.pnpUserinvitationDTOlest.onp© ClientTest.php© EditTeamRequest.phpUserinvitationDlo.pnp xA2V4Anamespace Jiminny DTO Invitation:class Userinvitationdtouse UserEmatl.public string Semail;public ?string $secondaryEmail;public ?int $groupld;nublic int Steamtd.public bool ScrmRequiredpuoulc array sroleras,public bool $isOwner;public ?User $currentUser = null;* Qparam arrayfemail: string,secondaryEmail: string/null.groupld: int/null,teamid: 1ntstring.Outputtiò # 187, 209, 8150, [EMAIL] x Tx,di w421 rowsv00XL0DrnWMko_ybipYSPfCD8FSqDD8comeci307w5dyPpoCX3X5nUTSa.a3r.TROTeVoo5F163011BWUM1200da5Vzc6zc0F LakbJwadwisavd.wSuTP77A0TSOLM 897n.HonVSt.12erCmN08iwCaVPJTka9+SVtniKA.gxM5sz8bF0rq0g0tdfmn5ETehf0Lss5XDft2GYck1rCybqquI7LeAJ..Vw1VfrLZybHgwnBbq55UGa0_KNVMAmp7RS0wHHVBVx0acREPRWbbWl...BcNafIRUpvSSp.c0CDk3RMbwC7HiXPvZqYWMCISYiN3kHoDLDdakUi.o4aNFTaGMFWZSiKsPwTU3TELifoXBvFe6eAqu64_ckXo5WC06rtoVd.Zc4L01ZH.RV Y7xKo4v2Lo0HbYTUL04V0-ArLDMCYGNoYdomd.0to.1-SMnK84Qv.|8GGu5S¿7oECT|IvWIne63nCaPAvEWI TdhkAax7SYsok6.wFh9mdYEf4bfPxQVvD9N9qdWL7uldyzPBwEIUuz49d3VHikwKCWh2m.11 nnhKxaT2d.28JcbU1mzkoAnFMrqaJ2ocDsxkfXLJBq0_Kba7LUHfX4..sVv05fvKoornuu8t4802FkKtLH0LkkquLNPTL01SXbXXuxRntV.sb2ul6Kaw0ce8on0YwmwOWZS vRc9xmXJB0n00nX.63nXUwinbzvdNs<^.= custom.log= laravel.log« SF jiminny@localhost]& console [STAGING]« HS_local [jiminny@localhost]A console [PROD]tiò jiminny.users (PROD]]© Kernel.php# console [eu)SoftPhoneManager.php Xtiò jiminny.users [EU]tii crm_configurations (EU]namespace Jiminny Component 1w1L10 conterence conterenceManager:useuLuminate Database Eloquent:useLuminate Suoport str:use Jiminny Component\ElasticSearch \Model\Observer;use Jiminnv Comoonent Twilio Conference ConferenceManager.use Jiminny Component\Twilio\Exception\Out0fBoundsException;use Jiminnv Comoonent Twilio Excention UnexoectedValueExcention:use Jiminny Component Twilio \Resolver;luse liminnv Comnonent Twil io V0.use Jiminny\Component\UrlGenerator Webhook;use liminnv Fvents.use Jiminny Exceptions LogicExcention:use liminnv Models.use Jininny Models rarulclpant connectionluce liminnv Services Activityservice'use Jiminny services Accivity crnuwnerkesolverhuse Jininny services crn rrovlderkeclscryruse Jininny services leleonony Iwilloullentburlderuse Psr Loq Loqgerintertace:use Iw1l10 Exceptions contiqurationexceptzonAccept File & X Reject File 0%@use 1w1L10 \exceptions Restexception:Reject• supoont Dally • In 44 m100% 2Mon 18 May 14:16:42UserinvitationDTOTest vcascadeImplement Trial OwneFixing Redis Rate LimImplement Salestorkead crmownerkesolver.phpThought tor 1s >searched crmownerkesolver in ~/minny appSearched Twilio.*CRM|Twilio.*Salesforce in ~/jiminny/appTnoughttor issearched salestorce Ckm in app/services/ lelephonySearched SalesforcelCRMicrm in aoo/Comoonent/TwiliolRead SoftPhoneManager.php and TextMessagingService.phpThought for 2s3 / 7 tasks done• Identifv where CRM obiect matchina hannens for Twilio callsImplement fallback token logic in SoftPhoneManager for outbound callsThought for 2sU SoftPhoneManager.phpAsk anvthina (%4L)+ <>Code SWE-1.6+0 ..149 tokens÷ @provider_refresh_token Y5Aep861k6qv8Dh1kqb3Wa0DvfGZqc.6pxiJbE04U47bNtRKmzRYq0ASxTKm9VPEj0d.HSywWriZGqKAfiLHU4h95Aep861k6av8Dh1kab3Wa0DvfGZabM8GfB.n2fC.2owAZRGXF0YzXocRZtxKn0DctFyT0H374Ak9ni7_M6PBec.5Aep861k6qv8Dh1kgb3Wa0DvfGZgc.6pxiJbE0472.FmTr2oeTiljoniUgUCh6NNe5KHEWq3g9R1Js.MCDTvKON5Aep861k6qv8Dh1kgb3Wa0DvfGZgd_W8tbY9u8ATNVJUuw4W9xi2mgpGxMqMLW0vN0T9g1KHeRReFRfAzwU_QT25Aep861k6qv8Dh1kgb3Wa0DvfGZgbM8GfB.n2fCR9N5LD0k2hP.QG2fLkmw45DYjcJiVI9K9wahEQZkRTKv3vMo5Aep861k6av8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCTZ3AiL2S0iurvoXKncXqq6DE3Y.oVZj_ihH5XWAhr2Ze5rGb5Aep861k6av8Dh1kqb3Wa0DvfGZqbM8Gfß.n2fCozEAkk6pL4MhW11d£≥Nfcw18YXnvLHxFYoCMWkX3X.OPBeF|5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8Gfß.n2£CZsq1q1L0VHv.KaM£Q1htdX_NHRN03~FWUHvdZJ6U3GKMVvb«5Aеp861k6qv8Dh1kgb3Wa0DvfGZgbM8GfB.n2fCDcth8BSNVdnLkGUDcHQ0JyvFeBW30AeyfLaEaFputIp__ESG5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCnyuMtp0W6QBeFci_cn30hsIK8F.TaFXT90N.Bw==5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCH0ZPKDH_27ulEJ6IrWs6x5siQUaB3Ip.9AJAz9_YhZonyIpX5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCr_Bv3_TuaRiKeqLt1aJkNotcUAhwTKtHbAv9₫E4ZNF5z7afc5Aep861k6av8Dh1kab3Wa0DvfGZabM8GfB.n2fC0X7dmlErUGkoq5oKH2o7K2xKC3rvHvdxPw4t@AETVZeivTLk1expires YI• refresh_token_expires Y ÷1 provider Y<null><null><null><null><null»<null><nulls<null><null><nul1>‹null› salestorce‹null> salesforce‹null> salesforce<null> salesforce‹null> salesforce‹null> salesforce<nul salesforce<nul> salesforce<null> salesforce<null> salesforce<null> salesforce‹null> salesforce<nul> salesforcel state Y÷ m auth_scope Yfull-refreshfull-refreshfull-nefreshconnectedfull-refreshconnectedfull-refreshconnectediconnectedlconnostodlconnectedconnectedconnectediretresh token web ap1refresh_token web apirefresh_token web apirefresh token web apirefresh_token web apirefresh tokerweb aonnpfrech token weh ansnofnoch tokon woh an:nofrock tolon woh on:refresh token web am0 retry_after Y<null><null><null><nul1:<nulsenullsenults<null:1created at Y;1updated _at Y2023-12-05 15:39:342023-12-05 16:02•292023-12-14 10-35-312024-01214 12:11.112023-12-11 14:57:582023-12-14 09:55:462023-12-13 16:12:062023-12-14 12:08•372023-12-12 19-07-542003-10-13 12•52-722024-01-18 11:52:342023-12-13 12•56•172026-05-12 06:42:592025-02-03 12:50:272026-05-12 07-15-282024-05-12 07-15•442025-02-06 11:50:492026-05-18 01:15:512025-05-20 12:50:502026-05-18 01:18:472026-05-18 01-09-242024-05-19 01.10.302026-05-18 01:17:122026-05-18 01:19:132026-05-18 01•17•49WN Windsurf Teams21-1UITE.8IeyJevJneyJIeyJieyJleyJlev.heyJieyJieyJleyJlevJnev.inio 4 spaces...
|
52822
|
NULL
|
NULL
|
NULL
|
|
52825
|
1852
|
40
|
2026-05-18T11:16:57.270504+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103017270_m1.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DE SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DEV (docker)₴2"taskManager""taskManager"], "pid" :7, "message" : "Failed to poll for work: Error: Noconnections"}I {"type" : "log", "@timestamp" : "2026-05-18T11:16:50Z","tags" : ["error"ticsearch""data"], "pid" :7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}{"type" : "log""@timestamp": "2026-05-18T11:16:52Z", "tags" : ["warning"asticsearch", "data"], "pid" :7, "message"connection: [URL_WITH_CREDENTIALS] "2026-05-18T11:16:52Z", "tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "No livingconnections"}I {"type" : "log""@timestamp":"2026-05-18T11:16:52Z""tags" : ["error","taskManager","taskManager"], "pid":7, "message":"Failed to poll for work: Error: NoLiving connections"}1 {"type" : "log""@timestamp" : "2026-05-18T11:16:53Z", "tags" : ["error"ticsearch""pid":7, "message": "[ConnectionError]: getaddrinfo ENOTFOUND elasticseelasticsearch: 9200"}docker_lamp_12026-05-18 11:16:41 Running ['artisan' jiminny:fix-hubspot-tokens]2s DONEdocker_lamp_1 | '/usr/local/bin/php' 'artisan' jiminny:fix-hubspot-tokens > */proc/1/fd/1'2>&1docker_lamp_12026-05-18 11:16:53 Running ['artisan' conference:pre-meeting-reminder] in backgrounddocker_1amp_11 ('/usr/local/bin/php' 'artisan' conference:pre-meeting-reminder › '/proc/1/fd/1' 2>&1 ;'/usr/local/bin/php' 'artisan' schedule:finish"framework/schedule-805efb160ee8d9da02e60364ace7970eb2b35f31" "$?") > '/dev/null' 2>&1 &docker_lamp_1 |2026-05-18 11:16:53 Running ['artisan' hubspot: journal-poll --start]in background20.11ms DONEdocker_lamp_1• ('/usr/local/bin/php' 'artisan' hubspot: journal-poll --start › */proc/1/fd/1' 2>&1 ; '/usr/local/bin/php' 'artisan"schedule: finish "framework/schedule-e26d77f915d2c55fe91ca4148a230e32eaa1865e" "$?") › '/dev/null' 2>&1 &I {"type" : "log", "@timestamp" : "2026-05-18T11:16:55Z""tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "Unable to revive connection: [URL_WITH_CREDENTIALS] "2026-05-18T11:16:55Z", "tags" : ["warning", "elasticsearch", "data"], "pid":7, "message": "No livingconnections"}I {"type" : "log", "@timestamp" : "2026-05-18T11:16:55Z""tags" : ["error","taskManager"Living connections"}"taskManager"], "pid" :7, "message" : "Failed to pollfor work: Error: No1 {"type": "log", "@timestamp": "2026-05-18T11:16:55Z", "tags" : ["error"ticsearch", "data"],"pid" :7, "message": "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}View in Docker Desktop• View ConfigEnable WatchHomeDMsActivityFilesLaterMore-Jiminny ...Metrorrtence# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of_jimi...• Direct messages. Nikolay YankovR. Aneliya Angelovaão Stefka StoyanovaStoyan Tomov€. Vasil Vasilev% Galya DimitrovaLa Todor Stamatov ". Mario Georgiev. Nikolay IvanovLo James Graham *2. Stoyan Tanev&. Steliyan Georgiev&e Petko KashinskiE. Lukas Kovalik y... OAppsJira CloudToastSupport Daily • in 44 m100% C8• Mon 18 May 14:16:56Describe what you are looking for# releases8 226 0MessagesC Files• Bookmarks+52848f50 - Sele-tinnlir* drop reference toToday ~TargetEntitie.:ES_CHUNK_SIZEf32fb682 - Update TargetEntitiesSelector touse ChunkSize instead of internal const.Update test8715e69d - Remove an unused import.36cе6е8c - Remove comments.Show morejiminny/app| Added by GitHubCircleCl APP12:33 PMDeployment Successful!Project: appWhen:05/18/202609:33:05Tag:View JobNewGitHub APP2:12 PM3 new commits pushed to master bymihailmihaylovjiminnyeb6cfc4f - JY-20920: Fix participant matcherb5a8a4e0 - Merge branch 'master' into JY-20920-fix-participant-matcher231e9ad7 - Merge pull request #12091 fromjiminny/JY-20920-fix-participant-matcherjiminny/app| Added by GitHubMessage #releases+..•...
|
NULL
|
3340790695857846638
|
NULL
|
idle
|
ocr
|
NULL
|
SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DE SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DEV (docker)₴2"taskManager""taskManager"], "pid" :7, "message" : "Failed to poll for work: Error: Noconnections"}I {"type" : "log", "@timestamp" : "2026-05-18T11:16:50Z","tags" : ["error"ticsearch""data"], "pid" :7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}{"type" : "log""@timestamp": "2026-05-18T11:16:52Z", "tags" : ["warning"asticsearch", "data"], "pid" :7, "message"connection: [URL_WITH_CREDENTIALS] "2026-05-18T11:16:52Z", "tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "No livingconnections"}I {"type" : "log""@timestamp":"2026-05-18T11:16:52Z""tags" : ["error","taskManager","taskManager"], "pid":7, "message":"Failed to poll for work: Error: NoLiving connections"}1 {"type" : "log""@timestamp" : "2026-05-18T11:16:53Z", "tags" : ["error"ticsearch""pid":7, "message": "[ConnectionError]: getaddrinfo ENOTFOUND elasticseelasticsearch: 9200"}docker_lamp_12026-05-18 11:16:41 Running ['artisan' jiminny:fix-hubspot-tokens]2s DONEdocker_lamp_1 | '/usr/local/bin/php' 'artisan' jiminny:fix-hubspot-tokens > */proc/1/fd/1'2>&1docker_lamp_12026-05-18 11:16:53 Running ['artisan' conference:pre-meeting-reminder] in backgrounddocker_1amp_11 ('/usr/local/bin/php' 'artisan' conference:pre-meeting-reminder › '/proc/1/fd/1' 2>&1 ;'/usr/local/bin/php' 'artisan' schedule:finish"framework/schedule-805efb160ee8d9da02e60364ace7970eb2b35f31" "$?") > '/dev/null' 2>&1 &docker_lamp_1 |2026-05-18 11:16:53 Running ['artisan' hubspot: journal-poll --start]in background20.11ms DONEdocker_lamp_1• ('/usr/local/bin/php' 'artisan' hubspot: journal-poll --start › */proc/1/fd/1' 2>&1 ; '/usr/local/bin/php' 'artisan"schedule: finish "framework/schedule-e26d77f915d2c55fe91ca4148a230e32eaa1865e" "$?") › '/dev/null' 2>&1 &I {"type" : "log", "@timestamp" : "2026-05-18T11:16:55Z""tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "Unable to revive connection: [URL_WITH_CREDENTIALS] "2026-05-18T11:16:55Z", "tags" : ["warning", "elasticsearch", "data"], "pid":7, "message": "No livingconnections"}I {"type" : "log", "@timestamp" : "2026-05-18T11:16:55Z""tags" : ["error","taskManager"Living connections"}"taskManager"], "pid" :7, "message" : "Failed to pollfor work: Error: No1 {"type": "log", "@timestamp": "2026-05-18T11:16:55Z", "tags" : ["error"ticsearch", "data"],"pid" :7, "message": "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}View in Docker Desktop• View ConfigEnable WatchHomeDMsActivityFilesLaterMore-Jiminny ...Metrorrtence# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of_jimi...• Direct messages. Nikolay YankovR. Aneliya Angelovaão Stefka StoyanovaStoyan Tomov€. Vasil Vasilev% Galya DimitrovaLa Todor Stamatov ". Mario Georgiev. Nikolay IvanovLo James Graham *2. Stoyan Tanev&. Steliyan Georgiev&e Petko KashinskiE. Lukas Kovalik y... OAppsJira CloudToastSupport Daily • in 44 m100% C8• Mon 18 May 14:16:56Describe what you are looking for# releases8 226 0MessagesC Files• Bookmarks+52848f50 - Sele-tinnlir* drop reference toToday ~TargetEntitie.:ES_CHUNK_SIZEf32fb682 - Update TargetEntitiesSelector touse ChunkSize instead of internal const.Update test8715e69d - Remove an unused import.36cе6е8c - Remove comments.Show morejiminny/app| Added by GitHubCircleCl APP12:33 PMDeployment Successful!Project: appWhen:05/18/202609:33:05Tag:View JobNewGitHub APP2:12 PM3 new commits pushed to master bymihailmihaylovjiminnyeb6cfc4f - JY-20920: Fix participant matcherb5a8a4e0 - Merge branch 'master' into JY-20920-fix-participant-matcher231e9ad7 - Merge pull request #12091 fromjiminny/JY-20920-fix-participant-matcherjiminny/app| Added by GitHubMessage #releases+..•...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
52826
|
1853
|
35
|
2026-05-18T11:17:16.124593+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103036124_m2.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12092 on JY-20613-allow- Project: faVsco.js, menu
#12092 on JY-20613-allow-owner-role-on-team-setup, menu
Start Listening for PHP Debug Connections
UserInvitationDTOTest
Run 'UserInvitationDTOTest'
Debug 'UserInvitationDTOTest'
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":"#12092 on JY-20613-allow-owner-role-on-team-setup, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.12533244,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12092 exists for current branch JY-20613-allow-owner-role-on-team-setup","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.83610374,"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":"UserInvitationDTOTest","depth":6,"bounds":{"left":0.85139626,"top":0.019952115,"width":0.06416223,"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 'UserInvitationDTOTest'","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 'UserInvitationDTOTest'","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}]...
|
1421024576491178512
|
-8780532123125446714
|
idle
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12092 on JY-20613-allow- Project: faVsco.js, menu
#12092 on JY-20613-allow-owner-role-on-team-setup, menu
Start Listening for PHP Debug Connections
UserInvitationDTOTest
Run 'UserInvitationDTOTest'
Debug 'UserInvitationDTOTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
PhostormVIeWINavicarecodeLaravelFV faVsco.js( #12092 on JY-20613-allow-owner-role-on-tearProiectpip apl.onp› D ConferenceHandlerMatcnActviycmmbata.pngv D [EMAIL]• ConferenceCallbackHandler.php© ConferenceManager.phpDDIO>0 Event>D ExceptionWJob>W ResolvelService>DVOg TwilioConstants.phpc)TwiioReoositorv.onoUoloaden7 UrlGeneratorD UtilityM UuidM WaveformN WehhookcWorkflow> M ConfiaurationD Console• D Commands>@ Activities>@ Analytics)mCnlondarev 0Crm>@ Hubspot> D IntegrationAppServicesv M DatabasevAEU# console 4 slGi crm_configurations 1 s 776 msHiilucors 1 c 620 mgv A jiminny@localhostA HS localV & PRODA console 4 sfii users 2 s 554 mgV A STAGINGA console 1 c 021 mda nokornamespace Jiminny DTO Invitation:class UserInvitationDTOuse UserEmatl.public string Semail;public ?string $secondaryEmail;public ?int $groupld;public int SteamId;public bool ScrmRequiredpuoulc array srolelaspublic bool $isOwner;public ?User $currentUser = null;* Qparam arrayfemail: string,secondaryEmail: string/null.groupld: int/null,teamid: 1ntstring.Outputtiò # 187, 209, 8150, [EMAIL] x Tx,di w421 rowsv00XL0DrnWMko_ybipYSPfCD8FSqDD8comeci307w5dyPpoCX3X5nUTSa.a3r.TROTeVoo5F163011BWUM1200da5Vzc6zc0F LakbJwadwisavd.wSuTP77A0TSOLM 897n.HonVSt.12erCmN08iwCaVPJTka9+SVtniKA.gxM5sz8bF0rq0g0tdfmn5ETehf0Lss5XDft2GYck1rCybqquI7LeAJ...VwLVtrLLydhgwnbbqssubad_KnvmAmp/ksuwhHvbvxuackcPkwbbwl...BcNafIRUpvSSp.c0CDk3RMbwC7HiXPvZqYWMCISYiN3kHoDLDdakUi.o4aNFTaGMFWZSiKsPwTU3TELifoXBvFe6eAqu64_ckXo5WC06rtoVd.Zc4L01ZH.RV Y7xKo4v2Lo0HbYTUL04V0-ArLDMCYGNoYdomd.0to.1-SMnK84Qv.|8GGu5S¿7oECT|IvWIne63nCaPAvEWI TdhkAax7SYsok6.10 wFh9mdYEf4bfPxQVvD9N9qdWL7uldyzPBwEIUuz49d3VHikwKCWh2m.11 nnhKxaT2d.28JcbU1mzkoAnFMrqaJ2ocDsxkfXLJBq0_Kba7LUHfX4..12 sVvq3fvK6qrnuU8t4B02FkKt1H0LkkquLNP1L01sXbXXuxRntV.sb2ul6Kow0ce8on0YwmwOWZS vRc9xmX.JB0n001X.63nXUwinbzvdNs<~.C) User.pnpUserinvitationDTOTest.php= custom.log= laravel.log« SF jiminny@localhost]& console [STAGING]« HS_local [jiminny@localhost]© ClientTest.php© EditTeamRequest.phpA console [PROD]tiò jiminny.users (PROD]© Kernel.php# console [eu)© SoftPhoneManager.php X iii jiminny.users [EU]UserinvitationDlo.pnp xtii crm_configurations (EU]A2V4Ause Jiminny Component\Twilio\Exception\UnexpectedValueException;use Jiminny Component Twilio \Resolver;use Jiminny\Component\Twilio\VO;use Jiminnv Comnonent UrlGenerator Webhook:use simannyeventsuse Jiminny \Exceptions \LogicExceptionuse siminny ModelslKohnebalavwmlalalocwwtewaawwalalatealuse Jiminhy services acrivityservice.use sininny services Accivicy crmuwnerkesolvernuse viminny services crm cacheccrmservicevecoracoruse Jiminny services crm Providerkeqiscryuse Jiminny services lelephony Iw1l1ocllentbullder:use Psr Log Loggerintertaceuse Iw1l10 cxceptions contiqurationexception:use wiL0 xceptzonsw1L0-xcedtzon:use Tw1L10 TwiML:nublic const int COMPLTANCE PRONPT TNEQUT SECONDS = 201nublic const strina COMPLTANCE PROMPT ACCEPT DIGTT = '11.*1of2 edite JAccept File & X Reject File 0%@public function __construct÷ @provider_refresh_token YI expires YI refresh_token_expires Y1 provider Y5Aep861k6qv8Dh1kqb3Wa0DvfGZqc.6pxiJbE04U47bNtRKmzRYq0ASxTKm9VPEj0d.HSywWriZGqKAfiLHU4h9<null>‹null› salestorce5Aep861k6av8Dh1kab3Wa0DvfGZabM8GfB.n2fC.2owAZRGXF0YzXocRZtxKn0DctFyT0H374Ak9ni7_M6PBec.‹null> salesforce5Aep861k6qv8Dh1kgb3Wa0DvfGZgc.6pxiJbE0472.FmTr2oeTiljoniUgUCh6NNe5KHEWq3g9R1Js.MCDTvKON‹null> salesforce5Aep861k6qv8Dh1kgb3Wa0DvfGZgd_W8tbY9u8ATNVJUuw4W9xi2mgpGxMqMLW0vN0T9g1KHeRReFRfAzwU_QT25Aep861k6qv8Dh1kgb3Wa0DvfGZgbM8GfB.n2fCR9N5LD0k2hP.QG2fLkmw45DYjcJiVI9K9wahEQZkRTKv3vMg<null><null><null> salesforce‹null> salesforce5Aep861k6av8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCTZ3AiL2S0iurvoXKncXqq6DE3Y.oVZj_ihH5XWAhr2Ze5rGb<null>‹null> salesforce5Aep861k6av8Dh1kqb3Wa0DvfGZqbM8Gfß.n2fCozEAkk6pL4MhW11d£≥Nfcw18YXnvLHxFYoCMWkX3X.OPBeF|<null> salesforce5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8Gfß.n2£CZsq1q1L0VHv.KaM£Q1htdX_NHRN03~FWUHvdZJ6U3GKMVvb«<null><nul> salesforce5Aеp861k6qv8Dh1kgb3Wa0DvfGZgbM8GfB.n2fCDcth8BSNVdnLkGUDcHQ0JyvFeBW30AeyfLaEaFputIp__ESG<nulls<null> salesforce5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCnyuMtp0W6QBeFci_cn30hsIK8F.TaFXT90N.Bw==<null><null> salesforce5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCH0ZPKDH_27ulEJ6IrWs6x5siQUaB3Ip.9AJAz9_YhZonyIpX<null><null> salesforce5Aep861k6qv8Dh1kqb3Wa0DvfGZqbM8GfB.n2fCr_Bv3_TuaRiKeqLt1aJkNotcUAhwTKtHbAv9₫E4ZNF5z7afd<nul1>‹null> salesforce5Aep861k6av8Dh1kab3Wa0DvfGZabM8GfB.n2fC0X7dmlErUGkoq5oKH2o7K2xKC3rvHvdxPw4t@AETVZeivTLk<nul> salesforcekenect• suppont Dally • In 43 m100% 2Mon 18 May 14:17:17UserinvitationDTOTest vcascadeImplement Trial OwneFixing Redis Rate Lim• Implement SalestorSearched Salesforce|CRM in app/Services/TelephonyRead SoftPhoneManager.oho and TextMessaainaService.ohoThought for 2s›3/7 tasks done >• Identity where CRM obiect matchina happens for Twilio calls4) molement talllback token lodic in SoftPhoneManader for outbound callsThouaht for 2sSoftPhoneManager.phpThought for 1s›• SoftPhoneManager.phpSoftPhoneManager.phpThoughtso/ tasks done+0 ..+10-7+6-2ille wnroReject allAccept allAsk anvthina (%4L)+ <>Code sws.eI state Y÷ m auth_scope Yfull-refreshfull-refreshfull-nefreshconnectedfull-refreshconnectedfull-refreshconnectediconnectedlconnectedconnectedconnectedconnectediretresh token web ap1refresh_token web apirefresh_token web apirefresh token web apirefresh token web ap1refresh tokenweb aonrefresh token web apirefresh token web apirefresh token web ao:0 retry_after Y<null><null><null><null><nul1senults<null:esV vWcreated at Y updated_ at Y2023-12-05 15:39:342026-05-12 06:42:592023-12-05 16:02•292025-02-03 12:50:272023-12-14 10-35-312026-05-12 07-15-282024-01214 12:11.112024-05-12 07-15•442023-12-11 14:57:582025-02-06 11:50:492023-12-14 09:55:462023-12-13 16:12:062023-12-14 12:08•372026-05-18 01:15:512025-05-20 12:50:502026-05-18 01:18:472023-12-12 10•07•512026-05-18 01-09-242003-10-13 12•52-722024-05-19 01.10.3001 14 20.90.192026-05-18 01:17:122024-01-18 11:52:342026-05-18 01:19:132023-12-13 12•56•172026-05-18 01•17•49WN Windsurf Toams 21-1UTF.8eyJevJneyJIeyJieyJleyJlev.heyJieyJieyJieyJievJnev.inio 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
52844
|
1854
|
7
|
2026-05-18T11:19:48.304664+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103188304_m1.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12092 on JY-20613-allow- Project: faVsco.js, menu
#12092 on JY-20613-allow-owner-role-on-team-setup, menu
Start Listening for PHP Debug Connections
UserInvitationDTOTest
Run 'UserInvitationDTOTest'
Debug 'UserInvitationDTOTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings...
|
[{"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":"#12092 on JY-20613-allow-owner-role-on-team-setup, menu","depth":5,"on_screen":true,"help_text":"Pull request #12092 exists for current branch JY-20613-allow-owner-role-on-team-setup","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":"UserInvitationDTOTest","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Run 'UserInvitationDTOTest'","depth":6,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Debug 'UserInvitationDTOTest'","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}]...
|
1421024576491178512
|
-8780532123125446714
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12092 on JY-20613-allow- Project: faVsco.js, menu
#12092 on JY-20613-allow-owner-role-on-team-setup, menu
Start Listening for PHP Debug Connections
UserInvitationDTOTest
Run 'UserInvitationDTOTest'
Debug 'UserInvitationDTOTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81{"type": "log""@timestamp": "2026-05-18T11:19:40Z"asticsearch", "data"],connections"}"tags" : ["warning"I {"type" : "log", "@timestamp" : "2026-05-18T11:19:40Z""tags" : ["error","taskManager""taskManager"],"message" :"Failed to pollfor work: Error: Noconnections"}1 {"type" : "log":"2026-05-18T11:19:40Z", "tags" : ["warning"asticsearch", "data"], "pid" :7,[URL_WITH_CREDENTIALS] "2026-05-18T11:19:40Z", "tags" : ["warning", "elasticsearch", "data"],"pid" :7,"No livingconnections"}I {"type" : "log", "@timestamp" : "2026-05-18T11:19:40Z"ins", "reporting", "esqueue".,"queue-worker""tags" : ["error""error"], "pid" :7, "message": "mpau4y7h00070bdf8646mdeo - job querying failed: Error: No Living connections \nat sendReqWithConnection(/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:266:15)\n(/usr/share/kibana/node_modules/elasticsearch/src/lib/connection_pool.js:243:7)\nprocess._tickCallback (internal/process/next_tick.js:61:11)"}ticsearch"1 {"type": "log", "@timestamp" : "2026-05-18T11:19:41Z","tags" : ["error","data"], "pid" :7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}kibana1 {"type": "log","@timestamp" : "2026-05-18T11:19:43Z", "tags" : ["warning""elasticsearch", "data"],"pid":7, "message": "Unable to revive connection: [URL_WITH_CREDENTIALS] :"2026-05-18T11:19:43Z", "tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "No living connections"}kibanains"1 {"type": "log", "@timestamp": "2026-05-18T11:19:43Z""tags" : ["error","plug, "taskManager","taskManager"], "pid" :7, "message": "Failed to poll for work: Error: NoLiving connections"}kibana1 {"type": "log"., "@timestamp": "2026-05-18T11:19:43Z", "tags" : ["error", "elasticsearch",, "data"], "pid":7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch: 9200"}kibanaI {"type" : "log", "@timestamp" : "2026-05-18T11: 19:46Z","tags" : ["error", "elasticsearch", "data"], "pid" :7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}kibana1 {"type" : "log""@timestamp":"2026-05-18T11:19:46Z""tags": ["warning", "elasticsearch", "data"], "pid" :7,"message": "Unable to revive connection: [URL_WITH_CREDENTIALS] : "2026-05-18T11:19:46Z", "tags" : ["warning", "elasticsearch", "data"], "pid" :7,"message": "No living connections"}kibana1 {"type": "log", "@timestamp": "2026-05-18T11:19:46Z", "tags" : ["error", "plugins",, "taskManager",, "taskManager"], "pid" :7, "message": "Failed to poll for work: Error: NoLiving connections"}View in Docker Desktop• View ConfigEnable WatchHomeо-DMsActivityFilesLaterMoreJiminny ...Metrotrtencee# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of_jimi...• Direct messages. Nikolay Yankov8. Aneliya Angelovaão Stefka Stoyanova. Stoyan Tomov€. Vasil VasilevGalya DimitrovaLe Todor Stamatov "N. Mario Georgiev. Nikolay IvanovLo James Graham *2 Stoyan Tanev&. Steliyan Georgiev&e Petko KashinskiLukas Kovalik y... OAppsJira CloudToastSupport Daily • in 41m100% C8• Mon 18 May 14:19:47Describe what you are looking for# releases8 226 0MessagesC Files• Bookmarks+52848f50 - Sele-tinnlir* drop reference toToday ~TargetEntitie.:ES_CHUNK_SIZEf32fb682 - Update TargetEntitiesSelector touse ChunkSize instead of internal const.Update test8715e69d - Remove an unused import.36cе6е8c - Remove comments.Show morejiminny/app| Added by GitHubCircleCl APP12:33 PMDeployment Successful!Project: appWhen:05/18/202609:33:05Tag:View JobNewGitHub APP2:12 PM3 new commits pushed to master bymihailmihaylovjiminnyeb6cfc4f - JY-20920: Fix participant matcherb5a8a4e0 - Merge branch 'master' into JY-20920-fix-participant-matcher231e9ad7 - Merge pull request #12091 fromjiminny/JY-20920-fix-participant-matcherjiminny/app| Added by GitHubMessage #releases+..•...
|
52843
|
NULL
|
NULL
|
NULL
|
|
52845
|
1855
|
7
|
2026-05-18T11:19:48.290583+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103188290_m2.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12092 on JY-20613-allow- Project: faVsco.js, menu
#12092 on JY-20613-allow-owner-role-on-team-setup, menu
Start Listening for PHP Debug Connections
UserInvitationDTOTest
Run 'UserInvitationDTOTest'
Debug 'UserInvitationDTOTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:...
|
[{"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":"#12092 on JY-20613-allow-owner-role-on-team-setup, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.12533244,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12092 exists for current branch JY-20613-allow-owner-role-on-team-setup","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.83610374,"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":"UserInvitationDTOTest","depth":6,"bounds":{"left":0.85139626,"top":0.019952115,"width":0.06416223,"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 'UserInvitationDTOTest'","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 'UserInvitationDTOTest'","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}]...
|
-8240056885406797445
|
-8708764798940902458
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
#12092 on JY-20613-allow- Project: faVsco.js, menu
#12092 on JY-20613-allow-owner-role-on-team-setup, menu
Start Listening for PHP Debug Connections
UserInvitationDTOTest
Run 'UserInvitationDTOTest'
Debug 'UserInvitationDTOTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
PhpStormViewINavigarecodeLaravelKeractorFV faVsco.js( #12092 on JY-20613-allow-owner-role-on-team-setupProiectphp api.php› D ConferenceHandlerMatcnActviycmmbata.ongv D [EMAIL]© ConferenceCallbackHandler.phpConferenceManager.phpDDIOC Event>D Exceptionm Job• ResolveiService>DVO© TwilioConstants.phpc)TwiioReoositorv.onoUoloaden7 UriGenerator23.D UtilityM UuidIM WaveformM WehhookeWorkflowD ConfigurationD ConsoleD Commands>@ ActivitiesD) Analytics)mCnlondarevaum> D Hubspot• IntegrationApp>D Traitsc) AddLavoutEntities.phpc) AutoloaDelavedcommand.phoc) BacktillOpportunityUserFromaccountC3ullhorncommandAostract.onoC) BullhornPinaCommand.ohvC) BullhornSearchCommand.onvC) BullhornSessionCommand.ohv@ CheckActivitvLoagableCommand.ohp© CleanDuplicateFieldDataCommand.ohC) [EMAIL]@ LoaActivitiesCommand.ohnC) ManadeSvncStrateavCommand.nhnC) [EMAIL]) Match@nnortunitvActivitiesCommandlC) MiarateProvider nhn.C) ProceccHuhsnot@biectsSvncRatchesC DurcoDolatod@nnortunitiacCommandlc DocotGovornorl imite nhnle) SondNotLoaged.phpSetupActivityTypeForFollowUp.phpWindow(c) Client.ongC) User.pnpUserinvitationDTOTest.php© ClientTest.php© EditTeamRequest.phpUserinvitationDT0.phpx#2V4 Anamespace Jiminny DTO Invitation:class UserInvitationDTOuse UserEmatl.public string Semail;public ?string $secondaryEmail;public ?int $groupld;public int SteamId;public bool ScrmRequiredpuouic array srolelaspuoLic bool sisuwner,public ?User $currentUser = null;* Qparam arrayfemail: string,secondaryEmail: string/null.groupld: 1nt null.teamid: 1ntstring.crmkequired: boolrolelds: int.user?: Usen* - Sattributesprivate function -_construct(array Sattributes)Sthiis-semar = mhstrtollowerSattrihutesi"emat."n.Sthis-ssecondarvEmail = Sthis->normalizeNullable/Sattnihutes/secondarvEmail11h*Sthis->arounld = Sattrihutesf"arountd']:Sthis->teamtd = Gint) Sattrihutes/iteamtd'l.$this->crmRequired = (bool) $attributes['crmReguired']:$this->roleIds = $attributes['roleIds'];Cthic-sichunon = Cattnihutocftichunont)*$this->currentUser = $attributes['user'] ?? null;public static function for0wner(CreateTeamRequest|EditTeamRequest Srequest, Team Steam): selfsuppont Dally • In 41m100% S2• Mon 18 May 14:19:47UserinvitationDTOTest v= custom.log= laravel.log4 SF jiminny@localhost]& console [STAGING]« HS_local [jiminny@localhost]Cascade# concole [ppon1tiò jiminny.users (PROD]# console [eu)© SoftPhoneManager.php x ©TextMessagingService.phgImplement Trial OwneFixing Redis Rate LimSalestorce Token Falli+O •tid jiminny.users (EU]fiii crm_configurations (EU]final readonly class SoftPhoneManager implements ConferenceManager45 Gt1oel• php -l /Users/lukas/jiminny/app/app/Services/Telephony/TextMessagingService.phpzsh:1. comnand not tound: ontpublic const int COMPLIANCE_PROMPT_TIMEOUT_SECONDS = 20;4 usagespublic const string COMPLIANCE_PROMPT_ACCEPT_DIGIT = '1';7/7 tasks donepublic functionconstruct(I've successfully implemented the fallback token logic for Twilio calls to match the existing dialer pattern. Here's what wasprivace rrovlderkegsscry scrurrovzderkegzscrynchanded.privace wedhook surlbeneracor.privace Accivicyservice sacclvicyserviceSummary of Changesprivate Loggerintertace Logger,private Iw1l1olllentbullder scw1l1ocllencbu1lder,1. SoftPhoneManager.php• Added import: CrmOwnerResolven•{...}• Outbound calls (create0utboundActivity method)• Replaced direct CRM service user settina with CrmlwnerResolvenpublic function create(VO\ConferenceManager\ActivitvCreate $data): Models Activitv{...}•If fallback fails, falls back to original behavior (team owner or user)• Added error loagina for fallback failuresbrivate function createlutboundActzvitv(V0 ConferenceManager SoftPhonelutboundcreate Soata): Models Activit• Inbound calls (createTnboundActivitv method)• Replaced direct CRM service user setting with CrmOwnerResolver•Maintains existing exception handling for CRM failuressthas->Lodder->debuaMETHon'data' => Sdata.]2. TextMessagingService.php• Added imbort: CrmownerResolverbuildActivity methodSnow = nowob•Replaced direct CRM service user setting with CrmOwnerResolverSuser = Sdata->aetUser@:•|f falllback fails and CRM is not required, talls back to team ownenSteam = Cucen->aetTeamo•• If CPM is reauired and fallback fails re-throws excentionSdevice = Cdata->aetheviceo•$phoneNumber = $data->getPhoneNumberO:$route = $data->getPhoneRouteO;• convertcustomerlocountrvcode method.•Replaced direct CRM service user setting with CrmOwnerResolver• |f rallback fails and CRM is not required, falls back to team ownenif (! $this-›activityService->teamCanDial($team, $phoneNumber)) {Sregion = getRegionByNumber(SphoneNumber, Suser-›getCountryCode()):.1€ CPM ic recuired and fallback fails, cantures excention and returns user's country codeHoW IL WOrKSthrow new LogicException(sprintf('Sorry, dialing %s is not available with your subscription.'The imolementation uses the existina CrmownerResolver class which:1. First tries the intearation admin's CRM connection.Please concac vour manader co enable acolcional descinacions."...values: Sregion ?? 'this number'2. If that fails with SocialAccountTokenInvalidException, searches for team members with active CRM connections3. Orders candidates by role (owner, admin, manager, other users)A Trioc esch candidate until findina one with a valid connection5. If all fail, throws the original exceptionThis ensures that when the Salesforce admin token has expired. Twilio calls will automaticallv use another active Salesforcesaccount = nuul:Reiect allAccent alliAsk anvthina (884-L)Setup services.f 3 editsAonant Cild do.dVOotaot Cile Aeoa+ 1 of 2 files →« Code SWF-1.6W Windsurf Toams75.5/8071 chars 200 line hreakc) UTF.8io 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
52846
|
1855
|
8
|
2026-05-18T11:19:52.071945+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103192071_m2.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
#12092 on JY-20613-allow- Project: faVsco.js, menu
#12092 on JY-20613-allow-owner-role-on-team-setup, menu
Start Listening for PHP Debug Connections
UserInvitationDTOTest
Run 'UserInvitationDTOTest'
Debug 'UserInvitationDTOTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Requests\Settings\Teams;
use Jiminny\Http\Requests\ValidatesBillingAddresses;
use Jiminny\Models\Feature\FeatureEnum;
use Illuminate\Foundation\Http\FormRequest;
use Jiminny\Rules\TransferUserAdminRule;
class EditTeamRequest extends FormRequest
{
use ValidatesBillingAddresses;
public function authorize(): bool
{
return true;
}
public function rules(): array
{
$existingFeatures = implode(',', FeatureEnum::names());
$rules = [
'name' => ['required', 'string', 'max:150'],
'owner_id' => ['required_without:owner_email', 'uuid:users', resolve(TransferUserAdminRule::class)],
'owner_email' => ['required_without:owner_id', 'email'],
'owner_role' => ['prohibited'],
'calendar' => ['required_without:owner_id', 'string', 'max:150'],
'crm' => ['required_without:owner_id', 'string', 'max:150'],
'features' => ['array'],
'features.*' => ['in:' . $existingFeatures],
'tier_id' => ['required', 'uuid:tiers'],
'partner_id' => ['sometimes', 'nullable', 'uuid:partners'],
];
$features = $this->input('features');
if (in_array(FeatureEnum::DIALER->name, $features)) {
// Add Billing address rules
$rules += $this->getBillingAddressRules();
}
return $rules;
}
public function getOwnerEmail(): string
{
return $this->input('owner_email');
}
}...
|
[{"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":"#12092 on JY-20613-allow-owner-role-on-team-setup, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.12533244,"height":0.025538707},"on_screen":true,"help_text":"Pull request #12092 exists for current branch JY-20613-allow-owner-role-on-team-setup","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.83610374,"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":"UserInvitationDTOTest","depth":6,"bounds":{"left":0.85139626,"top":0.019952115,"width":0.06416223,"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 'UserInvitationDTOTest'","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 'UserInvitationDTOTest'","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":"AXTextArea","text":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Requests\\Settings\\Teams;\n\nuse Jiminny\\Http\\Requests\\ValidatesBillingAddresses;\nuse Jiminny\\Models\\Feature\\FeatureEnum;\nuse Illuminate\\Foundation\\Http\\FormRequest;\nuse Jiminny\\Rules\\TransferUserAdminRule;\n\nclass EditTeamRequest extends FormRequest\n{\n use ValidatesBillingAddresses;\n\n public function authorize(): bool\n {\n return true;\n }\n\n public function rules(): array\n {\n $existingFeatures = implode(',', FeatureEnum::names());\n\n $rules = [\n 'name' => ['required', 'string', 'max:150'],\n 'owner_id' => ['required_without:owner_email', 'uuid:users', resolve(TransferUserAdminRule::class)],\n 'owner_email' => ['required_without:owner_id', 'email'],\n 'owner_role' => ['prohibited'],\n 'calendar' => ['required_without:owner_id', 'string', 'max:150'],\n 'crm' => ['required_without:owner_id', 'string', 'max:150'],\n 'features' => ['array'],\n 'features.*' => ['in:' . $existingFeatures],\n 'tier_id' => ['required', 'uuid:tiers'],\n 'partner_id' => ['sometimes', 'nullable', 'uuid:partners'],\n ];\n\n $features = $this->input('features');\n if (in_array(FeatureEnum::DIALER->name, $features)) {\n // Add Billing address rules\n $rules += $this->getBillingAddressRules();\n }\n\n return $rules;\n }\n\n public function getOwnerEmail(): string\n {\n return $this->input('owner_email');\n }\n}","depth":4,"bounds":{"left":0.15724733,"top":0.083798885,"width":0.31416222,"height":0.8954509},"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Http\\Requests\\Settings\\Teams;\n\nuse Jiminny\\Http\\Requests\\ValidatesBillingAddresses;\nuse Jiminny\\Models\\Feature\\FeatureEnum;\nuse Illuminate\\Foundation\\Http\\FormRequest;\nuse Jiminny\\Rules\\TransferUserAdminRule;\n\nclass EditTeamRequest extends FormRequest\n{\n use ValidatesBillingAddresses;\n\n public function authorize(): bool\n {\n return true;\n }\n\n public function rules(): array\n {\n $existingFeatures = implode(',', FeatureEnum::names());\n\n $rules = [\n 'name' => ['required', 'string', 'max:150'],\n 'owner_id' => ['required_without:owner_email', 'uuid:users', resolve(TransferUserAdminRule::class)],\n 'owner_email' => ['required_without:owner_id', 'email'],\n 'owner_role' => ['prohibited'],\n 'calendar' => ['required_without:owner_id', 'string', 'max:150'],\n 'crm' => ['required_without:owner_id', 'string', 'max:150'],\n 'features' => ['array'],\n 'features.*' => ['in:' . $existingFeatures],\n 'tier_id' => ['required', 'uuid:tiers'],\n 'partner_id' => ['sometimes', 'nullable', 'uuid:partners'],\n ];\n\n $features = $this->input('features');\n if (in_array(FeatureEnum::DIALER->name, $features)) {\n // Add Billing address rules\n $rules += $this->getBillingAddressRules();\n }\n\n return $rules;\n }\n\n public function getOwnerEmail(): string\n {\n return $this->input('owner_email');\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-4706759845557218493
|
6070377911790179264
|
click
|
accessibility
|
NULL
|
Project: faVsco.js, menu
#12092 on JY-20613-allow- Project: faVsco.js, menu
#12092 on JY-20613-allow-owner-role-on-team-setup, menu
Start Listening for PHP Debug Connections
UserInvitationDTOTest
Run 'UserInvitationDTOTest'
Debug 'UserInvitationDTOTest'
More Actions
JetBrains AI
Search Everywhere
IDE and Project Settings
Sync Changes
Hide This Notification
Code changed:
Hide
<?php
declare(strict_types=1);
namespace Jiminny\Http\Requests\Settings\Teams;
use Jiminny\Http\Requests\ValidatesBillingAddresses;
use Jiminny\Models\Feature\FeatureEnum;
use Illuminate\Foundation\Http\FormRequest;
use Jiminny\Rules\TransferUserAdminRule;
class EditTeamRequest extends FormRequest
{
use ValidatesBillingAddresses;
public function authorize(): bool
{
return true;
}
public function rules(): array
{
$existingFeatures = implode(',', FeatureEnum::names());
$rules = [
'name' => ['required', 'string', 'max:150'],
'owner_id' => ['required_without:owner_email', 'uuid:users', resolve(TransferUserAdminRule::class)],
'owner_email' => ['required_without:owner_id', 'email'],
'owner_role' => ['prohibited'],
'calendar' => ['required_without:owner_id', 'string', 'max:150'],
'crm' => ['required_without:owner_id', 'string', 'max:150'],
'features' => ['array'],
'features.*' => ['in:' . $existingFeatures],
'tier_id' => ['required', 'uuid:tiers'],
'partner_id' => ['sometimes', 'nullable', 'uuid:partners'],
];
$features = $this->input('features');
if (in_array(FeatureEnum::DIALER->name, $features)) {
// Add Billing address rules
$rules += $this->getBillingAddressRules();
}
return $rules;
}
public function getOwnerEmail(): string
{
return $this->input('owner_email');
}
}...
|
52845
|
NULL
|
NULL
|
NULL
|
|
52852
|
1855
|
12
|
2026-05-18T11:19:57.746745+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103197746_m2.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhostormVIewINavigarecodeLaravelFV faVsco.js( #120 PhostormVIewINavigarecodeLaravelFV faVsco.js( #12092 on master k vProledey› D ConferenceHandler© MatchActivityCrmData.phpv D [EMAIL]© ConferenceCallbackHandler.phpConferenceManager.phpDDIO>0 Event>D Exceptionm Job• ResolveiService>DVO© TwilioConstants.phpc)TwiioReoositorv.onoUoloaden7 UriGeneratorD UtilityM UuidN WaveformN WehhooksWorkflow> M ConfiaurationD Console• D Commands>@ Activities>@ Analytics)mCnlondarev0 erm> D Hubspot› IntegrationApp>D Traitsc) AddLavoutEntities.phpc) AutoloaDelavedcommand.phoc) BacktillOpportunityUserFromaccountC3ullhorncommandAostract.onoC) BullhornPinaCommand.ohvC) BullhornSearchCommand.onvC) BullhornSessionCommand.ohv@ CheckActivitvLoagableCommand.ohpC) CleanDuolicateFieldDataCommand.onC) [EMAIL]@ LoaActivitiesCommand.ohnC) ManadeSvncStrateavCommand.nhnlC) [EMAIL]) Match@nnortunitvActivitiesCommandlC) MiarateProvider nhn.C) ProceccHuhsnot@biectsSvncRatches(c DurcoDolatod@nnortunitiacCommandlc DocotGovornorl imite nhnl© SendNotLogged.phpSetupActivityTypeForFollowUp.php© Client.phpsiphpdeclarelscrict_cypes=l),namespace Jiminny Http Requests Settings Teamsuse...class EditreamRequest extends FormRequestuse Val1datesB1lungAddresses:puoLzo fonctzon authorsza0: 000return true:public function rules(): arraySeyistinaFpatunes = imnloded senarator "1, CeatuneFnum••namecon•$rules = ['name' => ['required', 'string', 'max:150']owner_10 =Lrecutrea_wichout.owner_emaltn'owner_email' => ['required_without:owner_id'.'email'],'calendar' => ['required without:owner_id' 'string'. 'max:150'].'uuid:users', resolve( name: TransferUserAdmir'crm' => ['required without:owner id'.'string', 'max:150']."teatures' = 'array')'teatures.*' =>"1n:'sexistinqreatures.h'tier 1d' => 'required', 'uuld:tlers''partner id' => ['sometimes', 'nullable', 'uuid:partners']Sfeatures = sthis->inout kev: 'features')if Gin arrav(FeatureEnum::DTALER->name. $features)) {Add Biluina address rulesSrules += $this->qetBilLingAddressRules@:neturn Srules:nublic function aetownerSmailo• strina...}suppont Dally • In 41m100% S2• Mon 18 May 14:19:57UserinvitationDTOTest vUserinvitationdTolest.onp= custom.log= laravel.log4 SF jiminny@localhost]& console [STAGING]« HS_local [jiminny@localhost]Cascade© ClientTest.php© EditTeamRequest.php XA console [PROD]tiò jiminny.users (PROD]# console [eu)© SoftPhoneManager.php x ©TextMessagingService.phgImplement Trial OwneFixing Redis Rate LimSalestorce Token Falli+O •V tiò jiminny.users (EU]fiii crm_configurations (EU]/minny/app/app/component/wllo/conterence/conferencemanager/sortrnonemanager.orgfinal readonly class SoftPhoneManager implements ConferenceManager• php -l /Users/lukas/jiminny/app/app/Services/Telephony/TextMessagingService.phpzsh:1. comnand not tound: ontpublic const int COMPLIANCE_PROMPT_TIMEOUT_SECONDS = 20;4 usagespublic const string COMPLIANCE_PROMPT_ACCEPT_DIGIT = '1';7/7 tasks donepublic functionconstruct(I've successfully implemented the fallback token logic for Twilio calls to match the existing dialer pattern. Here's what wasprivace rrovlderkegsscry scrurrovzderkegzscrynchanded.privace wedhook surlbeneracor.privace Accivicyservice sacclvicyserviceSummary of Changesprivate Loggerintertace Logger,private Iw1l1olllentbullder scw1l1ocllencbu1lder,1. SoftPhoneManager.php• Added import: CrmOwnerResolven) 4..• Outbound calls (create0utboundActivity method)• Replaced direct CRM service user settina with CrmlwnerResolven45 Gtpublic function create(VO\ConferenceManager\ActivitvCreate $data): Models\Activitv{...}•If fallback fails, falls back to original behavior (team owner or user)• Added error loagina for fallback failuresbrivate function createlutboundActzvitv(V0 ConferenceManager SoftPhonelutboundcreate Soata): Models Activit• Inbound calls (createTnboundActivitv method)• Replaced direct CRM service user setting with CrmOwnerResolver•Maintains existing exception handling for CRM failuressthas->Lodder->debuaMETHon'data' => Sdata.]2. TextMessagingService.php• Added imbort: CrmownerResolverbuildActivity methodSnow = nowob•Replaced direct CRM service user setting with CrmOwnerResolverSuser = Sdata->aetlserO:•|f falllback fails and CRM is not required, talls back to team ownenSteam = Cucen->aetTeamo•• If CPM is reauired and fallback fails re-throws excentionSdevice = Cdata->aetheviceo•$phoneNumber = $data->getPhoneNumberO:$route = $data->getPhoneRouteO:• convertcustomerlocountrvcode methods•Replaced direct CRM service user setting with CrmownerReso lver• |f rallback fails and CRM is not required, falls back to team ownenif (! $this-›activityService->teamCanDial($team, $phoneNumber)) <Sregion = getRegionByNumber(SphoneNumber, Suser-›getCountryCode()):.1€ CPM ic recuired and fallback fails, cantures excention and returns user's country codeHoW IL WOrKSthrow new LogicException(sprintf('Sorry, dialing %s is not available with your subscription.'The imolementation uses the existina CrmownerResolver class which:1. First tries the intearation admin's CRM connectionPlease concacc vour manager co enable acolcional descinacions."...values: Sregion ?? 'this number'2. If that fails with SocialAccountTokenInvalidException, searches for team members with active CRM connections3. Orders candidates by role (owner, admin, manager, other users)A Trioc esch candidate until findina one with a valid connection5. If all fail, throws the original exceptionSlead = nuluThis ensures that when the Salesforce admin token has expired. Twilio calls will automaticallv use another active Salesforcesaccount = nuul:Reiect allAccent alliAsk anvthing 884-D)Setup services.f 3 editsAccept File &~ X Reject File 4 & €+ 1 of 2 files →« Code SWF-1.6Synchronizing files.W Windsurf Teams75.5/8071 chars 200 line hreakc) UTF.8io 4 spaces...
|
NULL
|
-8138827911050112860
|
NULL
|
visual_change
|
ocr
|
NULL
|
PhostormVIewINavigarecodeLaravelFV faVsco.js( #120 PhostormVIewINavigarecodeLaravelFV faVsco.js( #12092 on master k vProledey› D ConferenceHandler© MatchActivityCrmData.phpv D [EMAIL]© ConferenceCallbackHandler.phpConferenceManager.phpDDIO>0 Event>D Exceptionm Job• ResolveiService>DVO© TwilioConstants.phpc)TwiioReoositorv.onoUoloaden7 UriGeneratorD UtilityM UuidN WaveformN WehhooksWorkflow> M ConfiaurationD Console• D Commands>@ Activities>@ Analytics)mCnlondarev0 erm> D Hubspot› IntegrationApp>D Traitsc) AddLavoutEntities.phpc) AutoloaDelavedcommand.phoc) BacktillOpportunityUserFromaccountC3ullhorncommandAostract.onoC) BullhornPinaCommand.ohvC) BullhornSearchCommand.onvC) BullhornSessionCommand.ohv@ CheckActivitvLoagableCommand.ohpC) CleanDuolicateFieldDataCommand.onC) [EMAIL]@ LoaActivitiesCommand.ohnC) ManadeSvncStrateavCommand.nhnlC) [EMAIL]) Match@nnortunitvActivitiesCommandlC) MiarateProvider nhn.C) ProceccHuhsnot@biectsSvncRatches(c DurcoDolatod@nnortunitiacCommandlc DocotGovornorl imite nhnl© SendNotLogged.phpSetupActivityTypeForFollowUp.php© Client.phpsiphpdeclarelscrict_cypes=l),namespace Jiminny Http Requests Settings Teamsuse...class EditreamRequest extends FormRequestuse Val1datesB1lungAddresses:puoLzo fonctzon authorsza0: 000return true:public function rules(): arraySeyistinaFpatunes = imnloded senarator "1, CeatuneFnum••namecon•$rules = ['name' => ['required', 'string', 'max:150']owner_10 =Lrecutrea_wichout.owner_emaltn'owner_email' => ['required_without:owner_id'.'email'],'calendar' => ['required without:owner_id' 'string'. 'max:150'].'uuid:users', resolve( name: TransferUserAdmir'crm' => ['required without:owner id'.'string', 'max:150']."teatures' = 'array')'teatures.*' =>"1n:'sexistinqreatures.h'tier 1d' => 'required', 'uuld:tlers''partner id' => ['sometimes', 'nullable', 'uuid:partners']Sfeatures = sthis->inout kev: 'features')if Gin arrav(FeatureEnum::DTALER->name. $features)) {Add Biluina address rulesSrules += $this->qetBilLingAddressRules@:neturn Srules:nublic function aetownerSmailo• strina...}suppont Dally • In 41m100% S2• Mon 18 May 14:19:57UserinvitationDTOTest vUserinvitationdTolest.onp= custom.log= laravel.log4 SF jiminny@localhost]& console [STAGING]« HS_local [jiminny@localhost]Cascade© ClientTest.php© EditTeamRequest.php XA console [PROD]tiò jiminny.users (PROD]# console [eu)© SoftPhoneManager.php x ©TextMessagingService.phgImplement Trial OwneFixing Redis Rate LimSalestorce Token Falli+O •V tiò jiminny.users (EU]fiii crm_configurations (EU]/minny/app/app/component/wllo/conterence/conferencemanager/sortrnonemanager.orgfinal readonly class SoftPhoneManager implements ConferenceManager• php -l /Users/lukas/jiminny/app/app/Services/Telephony/TextMessagingService.phpzsh:1. comnand not tound: ontpublic const int COMPLIANCE_PROMPT_TIMEOUT_SECONDS = 20;4 usagespublic const string COMPLIANCE_PROMPT_ACCEPT_DIGIT = '1';7/7 tasks donepublic functionconstruct(I've successfully implemented the fallback token logic for Twilio calls to match the existing dialer pattern. Here's what wasprivace rrovlderkegsscry scrurrovzderkegzscrynchanded.privace wedhook surlbeneracor.privace Accivicyservice sacclvicyserviceSummary of Changesprivate Loggerintertace Logger,private Iw1l1olllentbullder scw1l1ocllencbu1lder,1. SoftPhoneManager.php• Added import: CrmOwnerResolven) 4..• Outbound calls (create0utboundActivity method)• Replaced direct CRM service user settina with CrmlwnerResolven45 Gtpublic function create(VO\ConferenceManager\ActivitvCreate $data): Models\Activitv{...}•If fallback fails, falls back to original behavior (team owner or user)• Added error loagina for fallback failuresbrivate function createlutboundActzvitv(V0 ConferenceManager SoftPhonelutboundcreate Soata): Models Activit• Inbound calls (createTnboundActivitv method)• Replaced direct CRM service user setting with CrmOwnerResolver•Maintains existing exception handling for CRM failuressthas->Lodder->debuaMETHon'data' => Sdata.]2. TextMessagingService.php• Added imbort: CrmownerResolverbuildActivity methodSnow = nowob•Replaced direct CRM service user setting with CrmOwnerResolverSuser = Sdata->aetlserO:•|f falllback fails and CRM is not required, talls back to team ownenSteam = Cucen->aetTeamo•• If CPM is reauired and fallback fails re-throws excentionSdevice = Cdata->aetheviceo•$phoneNumber = $data->getPhoneNumberO:$route = $data->getPhoneRouteO:• convertcustomerlocountrvcode methods•Replaced direct CRM service user setting with CrmownerReso lver• |f rallback fails and CRM is not required, falls back to team ownenif (! $this-›activityService->teamCanDial($team, $phoneNumber)) <Sregion = getRegionByNumber(SphoneNumber, Suser-›getCountryCode()):.1€ CPM ic recuired and fallback fails, cantures excention and returns user's country codeHoW IL WOrKSthrow new LogicException(sprintf('Sorry, dialing %s is not available with your subscription.'The imolementation uses the existina CrmownerResolver class which:1. First tries the intearation admin's CRM connectionPlease concacc vour manager co enable acolcional descinacions."...values: Sregion ?? 'this number'2. If that fails with SocialAccountTokenInvalidException, searches for team members with active CRM connections3. Orders candidates by role (owner, admin, manager, other users)A Trioc esch candidate until findina one with a valid connection5. If all fail, throws the original exceptionSlead = nuluThis ensures that when the Salesforce admin token has expired. Twilio calls will automaticallv use another active Salesforcesaccount = nuul:Reiect allAccent alliAsk anvthing 884-D)Setup services.f 3 editsAccept File &~ X Reject File 4 & €+ 1 of 2 files →« Code SWF-1.6Synchronizing files.W Windsurf Teams75.5/8071 chars 200 line hreakc) UTF.8io 4 spaces...
|
52851
|
NULL
|
NULL
|
NULL
|
|
52862
|
1854
|
14
|
2026-05-18T11:20:17.311383+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103217311_m1.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DE SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DEV (docker)₴82asticsearch", "data"],"message" : "No livingconnections"}1 {"type" : "log","@timestamp": "2026-05-18T11:20:10Z","tags" : ["error","plug, "taskManager""taskManager"], "pid" :7, "message" : "Failed to pollfor work: Error: NoLiving connections"}1 {"type": "log""@timestamp": "2026-05-18T11:20:11Z""tags" : ["warning"elasticsearch", "data"], "pid" :7, "message": "Unable to revive connection: [URL_WITH_CREDENTIALS] : "2026-05-18T11:20:11Z", "tags" : ["warning" , "elasticsearch", "data"], "pid" :7, "message": "No livingconnections"}1 {"type": "log","@timestamp": "2026-05-18T11:20:11Z", "tags" : ["error""reporting""queue-worker""error"],"pid":7, "message":"mpau4y7h00070bdf8646mdeo - job querying failed: Error: No Living connections\nat sendReqWithConnection(/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:266:15)\n(/usr/share/kibana/node_modules/elasticsearch/src/lib/connection_pool.js:243:7)\nprocess._tickCallback (internal/process/next_tick.js:61:11)"}1 {"type" : "log""@timestamp" : "2026-05-18T11:20:11Z", "tags" : ["error", "elasticsearch",, "data"], "pid":7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}docker_lamp_1 |kibana{"type" : "log","@timestamp": "2026-05-18T11:20:13Z" , "tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "Unable to revive connection: [URL_WITH_CREDENTIALS] :"2026-05-18T11:20:13Z", "tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "No living connections"}kibanains"1 {"type": "log"!"@timestamp": "2026-05-18T11:20:13Z""tags" : ["error","plug, "taskManager","taskManager"], "pid" :7, "message": "Failed to poll for work: Error: NoLiving connections"}kibana1 {"type": "log".,"@timestamp" : "2026-05-18T11:20:14Z", "tags" : ["error", "elasticsearch",, "data"], "pid":7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch: 9200"}kibanaticsearch",I {"type" : "log", "@timestamp" : "2026-05-18T11:20: 16Z","tags" : ["error", "elas, "data"], "pid":7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}kibana1 {"type" : "log""@timestamp":"2026-05-18T11:20:16Z","tags" : ["warning""elasticsearch", "data"], "pid" :7,"message": "Unable to revive connection: [URL_WITH_CREDENTIALS] : "2026-05-18T11:20:16Z", "tags" : ["warning", "elasticsearch", "data"], "pid":7, "message": "No living connections"}kibana1 {"type" : "log".,"@timestamp" : "2026-05-18T11:20:16Z", "tags" : ["error", "plugins", "taskManager",, "taskManager"], "pid" :7, "message": "Failed to poll for work: Error: NoLiving connections"}View in Docker Desktop• View ConfigEnable WatchHomeо-DMsActivityFilesLaterMore-Jiminny ...Metrotrtencee# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of_jimi...0 Direct messages. Nikolay YankovR. Aneliya Angelovaão Stefka StoyanovaStoyan Tomov€. Vasil VasilevGalya DimitrovaLe Todor Stamatov "N. Mario GeorgievNikolay IvanovLo James Graham *. Stoyan Tanev&. Steliyan Georgiev&e Petko KashinskiLukas Kovalik y... OAppsJira CloudToastSupport Daily • in 40 m100% C8• Mon 18 May 14:20:17Describe what you are looking for# releases8 226 0MessagesC Files• Bookmarks+52848f50 - Sele-tinnlir* drop reference toToday ~TargetEntitie.:ES_CHUNK_SIZEf32fb682 - Update TargetEntitiesSelector touse ChunkSize instead of internal const.Update test8715e69d - Remove an unused import.36cе6е8c - Remove comments.Show morejiminny/app| Added by GitHubCircleCl APP12:33 PMDeployment Successful!Project: appWhen:05/18/202609:33:05Tag:View JobNewGitHub APP2:12 PM3 new commits pushed to master bymihailmihaylovjiminnyeb6cfc4f - JY-20920: Fix participant matcherb5a8a4e0 - Merge branch 'master' into JY-20920-fix-participant-matcher231e9ad7 - Merge pull request #12091 fromjiminny/JY-20920-fix-participant-matcherjiminny/app| Added by GitHubMessage #releases+..•...
|
NULL
|
3517762121424515894
|
NULL
|
click
|
ocr
|
NULL
|
SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DE SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DEV (docker)₴82asticsearch", "data"],"message" : "No livingconnections"}1 {"type" : "log","@timestamp": "2026-05-18T11:20:10Z","tags" : ["error","plug, "taskManager""taskManager"], "pid" :7, "message" : "Failed to pollfor work: Error: NoLiving connections"}1 {"type": "log""@timestamp": "2026-05-18T11:20:11Z""tags" : ["warning"elasticsearch", "data"], "pid" :7, "message": "Unable to revive connection: [URL_WITH_CREDENTIALS] : "2026-05-18T11:20:11Z", "tags" : ["warning" , "elasticsearch", "data"], "pid" :7, "message": "No livingconnections"}1 {"type": "log","@timestamp": "2026-05-18T11:20:11Z", "tags" : ["error""reporting""queue-worker""error"],"pid":7, "message":"mpau4y7h00070bdf8646mdeo - job querying failed: Error: No Living connections\nat sendReqWithConnection(/usr/share/kibana/node_modules/elasticsearch/src/lib/transport.js:266:15)\n(/usr/share/kibana/node_modules/elasticsearch/src/lib/connection_pool.js:243:7)\nprocess._tickCallback (internal/process/next_tick.js:61:11)"}1 {"type" : "log""@timestamp" : "2026-05-18T11:20:11Z", "tags" : ["error", "elasticsearch",, "data"], "pid":7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}docker_lamp_1 |kibana{"type" : "log","@timestamp": "2026-05-18T11:20:13Z" , "tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "Unable to revive connection: [URL_WITH_CREDENTIALS] :"2026-05-18T11:20:13Z", "tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "No living connections"}kibanains"1 {"type": "log"!"@timestamp": "2026-05-18T11:20:13Z""tags" : ["error","plug, "taskManager","taskManager"], "pid" :7, "message": "Failed to poll for work: Error: NoLiving connections"}kibana1 {"type": "log".,"@timestamp" : "2026-05-18T11:20:14Z", "tags" : ["error", "elasticsearch",, "data"], "pid":7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch: 9200"}kibanaticsearch",I {"type" : "log", "@timestamp" : "2026-05-18T11:20: 16Z","tags" : ["error", "elas, "data"], "pid":7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}kibana1 {"type" : "log""@timestamp":"2026-05-18T11:20:16Z","tags" : ["warning""elasticsearch", "data"], "pid" :7,"message": "Unable to revive connection: [URL_WITH_CREDENTIALS] : "2026-05-18T11:20:16Z", "tags" : ["warning", "elasticsearch", "data"], "pid":7, "message": "No living connections"}kibana1 {"type" : "log".,"@timestamp" : "2026-05-18T11:20:16Z", "tags" : ["error", "plugins", "taskManager",, "taskManager"], "pid" :7, "message": "Failed to poll for work: Error: NoLiving connections"}View in Docker Desktop• View ConfigEnable WatchHomeо-DMsActivityFilesLaterMore-Jiminny ...Metrotrtencee# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of_jimi...0 Direct messages. Nikolay YankovR. Aneliya Angelovaão Stefka StoyanovaStoyan Tomov€. Vasil VasilevGalya DimitrovaLe Todor Stamatov "N. Mario GeorgievNikolay IvanovLo James Graham *. Stoyan Tanev&. Steliyan Georgiev&e Petko KashinskiLukas Kovalik y... OAppsJira CloudToastSupport Daily • in 40 m100% C8• Mon 18 May 14:20:17Describe what you are looking for# releases8 226 0MessagesC Files• Bookmarks+52848f50 - Sele-tinnlir* drop reference toToday ~TargetEntitie.:ES_CHUNK_SIZEf32fb682 - Update TargetEntitiesSelector touse ChunkSize instead of internal const.Update test8715e69d - Remove an unused import.36cе6е8c - Remove comments.Show morejiminny/app| Added by GitHubCircleCl APP12:33 PMDeployment Successful!Project: appWhen:05/18/202609:33:05Tag:View JobNewGitHub APP2:12 PM3 new commits pushed to master bymihailmihaylovjiminnyeb6cfc4f - JY-20920: Fix participant matcherb5a8a4e0 - Merge branch 'master' into JY-20920-fix-participant-matcher231e9ad7 - Merge pull request #12091 fromjiminny/JY-20920-fix-participant-matcherjiminny/app| Added by GitHubMessage #releases+..•...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
52863
|
1855
|
18
|
2026-05-18T11:20:18.581005+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103218581_m2.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections...
|
[{"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":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>114 incoming commits<br/>","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.8081782,"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}]...
|
-7429716278976468786
|
-8636355650190325311
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
PhostormVIewINavigarecodeLaravelKeractorJOOISWindowFV faVsco.jsg9 master kProledey® ActivityController.php@.gitignoreE .php-cs-fixer.cachepnp.ono-cs-tixer.aist.onpuse Luminate vatabase zLoquent:useuLuminate support strpnp.onostorm.meta.pngE.phpunit.result.cache= .prettierignore=.winasunrulesphpide helper_models.phpuse Jiminny Comoonent Twilio Conference ConferenceManager:use Jiminny\Component\Twilio\Exception\Out0fBoundsException;|use Jiminny Comoonent Twilio Excention UnexpectedValueExcentioniuse Jiminny|Component\Twilio\Resolver;luse Jiminnv Comnonent Twilio. Vo.use Jiminny|Component\UrlGenerator\Webhook;M.CLAUDE.md( composer.jsoncomposer.lockuse Jiminny\Exceptions\LogicException;use Jiminny Models,devendencv-checker.sonuse JiminnyModeus rarcicipant connecczon.dev.isonE ids.txt=infection.ison.distuse Jiminhy services acuvicyservice.Juse Jiminny|Services\Activity\CrmOwnerResolver;use Jiminny services crm\cachedcrmservicevecoracoruse Jininny services urm rrovlderkecrscryM.INSTALL.mdM4INtErnAL WEBHOok S=TUP.mdluse Jiminny|Services\TeLephony\TwilioClientBuilder;Ejiminny_storageuse Psr Log LoggerInterfaceMLlicencas mdluse Iw1l10 Lxceptions Lontiqurat1onexceptlonM Makefileuse Iw1l10 cxceptions kestexception0 package-lock.jsonE phpstan.neon.distuse WIL1OWIMILAE phpstan-baseline.neonsphpunit.xmlfinal readonly class SoftPhoneManager implements ConferenceManagerTe raw_sqLquery.sqlM+ README.md{o sonar-project.propertiespublic const int COMPLIANCE PRONPT TMEOUT SECONDS = 20:Etest.pynubilic const strind NIMPLTANCE PRONPT ACCEPT DIGT E'14‹> Untitled Diaaram.xmlIs vetur.confia.jsM4 WEBHOOK_FILTERING_IMPLEMENTATION.md> (h External Librariesv E° Scratches and Consolesv _ Database consolesV AEU¿ console lEUlIA DEAL RISKS (EUIpublic function __construct(private ProviderRegistry ScrmProviderRegistry.private Webhook $urlGenerator,private ActivityService SactivityService,private LoggerInterface $logger,private TwilioClientBuilder StwilioClientBuilder,) f..345 @ >RejectADITEUTA EU (EUJv# liminnv@localhostA console [jiminny@localhost]# Di liiminnv@localhosti# HS_local (jiminny@localhost)A SE fiiminnv@localhostlA zoho_dev [jiminny@localhost]A pPOn4 console (PROD]#concole 1 ropon1A DI [PROD]public function create(VO\ConferenceManager\ActivityCreate $data): Models\Activityf..}private function createInboundActivity(VO\ConferenceManager\SoftPhoneInboundCreate $data): Models\A613407private function, getVoiceRecc "Accpt Fle s le (MRdedrATeam §tean, , 8FSihes SghoneNumber) : intt...*E custom.logA console [STAGING]• laravel.log4 SF [jiminny@localhost]A HS_Jocal [jiminny@localhost]A console [PROD] X# console [euy .589590593594-59559888183838888Tx: AutovfajiminnyCONCAT(u.id, CASE WHEN U.id = t.owner_id THEN' (owner)' ELSE' END) AS USer_141 BI B40 X.05 ^sa.*,t.owner_id FROM social_accounts saJoun usens u on u.ide sa.sociablle 1diJOIN teams t 1.n<->1: on t.id = u.team_idWHERE 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') = uid;select * from automated_report_results order by id desc;SELECT * FROMWHERE jd = 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] * from playbooks where team_id = 711; # event 226147SELECT * FROM playbook_categories WHERE playbook_id = 5515;SELECT * FROM crm_fields WHERE Crm_configuration_id = 692 and object_type = 'event';SELECT * FROM crm_fields WHERE1d = 2261471SELECT * FROM crm_field_values WHERE crm_field_id = 226147;SELECT * FROM crm_configurations WHERE id = 692;SELSCTCONCAT(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 saJOIN users u on u.id = sa.sociable_idJOIN teams t 1.n<-›1: on t.id = u.team_idWHERE U.team_id = 711 and sa.provider = 'salesforce";SELECT * FROM crm_profiles cp JOIN users u 1..n<->1: on U.id = cp.user_id WHERE v.team_id = 711;select * from leads:select * from calendars;SELECT• suppont Dally • In 40m100% S28• Mon 18 May 14:20:18U AskJiminnyReportActivityServiceTest~CascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token Falli+0 ..O php -1 /Users/lukas/jiminny/app/app/Services/Telephony/TextMessagingService.phpzsh:: comnand not tound: ongTnoughtsInoughttor is>I've successfully implemented the fallback token logic for Twilio calls to match the existing dialer pattern. Here's what wasSummary of Changes1. SoftPhoneManager.php• Added import: crmuwnerkesolvenOutbound calls (create0utboundActivity method):• Replaced direct CRM service user setting with CrmOwnerResolverl• If fallback fails, falls back to original behavior (team owner or user)• Added error logaina for fallback failures• Inbound calls (createInboundActivity method):• Replaced direct CRM service user setting with CrmOwnerResolver•Maintains existing exception handling for CRM failures• Added import: CrmOwnerResolven• buildActivity method:• Replaced direct CRM service user setting with CrmOwnerResolver•|f falllback fails and CRM is not required, falls back to team ownen• If CPM is reauired and fallback fails re-throws excention•Replaced direct CRM service user setting with CrmOwnerResolver• |f rallback fails and CRM is not required, falls back to team ownen• If CRM is required and fallback fails, captures exception and returns user's country codeHow It WorksThe imolementation uses the existing CrmOwnerResolver class which:1. First tries the intearation admin's CRM connection2.If that fails with SoctalAccountTokenTnvalidFycention sparches for team members with active CPM connections3. Orders candidates by role (owner, admin, manager, other users)4. Tries each candidate until finding one with a valid connection5. If all fail, throws the original exceptionThis ensures that when the Salesforce admin token has expired. Twilio calls will automaticallv use another active Salesforcetoken from the organization, preventing "Unknown customer" issuesAccent alliAsk anvthina (884-L)WN Windsurf Toams 11.61UTF.8f 4 spaces...
|
52861
|
NULL
|
NULL
|
NULL
|
|
52864
|
1854
|
15
|
2026-05-18T11:20:20.294748+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103220294_m1.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DE SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DEV (docker)₴82XI11DOCKER (docker-compose)kibana{"type""log""@timestamp": "2026-05-18T11:20:16Z""tags" : ["error""elasticsearch""data"],"pid" :7,message":"[ConnectionError]: getaddrinfo ENOTFOUND elasticsearchelasticsearch:9200"}{"type" : "log""@timestamp" : "2026-05-18T11:20:16Z", "tags" : ["warning".asticsearch", "data"],"pid" :7,'message": "Unable to reviveconnection: [URL_WITH_CREDENTIALS] "2026-05-18T11:20: 16Z", "tags" : ["warning""Noconnections"}, "elasticsearch", "data"],"message"kibana1 {"type" : "log"living"@timestamp""2026-05-18T11:20:16Z""tags" : ["error"ins", "taskManager","plugLivingconnections"3"taskManager"],"pid":7,"message": "Failed to poll for work: Error: Nokibana1 {"type" : "log""@timestamp" : "2026-05-18T11:20: 19Z" , "tags" : ["error", "elasticsearch", "data"],"pid":7, "message"[ConnectionError]: getaddrinfo ENOTFOUND elasticsearchelasticsearch:9200"}kibana{"type" : "log""@timestamp": "2026-05-18T11:20:19Z", "tags" : ["warning", "elasticsearch", "data"], "pid":7, "message": "Unable toreviveconnection: [URL_WITH_CREDENTIALS] : "2026-05-18T11:20: 19Z" , "tags" : ["warning" , "elasticsearch", "data"], "pid" :7, "message": "No living connections"}kibana{"type" : "log", "@timestamp" : "2026-05-18T11:20:19Z", "tags" : ["warning"ugins""licensing"],"pid":7,"message":"License information could not be obtained from Elasticsearch due to Error: No Living connections error"}kibanaI {"type" : "log", "@timestamp" : "2026-05-18T11:20: 19Z", "tags" : ["error"ticsearch", "data"], "pid":7, "message" :"[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}kibanaI {"type" : "log", "@timestamp" : "2026-05-18T11:20:19Z" , "tags" : ["warning","elasticsearch", "monitoring"],"pid":7, "message": "Unable to revive connection: [URL_WITH_CREDENTIALS] "2026-05-18T11:20: 19Z", "tags" : ["warning", "elasticsearch", "monitoring"],"pid" :7, "message" : "No living connections"}I {"type" : "log", "@timestamp" : "2026-05-18T11:20: 19Z""tags" : ["warning","licensing"],"pid":7, "message": "License information could not be obtained from Elasticsearch due to Error: No Living connections error"}1 {"type" : "log","@timestamp" : "2026-05-18T11:20: 19Z""tags": ["warning"asticsearch", "data"], "pid" :7,"message": "Unable to revive connection: [URL_WITH_CREDENTIALS] : "2026-05-18T11:20:19Z", "tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "No living connections"}1 {"type": "log", "@timestamp": "2026-05-18T11:20: 19Z","tags" : ["error", "plug, "taskManager",, "taskManager"], "pid" :7, "message": "Failed to poll for work: Error: NoLiving connections"}View in Docker Desktop• View ConfigEnable WatchHomeо-DMsActivityFilesLaterMore-Jiminny ...MetromrenCE# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of_jimi...• Direct messages. Nikolay YankovR. Aneliya Angelovaão Stefka StoyanovaStoyan Tomov€. Vasil VasilevGalya DimitrovaLe Todor Stamatov "N. Mario Georgiev. Nikolay IvanovLo James Graham *2 Stoyan Tanev&. Steliyan Georgiev&e Petko KashinskiLukas Kovalik y... OAppsJira CloudToastSupport Daily • in 40 m100% C8• Mon 18 May 14:20:19Describe what you are looking for# releases8 226 0MessagesC Files• Bookmarks+52848f50 - Sele-tinnlir* drop reference toToday ~TargetEntitie.:ES_CHUNK_SIZEf32fb682 - Update TargetEntitiesSelector touse ChunkSize instead of internal const.Update test8715e69d - Remove an unused import.36cе6е8c - Remove comments.Show morejiminny/app| Added by GitHubCircleCl APP12:33 PMDeployment Successful!Project: appWhen:05/18/202609:33:05Tag:View JobNewGitHub APP2:12 PM3 new commits pushed to master bymihailmihaylovjiminnyeb6cfc4f - JY-20920: Fix participant matcherb5a8a4e0 - Merge branch 'master' into JY-20920-fix-participant-matcher231e9ad7 - Merge pull request #12091 fromjiminny/JY-20920-fix-participant-matcherjiminny/app| Added by GitHubMessage #releases+Аа..•...
|
NULL
|
9218707360870628532
|
NULL
|
click
|
ocr
|
NULL
|
SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DE SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81DEV (docker)₴82XI11DOCKER (docker-compose)kibana{"type""log""@timestamp": "2026-05-18T11:20:16Z""tags" : ["error""elasticsearch""data"],"pid" :7,message":"[ConnectionError]: getaddrinfo ENOTFOUND elasticsearchelasticsearch:9200"}{"type" : "log""@timestamp" : "2026-05-18T11:20:16Z", "tags" : ["warning".asticsearch", "data"],"pid" :7,'message": "Unable to reviveconnection: [URL_WITH_CREDENTIALS] "2026-05-18T11:20: 16Z", "tags" : ["warning""Noconnections"}, "elasticsearch", "data"],"message"kibana1 {"type" : "log"living"@timestamp""2026-05-18T11:20:16Z""tags" : ["error"ins", "taskManager","plugLivingconnections"3"taskManager"],"pid":7,"message": "Failed to poll for work: Error: Nokibana1 {"type" : "log""@timestamp" : "2026-05-18T11:20: 19Z" , "tags" : ["error", "elasticsearch", "data"],"pid":7, "message"[ConnectionError]: getaddrinfo ENOTFOUND elasticsearchelasticsearch:9200"}kibana{"type" : "log""@timestamp": "2026-05-18T11:20:19Z", "tags" : ["warning", "elasticsearch", "data"], "pid":7, "message": "Unable toreviveconnection: [URL_WITH_CREDENTIALS] : "2026-05-18T11:20: 19Z" , "tags" : ["warning" , "elasticsearch", "data"], "pid" :7, "message": "No living connections"}kibana{"type" : "log", "@timestamp" : "2026-05-18T11:20:19Z", "tags" : ["warning"ugins""licensing"],"pid":7,"message":"License information could not be obtained from Elasticsearch due to Error: No Living connections error"}kibanaI {"type" : "log", "@timestamp" : "2026-05-18T11:20: 19Z", "tags" : ["error"ticsearch", "data"], "pid":7, "message" :"[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}kibanaI {"type" : "log", "@timestamp" : "2026-05-18T11:20:19Z" , "tags" : ["warning","elasticsearch", "monitoring"],"pid":7, "message": "Unable to revive connection: [URL_WITH_CREDENTIALS] "2026-05-18T11:20: 19Z", "tags" : ["warning", "elasticsearch", "monitoring"],"pid" :7, "message" : "No living connections"}I {"type" : "log", "@timestamp" : "2026-05-18T11:20: 19Z""tags" : ["warning","licensing"],"pid":7, "message": "License information could not be obtained from Elasticsearch due to Error: No Living connections error"}1 {"type" : "log","@timestamp" : "2026-05-18T11:20: 19Z""tags": ["warning"asticsearch", "data"], "pid" :7,"message": "Unable to revive connection: [URL_WITH_CREDENTIALS] : "2026-05-18T11:20:19Z", "tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "No living connections"}1 {"type": "log", "@timestamp": "2026-05-18T11:20: 19Z","tags" : ["error", "plug, "taskManager",, "taskManager"], "pid" :7, "message": "Failed to poll for work: Error: NoLiving connections"}View in Docker Desktop• View ConfigEnable WatchHomeо-DMsActivityFilesLaterMore-Jiminny ...MetromrenCE# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of_jimi...• Direct messages. Nikolay YankovR. Aneliya Angelovaão Stefka StoyanovaStoyan Tomov€. Vasil VasilevGalya DimitrovaLe Todor Stamatov "N. Mario Georgiev. Nikolay IvanovLo James Graham *2 Stoyan Tanev&. Steliyan Georgiev&e Petko KashinskiLukas Kovalik y... OAppsJira CloudToastSupport Daily • in 40 m100% C8• Mon 18 May 14:20:19Describe what you are looking for# releases8 226 0MessagesC Files• Bookmarks+52848f50 - Sele-tinnlir* drop reference toToday ~TargetEntitie.:ES_CHUNK_SIZEf32fb682 - Update TargetEntitiesSelector touse ChunkSize instead of internal const.Update test8715e69d - Remove an unused import.36cе6е8c - Remove comments.Show morejiminny/app| Added by GitHubCircleCl APP12:33 PMDeployment Successful!Project: appWhen:05/18/202609:33:05Tag:View JobNewGitHub APP2:12 PM3 new commits pushed to master bymihailmihaylovjiminnyeb6cfc4f - JY-20920: Fix participant matcherb5a8a4e0 - Merge branch 'master' into JY-20920-fix-participant-matcher231e9ad7 - Merge pull request #12091 fromjiminny/JY-20920-fix-participant-matcherjiminny/app| Added by GitHubMessage #releases+Аа..•...
|
52862
|
NULL
|
NULL
|
NULL
|
|
52865
|
1855
|
19
|
2026-05-18T11:20:21.803864+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103221803_m2.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions...
|
[{"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":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>114 incoming commits<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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 'AskJiminnyReportActivityServiceTest'","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}]...
|
-943456739835505562
|
-8636494053633454656
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
PhostormFV faVsco.jsProiect v.gitignoreE.php-cs-fixer.cachepnp.onp-cs-rixer.aist.onppnp.onostorm.meta.pngE.phpunit.result.cacheE.prettierignoreE.windsurfrulesVIewINavigareCodeLaravelKeractorJOOISWindowmelp°9 master kC) ActivitvController.pnp© SoftPhoneManager.php Xfinal readonly class SoftPhoneManager implements ConferenceManager=custom.log• laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console (PROD] X# console [euyA console [STAGING]phpide helper_models.phpM?CLAUDE.mdcomposer.isoncomposer.lockdevendencv-checker.sondev.isonEids.txt=infection.ison.distM.INSTALL.mdMIINTERNAL WEBHOOK SETUP.mdliminny storaddMLlicenços mdliM MakofileJ package-lock.json288289298292E phpstan.neon.distE phpstan-baseline.neor< phpunit.xmlTeraw_sqL_query.sqMI DEAOMS md{o sonar-project.propertiesEtest.py‹> Untitled Diaaram.xml299300Js vetur.confia.jsML WERHOOK SIL TERING IMPLEMENTATION.md301302> (h External Librariesv E° Scratches and Consolesv M Database ConsolesV AEU¿ console lEUlIA DEAL RISKS (EUIADITEUTAEU TEUv# liminnv@localhostA console [jiminny@localhost]# Di liiminnv@localhostiA HS local fiiminnv@localhostllA SE fiiminnv@localhostlAzoho dev fiiminnv@localhostlIpRon#Iconcole [opon1315#concole 1 ropon1A DI [PROD450public const string COMPLIANCE_PROMPT_ACCEPT_DIGIT = '1';pubLIc tuncclonprivace rrovderkegiscry scrurroviderkegiscry.private Webhook $urlGenerator,privace Accivicyservice saculvicyservice.privare Loggerincertace slogger,privace w1l1ouulencbullder scwil1oculencbullder.•{...}570572574575576577public function create(VO\ConferenceManager\ActivityCreate Sdata): Models Activitv{...}578580orivate function createlutooundActivitvVo conferencelanager SoftPhonedutboundcreate scata): Modelbrivate function createInboundActivitv(V0\ConferenceManager|SoftPhoneInboundCreate Sdata): Models\A584585$this->logger->debug(__METHOD__, ['calSid' => Sdata->aetcal S1d0.i586— 587588589$roomOwner = $data->getUserOSteam = Snoomlwnen->netTeamO$phoneNumber = $room0wner->getSoftPhoneInboundDestinationNumberO:$callerId = $data->getCallerIdO:$callerCallSid = $data->getCallSidO:592593594$now = now);if (! Sthis-›activityService->teamCanDial(Sroom0wner->qetTeam•. Sroom0wner->softphoneinboundSregion = getRegionByNumber (Sroom0wner-›softphone_inbound_destination, SroomOwner->getCount•throw new LogicException(sprinttoformat: "Sorry. dialing %s is not available with your subscription.601602603Please contact your manager to enable additional destinations.',: Sregion 22 • this number'.Stlead = Saccount = Sonnontunitv = Scontact = Sstade = nun.- 60%610+ny d[611ScrmService = Sthis->crmProviderReqistry->qet(Sroom0wner->getTeamO->crm->provider):612613$crmResolver = app( al:Crm0wnerResolver::class,teatiot 3edusodnu v Accept File & X Reiect File +%@+ 1 of 2 files →cter' hac heon rectored Il Pollback II Confiaure (maments aao)lTx: AutovSo jiminny vCONCAT(u.id, CASE WHEN U.id = t.owner_id THEN' (owner)' ELSE' END) AS USer_141BIB40 X05 Asa.*t.owner_id FROM social_accounts saJOIN users u on v.id = sa.sociable_idJOIN teams t l..n<->l: on t.id = u.team_idWHERE 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 * trom 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 ia desc;SELECT * FROMWHEkE 10 = 17191select * fromautomated report results WHERE report id = 54:select * from opportunities where 1d = 75943491SELE * FROM teams WHERE name LIKE "%lesx': # 711, 692. 16067 -Timinnvintearationdlesmills.comselect * from playbooks where team_id = 711; # event 226147SELEd * FROM Dlavbook catedonies WHERE Dlavbook 1d = 55151SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event':SELECT * SROM eom fields WHERE1d = 2261471SELECT * FROM com field values WHERE com field id = 226147:SELECT * FROM crm_configurations WHERE id = 692;SELSCTuemai]CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '• END) AS user_id,t.owner id FROM social accounts saJOIN users u on v.id = sa.sociable idJOIN teams t 1..n<->1: on t.id = u.team idWHERE u.team id = 711 and sa.provider = 'salesforce':SELECT * FROM crm profiles cp JOIN users u 1..n<->1: on u.id = co.user id WHERE u.team_id = 711:select * from leads,select * from calendarsSELENT• suppont Dally • In 40m100% L2• Mon 18 May 14:20:21U AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token Falli+0 ..• php -l /Users/lukas/jiminny/app/app/Services/Telephony/TextMessagingService.phpzsh:: comnand not tound: ongTnoughtsInoughttor is>I've successfully implemented the fallback token logic for Twilio calls to match the existing dialer pattern. Here's what wasSummary of Changes1. SoftPhoneManager.php• Added import: crmuwnerkesolvenOutbound calls ([EMAIL] method)• Replaced direct CRM service user setting with CrmOwnerResolverl•If fallback fails, falls back to original behavior (team owner or user)• Added error logaina for fallback failures• Inbound calls (createInboundActivity method)• Renlaced direct CRM service user setting with CrmlwnerRecolverl•Maintains existing exception handling for CRM failures• Added import: CrmOwnerResolven• buildActivity method•Replaced direct CRM service user setting with CrmOwnerResolver•|f falllback fails and CRM is not required, falls back to team ownen• If CPM is reauired and fallback fails re-throws excention•Replaced direct CRM service user setting with CrmOwnerResolver• |f rallback fails and CRM is not required, falls back to team ownen•If CRM is required and fallback fails, captures exception and returns user's country codeHow It WorksThe imolementation uses the existing CrmOwnerResolver class which:1. First tries the intearation admin's CRM connection2.If that fails with SoctalAccountTokenTnvalidFycention sparches for team members with active CPM connections3. Orders candidates by role (owner, admin, manager, other users)4. Tries each candidate until findina one with a valid connection5. If all fail, throws the original exceptionThis ensures that when the Salesforce admin token has expired. Twilio calls will automaticallv use another active Salesforcetoken from the organization, preventing "Unknown customer" issuesAccent alliAsk anvthina (884-L)« Code SWF-1.6WY Windsurf Toamc286-5 (1958 charc 120 line hreakc)UTE.Rio 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
52866
|
1855
|
20
|
2026-05-18T11:20:25.666413+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103225666_m2.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest...
|
[{"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":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>114 incoming commits<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"height":0.025538707},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
5222591262487654398
|
-8636637129462003327
|
visual_change
|
hybrid
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
PhpStormFV faVsco.jsProiect v=.gitatnibutes.gitignoreE.php-cs-fixer.cachepnp.onp-cs-rixer.aist.onpphp.phpstorm.meta.phpE.phpunit.result.cacheE .prettierignoreE.windsurfrulesINavicarecodeLaravelKeractorTOOISWindowC ActivityController.ongfinal readonly class SoftPhoneManager implements ConferenceManager286private function createInboundActivity(VO\ConferenceManager\SoftPhoneInboundCreate $data): Models\A$roomOwner = $data->getUserO$team = $roomOwner->getTeam$phoneNumber = $room0wner->getSoftPhoneInboundDestinationNumberOscallerla = soaca-›oeclaclertoon$callerCallSid = $data->getCallSid();=custom.log• laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]« console [PROD] X# console [euyA console [STAGING]phpide helper_models.ohpM? CLAUDE.mducomposer.jsoncomposer.lock( dependency-checker.jsondev.isonE ids.txt=infection.ison.distMJ INSTALL.mdM+ INTERNAL_WEBHOOK_SETUP.mdEjiminny_storageMLlicenços mdliM MakefileJ package-lock.json= phpstan.neon.distE phpstan-baseline.neon< phpunit.xmlTeraw_sqL_query.sqM+ README.md{o sonar-project.propertiesEtest.py<)> Untitled Diagram.xmlJs vetur.confia.jsM+WEBHOOK FILTERING_IMPLEMENTATION.md> (h External Librariesv E° Scratches and Consolesv M Database ConsolesV AEUA console (EU]A DEAL RISKS (EU1ADITEUIA EU [EU]v# liminnv@localhostconsole fjiminny@localhost]# Di liiminnv@localhosti# HS_local (jiminny@localhost)# SE fliminnvOlocalhostlA zoho_dev (jiminny@localhost]• A pron#concole [oDon1#concole 1 ropon1A DI [PRODBRRERBERBRBRRBBRRRBBE337572if (! $this->activityService->teamCanDial($roomOwner->getTeam(), Sroombwner->softphone_anbouna.sregion = getregionByNumber(sroom0wner->softphone_inbound_destination, sroomowner->getcountthrow new LogicException(sprintfCformat: 'Sorry, dialing %s is not available with your subscription.'Please contact your manager to enable additional destinations.'.1 sprintf(string $format,mixed ...$values): string$lead = $account =Return a formatted stringtryfSermservice ='providerstParameters: string $format - The format string is composed of zeroor more directives: ordinary characters (excluding %) thatare copied directly to the result, and conversionspecifications, each of which results in fetching its ownparameter. This applies to both sprintf and printf.Each conversion specification consists of a percent sign (%)followed by one or more of these elements, in order: Anobtional sion soecitier that forces a sion (- or +) to be usediider):ameo.D):SermServicezsmius necauive. Inis soecmier torces postuve numbers lohave the + sign attached as well, and was added in PHPcảc ( ronabre strontio oisactivity = sroomuwner-›activ1tleso->createl=> Models Activitv::TYPE SOFTPHONE INBOUND'provider!eoAonant Cild de.CTKejEdE File A IDER AW46t6 files →ter' hac heon rectored Il Pollback II Confiaure (moments aao)l580582583584585586. Tx: AutovSo jiminny vCONCAT(u.id, CASE WHEN U.id = t.owner_id THEN' (owner)' ELSE' END) AS USer_1041 A1 A40 V65 ^u.emarsa.*t.owner_id FROM social_accounts saJOIN users u on U.id = sa.sociable_idJOIN teams t l..n<->l: on t.id = u.team_idWHERE 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 * trom 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 ia desc;SELECT * FROMWHERE id = 1919:select * fromautomated report results WHERE report id = 54:select * from opportunities where 1d = 7594549:SELEC * FROM teams WHERE name LIKE "%lesx': # 711, 692. 16067 -Timinnvintearationdlesmills.comselect * from playbooks where team_id = 711; # event 226147SELEd * FROM DLavbook catedonies WHERE Dlavbook 10 = 55151SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event':SELECT * SROM eom fields WHEREI1d = 2261471SELECT * FROM crm_field_values WHERE crm_field_id = 226147;SELECT * FROM crm_configurations WHERE id = 692SELECTCONCAT(u.id, CASE WHEN u.id = t.owner_id THENI (ownen)I FISE II EMO) AS ucen iduemai]Sa.xt.owner id FROM social accounts saJOIN users u on v.id = sa.sociable idJOIN teams t 1..n<->1: on t.id = u.teamidWHERE u.team id = 711 and sa.provider = 'salesforce':SELECT * FROM crm profiles co JOIN users u 1..n<->1: on u.id = co.user id WHERE u.team_id = 711:select * from leads,select * from calendarsSELECT: Support Daily - in 40 m100% 2• Mon 18 May 14:20:25AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token Falli+0 ..• php -l /Users/lukas/jiminny/app/app/Services/Telephony/TextMessagingService.phpzsh:: comnand not tound: ongTnoughtsInoughttor is>I've successfully implemented the fallback token logic for Twilio calls to match the existing dialer pattern. Here's what wasSummary of Changes1. SoftPhoneManager.pnp• Added import: crmuwnerkesolven• Outbound callis (createdutboundAct ivity method)• Replaced direct CRM service user setting with CrmOwnerResolverl•If fallback fails, falls back to original behavior (team owner or user)• Added error logaina for fallback failures• Inbound calls (createInboundActivity method)• Renlaced direct CRM service user setting with CrmlwnerRecolver.•Maintains existing exception handling for CRM failures• Added import: CrmOwnerResolven• buildActivity method•Replaced direct CRM service user setting with CrmOwnerResolver•|f falllback fails and CRM is not required, falls back to team ownen• If CPM is reauired and fallback fails re-throws excention•Replaced direct CRM service user setting with CrmOwnerResolver• |f rallback fails and CRM is not required, falls back to team ownen•If CRM is required and fallback fails, captures exception and returns user's country codeHow It WorksThe imolementation uses the existing CrmOwnerResolver class which:1. First tries the intearation admin's CRM connection2.If that fails with SoctalAccountTokenTnvalidFycention sparches for team members with active CPM connections3. Orders candidates by role (owner, admin, manager, other users)4. Tries each candidate until findina one with a valid connection5. If all fail, throws the original exceptionThis ensures that when the Salesforce admin token has expired. Twilio calls will automaticallv use another active Salesforcetoken from the organization, preventing "Unknown customer" issuesAccent alliAsk anvthina (884-L)WN Windsurf Toams 12•6 UTF.8io 4 spaces...
|
52865
|
NULL
|
NULL
|
NULL
|
|
52867
|
1854
|
16
|
2026-05-18T11:20:26.192541+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103226192_m1.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections...
|
[{"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":"master, menu","depth":5,"on_screen":true,"help_text":"Git Branch: master<br/>114 incoming commits<br/>","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}]...
|
-7429716278976468786
|
-8636355650190325311
|
click
|
hybrid
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
SlackFileEditViewGoHistoryWindowHelpEU (DOCKER81X t1DOCKER (docker-compose)elasticsearch: 9200"}{"type" : "log""@timestamp"asticsearch", "monitoring"], "pid" :7, "message"csearch: 9200/"}DEV (docker)₴82"2026-05-18T11:20:19Z","tags" : ["warning"to revive connection: [URL_WITH_CREDENTIALS] ["warning'asticsearch", "monitoring"], "pid" :7,: "No living connections"}{"type" : "log""@timestamp": "2026-05-18T11:20: 19Z""tags": ["warning""licensing"],"message" : "Licenseinformationcould not be obtained from Elasticsearchto Error:connections{"type" : "log""@timestamp":"2026-05-18T11:20:19Z", "tags" : ["warning""message": "Unable to reviveconnection: [URL_WITH_CREDENTIALS] : "2026-05-18T11:20:19Z", "tags" : ["warning", "elasticsearch", "data"],"message" : "No livingconnections"}{"type" : "log""@timestamp": "2026-05-18T11:20:19Z", "tags": ["error", "taskManager"""taskManager"], "pid":7, "message": "Failed to pollfor work: Error: NoLiving connections"}1 {"type" : "log", "@timestamp": "2026-05-18T11:20:21Z","tags" : ["error", "elasticsearch", "data"], "pid" :7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticseelasticsearch: 9200"}1 {"type" : "log""@timestamp":"2026-05-18T11:20:22Z","tags" : ["warning", "elasticsearch", "data"], "pid":7, "message": "Unable to revive connection: [URL_WITH_CREDENTIALS] "2026-05-18T11:20:22Z", "tags" : ["warning", "elasticsearch", "data"], "pid" :7, "message": "No living connections"}kibana1 {"type" : "log"!ins","@timestamp" : "2026-05-18T11:20:22Z","tags" : ["error", "plug,"taskManager", "taskManager"], "pid":7, "message": "Failed to poll for work: Error: NoLiving connections"}kibana1 {"type": "log", "@timestamp" : "2026-05-18T11:20:24Z","tags" : ["error","elasticsearch", "data"],"pid" :7, "message" : "[ConnectionError]: getaddrinfo ENOTFOUND elasticsearch elasticsearch:9200"}docker_lamp_1 |2026-05-18 11:20:13 Running ['artisan' meeting-bot:schedule-bot] .. 12s DONE1 {"type" : "log","@timestamp": "2026-05-18T11:20:25Z""tags": ["warning"asticsearch", "data"], "pid" :7,"message": "Unable to revive connection: [URL_WITH_CREDENTIALS] "2026-05-18T11:20:25Z", "tags" : ["error", "plugins",, "taskManager",, "taskManager"], "pid" :7, "message" : "Failed to poll for work: Error: NoLiving connections"}View in Docker Desktop• View ConfigEnable WatchHomeDMsActivityFilesLaterMore-Jiminny ...MetromrenCE# product_launches# random# releases# sofia-office# support# thank-yous# the_people_of_jimi...• Direct messages. Nikolay YankovR. Aneliya Angelovaão Stefka StoyanovaStoyan Tomov€. Vasil VasilevGalya DimitrovaLe Todor Stamatov "N. Mario GeorgievNikolay IvanovLo James Graham *2 Stoyan Tanev&. Steliyan Georgiev&e Petko KashinskiLukas Kovalik y... OAppsJira CloudToastSupport Daily • in 40 m100% C8• Mon 18 May 14:20:25Describe what you are looking for# releases8 226 0MessagesC Files• Bookmarks+52848f50 - Sele-tinnlir* drop reference toToday ~TargetEntitie.:ES_CHUNK_SIZEf32fb682 - Update TargetEntitiesSelector touse ChunkSize instead of internal const.Update test8715e69d - Remove an unused import.36cе6е8c - Remove comments.Show morejiminny/app| Added by GitHubCircleCl APP12:33 PMDeployment Successful!Project: appWhen:05/18/202609:33:05Tag:View JobNewGitHub APP2:12 PM3 new commits pushed to master bymihailmihaylovjiminnyeb6cfc4f - JY-20920: Fix participant matcherb5a8a4e0 - Merge branch 'master' into JY-20920-fix-participant-matcher231e9ad7 - Merge pull request #12091 fromjiminny/JY-20920-fix-participant-matcherjiminny/app| Added by GitHubMessage #releases+..•...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
52868
|
1855
|
21
|
2026-05-18T11:20:28.865439+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779103228865_m2.jpg...
|
PhpStorm
|
faVsco.js – SoftPhoneManager.php
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions...
|
[{"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":"master, menu","depth":5,"bounds":{"left":0.064494684,"top":0.019952115,"width":0.040226065,"height":0.025538707},"on_screen":true,"help_text":"Git Branch: master<br/>114 incoming commits<br/>","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.8081782,"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":"AskJiminnyReportActivityServiceTest","depth":6,"bounds":{"left":0.8234708,"top":0.019952115,"width":0.09208777,"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 'AskJiminnyReportActivityServiceTest'","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 'AskJiminnyReportActivityServiceTest'","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}]...
|
-943456739835505562
|
-8636494053633454656
|
visual_change
|
hybrid
|
NULL
|
Project: faVsco.js, menu
master, menu
Start Listen Project: faVsco.js, menu
master, menu
Start Listening for PHP Debug Connections
AskJiminnyReportActivityServiceTest
Run 'AskJiminnyReportActivityServiceTest'
Debug 'AskJiminnyReportActivityServiceTest'
More Actions
PhostormProiectFV faVsco.jsVIewINavicarecodeLaravelKeractor°9 master kDAvayom BaseServicem BloobirdsIm CloceM CloudCalllCloudTalkM ConnectAndSell) M DemoDeck_ Dialpac• C EightByEighturiveNine•J Gmaiu GonaGooclemeerD GoToMeetingGrooveD HubSpotImportJiminnyawlustcalllM MiaratorM NatterboxOficeOrumOutreachlM PinaCentrallM PinaCentralViden1 SalecforceM7 SalecioftCActivityController.ong• laravel.log« SF jiminny@localhost]4 HS_local [jiminny@localhost]& console (PROD] X# console [euyfinal readonly class SoftPhoneManager implements ConferenceManagerprivate function createInboundActivity(VO\ConferenceManager\SoftPhoneInboundCreate $data): Models\AA console [STAGING]D TeamsToludTwilinM TwiliorlexM TwilinGlovDirostM TwilinVidenC UploaderD Vonage• D Xant0 Zoom→2ZoomBot)lZoomPhoneC) ActivitvCrmFieldsResolver.ohoC) ActivitvLoaService.ohoC ActivitvProviderClient.oho© ActivitvProviderRegistrv.ohnC ActivitvProviderService.ohv(c) CallDenormalizerRegistrv nhn(c) CrmownerRecolver nhn@ DatalmnortHandlerinterface nhnC. MeetinaRotService nhrsroomuwner = saata-›gerusersrean = sroomuwner-›gecleanscallerla = soaca-›oeclaclertoonScallerCallSid = $data->qetCallSidO:en->gecsortrhone.ndounduesclnaclonnumberr572$now = nowO:if (! $this->activityService->teamCanDial($room0wner->getTeam(), $roomOwner->softphone_inboundSreqnon = qetReq1onByNumberSroomownelthrow new LogicExcention(sprintfl580format: 'Sorry, dialina %s is not available with vour subscriotion.'582Please contact your manager to enable additional destinations.',585$lead = $account = Sopportunity = $contact = $stage = null;tryfScrmService = sthis->crmProviderRegistrv->oetsroomowner->oetTeamo->crm->orovider):ScrmService->setlserSroom0wner):587589591593t: CrmOwnerResolver::class, [= Sroomowner->qetTeamo.'providerStua' => Sroombwner->qetTeamo->aetcrmconfiaurationO->qetProviderNameO.1):SermService = ScrmPesollver->orenarecrmServi.ceo:ISlead. Saccount. Sonnortunitv. Scontact. Sstadel = ScrmService->matchBvPhone(Sroomdwnen->aetIdo} catch (\Throwable $throwable) {cthie-sloagen-sennon( METHOnI': crm exception', ['exception' => $throwable597599600601602603604605606— 6071):// maybe their crm is disconnected, but this shouldn't prevent an inbound call from happeni 616— 609_611613336337/** @var Models\Activity Sactivity *Sactivity = SroomOwner-›activities()->create(["'tyDe'=> Models Activitv::TYPE SOFTPHONE INBOUNDprovidenteo cienCTKejEdE File A IDER AW46t6 files →n rectored Il Pollback II Confiaure (maments aao)lTx: AutovSo jiminny vCONCAT(u.id, CASE WHEN U.id = t.owner_id THEN' (owner)' ELSE'' END) AS USEr_i041 A1 A40 V65 ^U.emailt.owner_id FROM social_accounts saJOIN users u on v.id = sa.sociable_idJOIN teams t l..n<->l: on t.id = u.team_idWHERE u.team_id = 581 and sa.provider = 'salesforce':SELECT * FROM automated_report_results order by id desc;select x tron reacures,select * from team_features where feature_id = 40;select * from teams where id = 556:select * trom 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 za desc;SELECT * FROMWHEKE 10 = 171121select * fromautomated report results WHERE report id = 54:select * from opportunities where 1d = 75943491SELEC * FROM teams WHERE name LIKE "%lesx': # 711, 692. 16067 -Timinnvintearationdlesmills.comselect * from playbooks where team_id = 711; # event 226147SELEd * FROM DLavbook catedonies WHERE Dlavbook 10 = 5515.SELECT * FROM crm_fields WHERE crm_configuration_id = 692 and object_type = 'event':SELECT * SROM eom fields WHERE1d = 2261471SELECT * FROM com field values WHERE com field id = 226147:SELECT * FROM crm_configurations WHERE id = 692SELSCTCONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '• END) AS user_id,v.emailsa.*t.owner id FROM social accounts saJOIN users u on v.id = sa.sociable idJOIN teams t 1..n<->1: on t.id = u.team idWHERE u.team id = 711 and sa.provider = 'salesforce':SELECT * FROM crm profiles co JOIN users u 1..n<->1: on u.id = co.user id WHERE u.team_id = 711:select * from leads:select * from calendarsSELENT• suppont Dally • In 40 m100% 1• Mon 18 May 14:20:28U AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token Falli+0 ..• php -l /Users/lukas/jiminny/app/app/Services/Telephony/TextMessagingService.phpzsh:: comnand not tound: ongTnoughtsInoughttor is>I've successfully implemented the fallback token logic for Twilio calls to match the existing dialer pattern. Here's what wasSummary of Changes1. SoftPhoneManager.php• Added import: crmuwnerkesolvenOutbound calls ([EMAIL] method)• Replaced direct CRM service user setting with CrmOwnerResolverl•If fallback fails, falls back to original behavior (team owner or user)• Added error logaina for fallback failures• Inbound calls (createInboundActivity app/Services/Activity/CrmOwnerResolver.php• Renlaced direct CRM service user setting with CrmlwnerRecolverl•Maintains existing exception handling for CRM failures• Added import: CrmOwnerResolven• buildActivity method•Replaced direct CRM service user setting with CrmOwnerResolver•|f falllback fails and CRM is not required, falls back to team ownen• If CPM is reauired and fallback fails re-throws excention•Replaced direct CRM service user setting with CrmOwnerResolver• |f rallback fails and CRM is not required, falls back to team ownen•If CRM is required and fallback fails, captures exception and returns user's country codeHow It WorksThe imolementation uses the existing CrmOwnerResolver class which:1. First tries the intearation admin's CRM connection2.If that fails with SoctalAccountTokenTnvalidFycention sparches for team members with active CPM connections3. Orders candidates by role (owner, admin, manager, other users)4. Tries each candidate until findina one with a valid connection5. If all fail, throws the original exceptionThis ensures that when the Salesforce admin token has expired. Twilio calls will automaticallv use another active Salesforcetoken from the organization, preventing "Unknown customer" issuesAccent alliAsk anvthina (884-L)« Code SWF-1.6WN Windsurf Toams 202.28 UTF.8io 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|