|
53466
|
1872
|
59
|
2026-05-18T12:08:53.107351+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106133107_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4417380801178660783
|
-7437570419437085421
|
click
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelpSupport Daily ⢠nowâmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)Edit8 JiMINY100% C8⢠Mon 18 May 15:08:5220 5g For youŠ Recent |# Starred8. AppsQ SpacesStarred§ Service-Desk⢠Jiminny (Old)Jiminny (New)I CID Platform TeamIID Enterprise Stability L...110 Processing TeamID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence1: Teams% Customise sidebarTab( AtterSchelŠ Cursc* Ciauc|⢠Costapp.oC Allow | Pipel⢠JmirZ Y-2C (Y-27 [JY-27 [JY-28⢠Mon 18 May 15:08KZ (UY-2⢠JminnyProjects |E3 SSH⢠Home|Salesforce M O 88 [ E Datadog * Claude3 CircleciA Sentry0 Tasks7 Insights & Coachin0 DevDD Al BookmarkaSearch+ CreateAsk Rovo(e, Addparent / JY-20912We identified an issue for Tourlane where Twillo calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM objectmatching fails because the system relies only on the admin's Salesforce token.We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use i for CRM matching.Detailsstory point esumateStory PointsNoneAcceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.OrganisationsNonePriority= MediumSubtasksAdd subtaskFix versionsNoneLinked work itemsAdd linked work itemSprintPlatform Sprint 5 Q2DaysActivityCommentsWork logNeed QAYesNormal textv-"+v|O WriteCanny LinksOpen Canny LinksBE: 1 dayMore fields%. 0 + Adelina Petrova8 + Stefka Stoyanova2 + Galya Dimitrova + Nikolay Nikolov + Lukas Kovaiik + Nikolay IvanovParentNoneCancelNikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik3:08 PM | [Platform] RefinementÂŽTurn off microphone (88 + d)......
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53467
|
1873
|
24
|
2026-05-18T12:08:53.107609+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106133107_m2.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.016123671,"height":-0.051875472},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.27094415,"top":1.0,"width":0.004986702,"height":-0.051875472},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.27310506,"top":1.0,"width":0.010638298,"height":-0.086193085},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.30634972,"top":1.0,"width":0.059507977,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.30634972,"top":1.0,"width":0.059507977,"height":-0.07342374},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.69481385,"top":1.0,"width":0.019614361,"height":-0.06424582},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.7081117,"top":1.0,"width":0.0023271276,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.71708775,"top":1.0,"width":0.011968086,"height":-0.06424582},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.7184175,"top":1.0,"width":0.043550532,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.7330452,"top":1.0,"width":0.013464096,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.73204786,"top":1.0,"width":0.011303191,"height":-0.065043926},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
-4370592710466080615
|
-5133979210037076205
|
click
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
PhostormVIewINavicatecodeLaravelKeŃactolFV faVsco.js°9 master kProledeyCActivityController.ongC BaseService.onpŠ SoftPhoneManager.php(c) Constants.one(C) CoreUserRequest.onpŠ ScimProvisioning.php x Š CoreUser.php⢠Scimintertace.ongD Seedern lictonorDoloCannotllavo AdminOriarW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio⢠M Conference⢠ConferenceHandlerC) SoftPhoneManader.ohdŠ ConferenceCallbackHandler.phpŠ ConferenceManager.phpIMnTOTM EventD ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onpŠ TwilioRepository.php0 Uploader0 UrlGeneratora Utility0 Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsM Activities>M Analvticc⢠Calendarsv MCrmM Huhsnotclass ScimProvisioningprivate function assignRolesFromScim(Usen Susen, ConeUsenRequest Sdto, Tean Steam): voidroles' => Sroleldsi."roles' =>'array'main: 1'0new DependentRolesPule(SvisibleRoles)lnew ListenerRoleCannotHaveAdmin0rManagerPermissionRule(SvisibleRoles),'roles.*' => [anstinet""an.⢠SvisibleRoles->pluck( value: 'id')->implode( value: ',').now lictononPoloPonuinoclictonenSostunePule/ctoam)lif (Svalidator->fails0) {return:sroles = "viszoleroles->wheren key: "1d', Srolelds):Sdto = new UserRolesSvncoT0roles: Sroles.public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): GroIntegrationApp⢠M TraitsC) Addl avoutEntities.nhnŠ AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountle RullbornCommand Ahctraat nhn(e) RullbornDinaCommand nhn=laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]& console [EU]A console [STAGING] X554555556557558'_563566-567568569570v Tx: AutovGo jiminny_jupiterwhere crm_configuration_id = 1 and pl.playbook_id = 175:019 A19 V17 ^select * from teamsSELECT r.* FROM automated_reports rjoin teams t on r.team id = t.idhckE r.trequency = "dallyAND t.status = 'active'AND (r.expires.at >= now() OR r.expires.at IS NULL);1 automated_report_results where report 1d IN (18, 339select * from users where team_id = 1 and id = 1047;SELE * FROMIsochal accounts WHERE soctable 10 = 10471select * from activity_searches where id = 10932:select * from activity_search_filters where activity_search_id = 10932;select * fromautomated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_reports where id IN (55);select * from automated_report_results where id IN (81);select * from users where id IN (10633, 13987, 11985);select * from users where group_id IN (3710):SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuidSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuidselect * from teams;select * from accounts where team_id = 1:select * trom automated report results where media type = "pdt' and status = 2SFLECT * FROM automated report results WHERE uuid_ to_ bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid)select * from teams where id = 1029;select * fromcrm_configurations where provider = 'pipedrive':SELECTCONCAT(u,id. CASE WHEN u.id = t.owner id THEN ⢠(owner)' ELSE â˘â˘ END) AS user idisa.*t.owner id FROM social accounts saJJouN users u on u.id = sa.sociable idi1.n<->1: on +.id = u.team idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idl. "23460 ownen)""idi. ko⢠Mon 10 May 10:00.04AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token FalliSCIM Role Manageme+0 ..inp on LineWARN Metadata found iin doc-comment for method9/ 10 tacke doneWrite unit tests for SCIM role management10) Contact Mario to vodate customer10 / 10 tasks doneselm role managementtor leamtallor has been successtully implemented. Here's what was completed:Implementation Summary:1. CoreUserRequest DTO - Added role parsina from SCIM requests2. SCIM Constants - Added META ROLES and USER_PATCH_ ATTR_ ROLES constants3. RoleAttr Mutator - Created mutator for handlina role assianments via SCIM PATCH operations4. ScimProvisioning - Updated to handle roles during user creation with proper validation5. ListenerRoleCannotHaveAdminOrManagerPermissionRule - Created validation rule to prevent listener role fromhaving admin/manager permissions6. CoreUser Response - Updated to include roles in SClM responses7. Unit Tests - Created comprehensive tests for the validation ruleKey Features:⢠Customers can now assign roles via SCIM (recorder, recorder & voice, analyst, listener, admin, manager)⢠Validation ensures listener role is onlv assianable if the LISTENER ROLE feature flaa is enabledâ˘LIstener role cannot de comolned with aamin or manager permissions⢠Uses existing UpdateUserRolesAction for role syncing and logging⢠Follows platform validation rules (DependentRolesRule, ListenerRoleRequiresListenerFeatureRule)Next Step: Please contact Mario to update the customer that SCIM role management is now available for Teamtailorintearationposwtn chaten vapp/Component/SClM/ Constants.php +3app/Component/SCIM/ ÂŽ ScimProvisioning.php +85-15nse/ CoreUser.php +21ann/Comnonent/SCIM/Mutatore/Attributes/Ueer/M PoleAttr.nhn +17-ites/Userl áş RoleAttrTest.ohn +224* Reiect alliiAccent alliAsk anvthina 884-L)ÂŤ Code SWF-1.60 01W Windsurf Teams 1:1 UTF-8fo 4 spaces...
|
53462
|
NULL
|
NULL
|
NULL
|
|
53468
|
1872
|
60
|
2026-05-18T12:08:54.082283+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106134082_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
-628936254610605151
|
3314726790612932230
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelpSupport Daily ⢠nowâmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)Chromeoekmatâ˘$18EditTab* AtterC SchelŠ Cursc* Ciauc|Cost app.oAllowo Piot⢠Jmin|KEJY-ZC (Y-27 LJY-27 [JY-28⢠Mon 18 May 15:08KZ (JY-2https://fiminny.atlassian.net/browse/JY-20912⢠JminnyProjects |E3 SSH⢠Home| Salesforce M O 88 E Datadog * Claude3 CircleciA Sentry0 TasksInsights & CoachinâŚ0J DevDD Al Bookmarka8 JiMINYSearch+ CreateAsk Rovo[, Add parent1 A Jy-20912* For youŠ Recent|# Starred8. AppsQ SpacesStarred§ Service-Desk⢠Jiminny (Old)We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalestorce toxen trom any user within the same organisacon and use kior chiw matchingDetailsstory point esumateAcceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Story PointsNoneOrganisationsNoneJiminny (New)I CID Platform TeamSubtasksAdd subtaskPriority= MediumIID Enterprise Stability I...Linked work itemsAdd linked work itemFix versionsNoneID SE Kanban= More spaces= Filters(B DashboardsOperationsActivitySprintPlatform Sprint 5 Q2Work logDaysAdd a comment.Who is working on this...?Status updateâŚThanksI|Need QAYesConfiuence:: TeamsProlos dretsWoeeCanny LinksOpen Canny Links% Customise sidebarNikolay YankovMore fieldsBE: 1 dayCA.OS OaVParentNone100% C8 ⢠Mon 18 May 15:08:5320 5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik3:08 PM | [Platform] Refinement ÂŽ...
|
53466
|
NULL
|
NULL
|
NULL
|
|
53469
|
1872
|
61
|
2026-05-18T12:08:57.150247+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106137150_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Zoom in
Open in new window
Enter Full Screen
Nikolay Yankov
Aneliya Angelova
Nikolay Ivanov
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:08
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn on microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"3:08","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.022916667,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07673611,"top":0.9444444,"width":0.016666668,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"[Platform] Refinement đ","depth":12,"bounds":{"left":0.11076389,"top":0.9111111,"width":0.12916666,"height":0.08888888},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"[Platform] Refinement đ","depth":15,"bounds":{"left":0.11076389,"top":0.9438889,"width":0.12916666,"height":0.023333333},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Audio settings","depth":13,"bounds":{"left":0.32118055,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on microphone","depth":13,"bounds":{"left":0.34895834,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":true,"is_selected":false},{"role":"AXButton","text":"Video settings","depth":13,"bounds":{"left":0.38784721,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off camera","depth":13,"bounds":{"left":0.415625,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Nikolay Yankov is presenting","depth":12,"bounds":{"left":0.45451388,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Send a reaction","depth":12,"bounds":{"left":0.49895832,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on captions","depth":13,"bounds":{"left":0.5434028,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Raise hand (ctrl + â + h)","depth":12,"bounds":{"left":0.58784723,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options","depth":12,"bounds":{"left":0.6322917,"top":0.9288889,"width":0.025,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
9162657293987814728
|
2022230977593536790
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Zoom in
Open in new window
Enter Full Screen
Nikolay Yankov
Aneliya Angelova
Nikolay Ivanov
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:08
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn on microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelpSupport Daily ⢠nowâmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)Chromeâ˘$18EditTab* AtterC SchelŠ Cursc* Ciauc|Cost app.oAllowo Piot8JimirKEJY-ZC (Y-27 LJY-27 [JY-28⢠Mon 18 May 15:08KZ (JY-2httos:/minny.atiassian.net/browse/fY-20912⢠JminnyProjects |E3 SSH⢠Home| Salesforce M O 88 E Datadog * Claude3 CircleciA Sentry0 Tasks7 Insights & Coachin0 DevDJ Al Bookmarkal8 JiMINYSearch+ CreateAsk Rovo(, Add parent1 R Jy-20912* For youŠ Recent |# Starred8. AppsQ SpacesStarred§ Service-Desk⢠Jiminny (Old)We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalestorce toxen trom any user within the same organisacon and use kior chiw matchingDetailsstory point esumateAcceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Story PointsNoneOrganisationsNoneJiminny (New)I CID Platform TeamSubtasksAdd subtaskPriority= MediumIID Enterprise Stability L...111 Processina TeamLinked work itemsAdd linked work itemFix versionsNoneID SE Kanban= More spaces= Filters(B DashboardsOperations⢠ActivitySprintPlatform Sprint 5 Q2Work logDaysAdd a comment.Suggest a replyâŚ.Who is working on this...?Status updateâŚNeed QAYesx Confiuence:: TeamsProtos deneoeonCanny LinksOpen Canny Links% Customise sidebarNikolay YankovMore fieldsBE: 1 dayCA.OSOaVParentNone100% C8⢠Mon 18 May 15:08:575Nikolay YankolAneliya AngelovaNikolay lIvanoLukas Kovalik3:08 PM | [Platform] Refinement ÂŽ...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53470
|
1872
|
62
|
2026-05-18T12:09:03.235687+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106143235_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn on microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options
Leave call
Meeting details
Chat with everyone
Meeting tools
Turn on microphone (â + d)
Your microphone is off....
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"3:09","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.022916667,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07673611,"top":0.9444444,"width":0.016666668,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"[Platform] Refinement đ","depth":12,"bounds":{"left":0.11076389,"top":0.9111111,"width":0.12881945,"height":0.08888888},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"[Platform] Refinement đ","depth":15,"bounds":{"left":0.11076389,"top":0.9438889,"width":0.12881945,"height":0.023333333},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Audio settings","depth":13,"bounds":{"left":0.32118055,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on microphone","depth":13,"bounds":{"left":0.34895834,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":true,"is_selected":false},{"role":"AXButton","text":"Video settings","depth":13,"bounds":{"left":0.38784721,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off camera","depth":13,"bounds":{"left":0.415625,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Nikolay Yankov is presenting","depth":12,"bounds":{"left":0.45451388,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Send a reaction","depth":12,"bounds":{"left":0.49895832,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on captions","depth":13,"bounds":{"left":0.5434028,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Raise hand (ctrl + â + h)","depth":12,"bounds":{"left":0.58784723,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options","depth":12,"bounds":{"left":0.6322917,"top":0.9288889,"width":0.025,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Leave call","depth":12,"bounds":{"left":0.6628472,"top":0.9288889,"width":0.05,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Meeting details","depth":12,"bounds":{"left":0.89166665,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Chat with everyone","depth":12,"bounds":{"left":0.925,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Meeting tools","depth":12,"bounds":{"left":0.9583333,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Turn on microphone (â + d)","depth":10,"bounds":{"left":0.3125,"top":0.9027778,"width":0.105902776,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Your microphone is off.","depth":8,"on_screen":false,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
5984563213577485294
|
-7439679969665951472
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn on microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options
Leave call
Meeting details
Chat with everyone
Meeting tools
Turn on microphone (â + d)
Your microphone is off.
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelpSupport Daily ⢠nowâCmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)eTomtEditM Inbo100% C8⢠Mon 18 May 15:09:0320 518* For youŠ Recent|# Starred8. AppsQ SpacesStarred( Service-DeskJiminny (Oid)Jiminny (New)ICD Platform TeamIID Enterprise Stablity I...181 Processing TeamID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams$; Customise sidebaroeumatTab( AtterC Schel⢠Cursâš* Ciauc⢠Cost|@ app.c C Alon PiceiZ [JY-3X [JY-8⢠Mon 18 May 15:00Z TY-httosnminny.atiassian.net/browse/JY-20912⢠JminnyC ProjectsE3 SSH⢠Home| Salesforce⢠O 8 [ Ee Datadog # Ciaude3 CircleciA Sentry0 Tasks7 insights & Coachin..0 Dev|0D Al BookmarkaSearch+ CreateAsk Rovo(e, Add parent/ 0 J-20912We shoutd implement the same fariback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use i for CRM matching.nccopionce crkertes⢠It the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.SubtäsksAdd subtaskLinked work itemsActivityWork logAdd 'a comment.Suggest a reply.Who is working on this...?Status update..Pro tios press M to cNikolay YankovNormal textBE: 1 dayDetailsstory point esumateStory PointsNoneOrganisationsNonePriority= MediumFix versionsNoneSprintPlatform Sprint 5 Q2DaysNoneNeed QAYesCanny LinksOpen Canny LinksMore fieldsParentHonelNikolay YankoAneliya AngelovaNikolay IvanoLukas KovalikTurn on microphone (g + d)3:09 PM | [Platform] Refinement ÂŽ...
|
53469
|
NULL
|
NULL
|
NULL
|
|
53471
|
1872
|
63
|
2026-05-18T12:09:06.277381+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106146277_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn on microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"3:09","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.022916667,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07673611,"top":0.9444444,"width":0.016666668,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"[Platform] Refinement đ","depth":12,"bounds":{"left":0.11076389,"top":0.9111111,"width":0.12881945,"height":0.08888888},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"[Platform] Refinement đ","depth":15,"bounds":{"left":0.11076389,"top":0.9438889,"width":0.12881945,"height":0.023333333},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Audio settings","depth":13,"bounds":{"left":0.32118055,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on microphone","depth":13,"bounds":{"left":0.34895834,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":true,"is_selected":false},{"role":"AXButton","text":"Video settings","depth":13,"bounds":{"left":0.38784721,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off camera","depth":13,"bounds":{"left":0.415625,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Nikolay Yankov is presenting","depth":12,"bounds":{"left":0.45451388,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Send a reaction","depth":12,"bounds":{"left":0.49895832,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on captions","depth":13,"bounds":{"left":0.5434028,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
-4801374035115195083
|
-7457695880003856366
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn on microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
+FirefoxFileEditViewHistoryBookmarksProfilesTools Window HelpSupport Daily ⢠nowâCmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)Chromeâ˘$18FieEditM InboÂť# Projel0 AttenC Schel⢠Curs:* Ciauc⢠Cost ⏠app.r C Allov Pipel0 Jmir|KWJY-Z (Y-2U LY-Z IJY-28⢠Mon 18 May 15:00(JY-2https://iminny.atlassian.net/browse/JY-20912⢠Sminny⢠ProjectsE3 SSH⢠Home| Salestorce @ O 88 [l ElDatadog @ # Ciaude CircleciA Sentry0 Tasks|Z Insights & Coachin. Dev D UXDD All Bookmario8 JMINAYSearch+ CreateAsk Rovo* For youŠ Recent|# Starred8. AppsQ SpacesStarredY) Service-DeskJiminny (Old)Spaces/Jminny (New) / ( Nddparent / A Jy-20912Fallback mechanism for users with active SF tokens for CRM MatchingDetailsstory pont esumate⢠DescriptionWe identified an issue for Tourlane where Twillo calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM object|matching fails because the system relies only on the admin's Salesforce token.Story PointsNoneWe should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use il for CRM matching.OrganisationsNoneJiminny (New)ICD Platform TeamPriorityIID Enterprise Stabllity L...111 Processing TeamiAcceptance Criteria:⢠Il the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.For versionsNone(ID SE Kanban= More spaces= Filters(B DashboardsOperationsSprintPlatform Sprint 5 Q2SubtasksDaysadd suotaskLinked work itemsAdd linked work iterNeed QAYesx Confiuencea: Teams~ActivityCanny LinksOpen Canny Links%; Customise sidebarCommentsHistoryWork logAdd a comment.More fieldsSuggest a replyWho is working on this..?Status update...Pro tip: press (M to comlParentNoneTurn on microphone (g + d)3:09 PM | [Platform] Refinement ÂŽ..â˘100% C8⢠Mon 18 May 15:09:065Nikolay YankoAneliya AngelovaNikolay lIvanoLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53472
|
1872
|
64
|
2026-05-18T12:09:09.287136+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106149287_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn on microphone
Video settings...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"3:09","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.022916667,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07673611,"top":0.9444444,"width":0.016666668,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"[Platform] Refinement đ","depth":12,"bounds":{"left":0.11076389,"top":0.9111111,"width":0.12881945,"height":0.08888888},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"[Platform] Refinement đ","depth":15,"bounds":{"left":0.11076389,"top":0.9438889,"width":0.12881945,"height":0.023333333},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Audio settings","depth":13,"bounds":{"left":0.32118055,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on microphone","depth":13,"bounds":{"left":0.34895834,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":true,"is_selected":false},{"role":"AXButton","text":"Video settings","depth":13,"bounds":{"left":0.38784721,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
1026546326546247305
|
-7457695879995271150
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn on microphone
Video settings
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelpSupport Daily ⢠nowâCmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)ehtomFleEditView))18M Inbar7 ProjeAtte( Schel⢠Curs:* Ciau:|⢠Cost app.c G Allow PipelKJY-C UY-2Z LJY-27 [JY-28⢠Mon 18 May 15:00IZ (JY-2httos:/minny.atiassian.net/browse/JY-2091Sminny[ Projects |E3 SSH⢠Home| Salesforce O 8 [l E Datadog * Claude CircleciA Sentry0J Tasksz Insights & Coachin_ Dev D UXCJ Al Bookmarko⢠JIMINNYSearch+ CreateAsk Rovo* For you⢠Recent |# Starred8. AppsQ SpacesStarredS Service-DeskJiminny (Old)Spaces/Jmicay (New) / (@ Add parent / [ JY-20912Fallback mechanism for users with active SF tokens for CRM [EMAIL] point esumare⢠Description|We identified an issue for Tourlane where Twillo calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM object|matching fails because the system relies only on the admin's Salesforce token.Story PointsNoneWe should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use it for CRM matching.OrganisationsNoneJiminny (New)ICD Platform TeamPriority= MediumIID Enterprise Stabllity L..Acceptance Criteria:⢠Il the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Fix versionsNoneID SE Kanban= More spaces= Filters(B DashboardsOperationsSprintPlatform Sprint 5 Q2SubtasksDaysAdd suotaskRootxewokteiNeed QAYesx ConfiuencereamsActivityCanny LinksOpen Canny Links%; Customise sidebarCommentsHiskoryWork 1ogAdd a comment.More fieldsSuggest a replyâŚWho is working on this...?Status update...Pro tip: press (M to comParentNoneTurn on microphone (g + d)3:09 PM | [Platform] Refinement ÂŽ100% <*8⢠Mon 18 May 15:09:0920 5Nikolay YankAneliya AngelovaNikolay lvangLukas Kovalik...
|
53471
|
NULL
|
NULL
|
NULL
|
|
53473
|
1872
|
65
|
2026-05-18T12:09:12.304460+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106152304_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn on microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options
Leave call...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"3:09","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.022916667,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07673611,"top":0.9444444,"width":0.016666668,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"[Platform] Refinement đ","depth":12,"bounds":{"left":0.11076389,"top":0.9111111,"width":0.12881945,"height":0.08888888},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"[Platform] Refinement đ","depth":15,"bounds":{"left":0.11076389,"top":0.9438889,"width":0.12881945,"height":0.023333333},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Audio settings","depth":13,"bounds":{"left":0.32118055,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on microphone","depth":13,"bounds":{"left":0.34895834,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":true,"is_selected":false},{"role":"AXButton","text":"Video settings","depth":13,"bounds":{"left":0.38784721,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off camera","depth":13,"bounds":{"left":0.415625,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Nikolay Yankov is presenting","depth":12,"bounds":{"left":0.45451388,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Send a reaction","depth":12,"bounds":{"left":0.49895832,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on captions","depth":13,"bounds":{"left":0.5434028,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Raise hand (ctrl + â + h)","depth":12,"bounds":{"left":0.58784723,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options","depth":12,"bounds":{"left":0.6322917,"top":0.9288889,"width":0.025,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Leave call","depth":12,"bounds":{"left":0.6628472,"top":0.9288889,"width":0.05,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
4718405180467663012
|
-7435177607257532142
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn on microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options
Leave call
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelpSupport Daily ⢠nowâCmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)FieEdit# Proje( AtterSche⢠Cursc* ClaucCostŠ app. C Alow PicelKJY-L UY-Z LUY-2X WJY-28⢠Mon 18 May 15:00U UUY-2https://iminny.atiassian.net/browse/JY-20912⢠JminnyD ProjectsE3 SSH⢠Home| Salesforce O 88 [l ElDatadog ÂŽ $ Ciaude CircleciA Sentry⢠xI0 Tasks7 Insights & Coachin DevCJ All Bookmarka8 JIMINNYSearch+ CreateAsk Rovo* For youŠ Recent |# Starred8. AppsQ SpacesStarred9 Service-DeskJiminny (Old)Spaces/Iminey (ONew) / (B Asd parent1A Jy-20912Fallback mechanism for users with active SF tokens for CRM MatchingDetailsstory point esumaseDescriptionWe identified an issue for Tourlane where Twilio calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM object |matching fails because the system relies only on the admin's Salesforce token.Story PointsNoneWe should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use il for CRM matching.OrganisationsNoneJiminny (New)I 0D Platform TeamPriority= MediumIID Enterprise Stability L...Acceptance Criteria:⢠Il the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Fix versionsNone(ID SE Kanban |= More spaces= Filters(B DashboardsOperationsSprintPlatform Sprint 5 Q2SubtasksDaysAdd suotaskNeed QAYesx Confiuence:: TeamsActivity18Canny LinksOpen Canny Links% Customise sidebarCommentsWork logAdd a comment.~ More fieldsSuggest a replyâŚWho is working on this...?Status update...ParentNoneYro Lp: press M to conTurn on microphone (g + d)3:09 PM | [Platform] Refinement ÂŽ..â˘100% C8⢠Mon 18 May 15:09:125Nikolay YankAneliya AngelovaNikolay lvangLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53475
|
1873
|
25
|
2026-05-18T12:09:15.427321+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106155427_m2.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.016123671,"height":-0.051875472},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.27094415,"top":1.0,"width":0.004986702,"height":-0.051875472},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.27310506,"top":1.0,"width":0.010638298,"height":-0.086193085},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.30634972,"top":1.0,"width":0.059507977,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.30634972,"top":1.0,"width":0.059507977,"height":-0.07342374},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.69481385,"top":1.0,"width":0.019614361,"height":-0.06424582},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.7081117,"top":1.0,"width":0.0023271276,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.71708775,"top":1.0,"width":0.011968086,"height":-0.06424582},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.7184175,"top":1.0,"width":0.043550532,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.7330452,"top":1.0,"width":0.013464096,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.73204786,"top":1.0,"width":0.011303191,"height":-0.065043926},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-269831612197870871
|
1729506896950253058
|
click
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
PhostormVIewINavicatecodeLaravelKeŃactolFV faVsco.js°9 master kProledeyCActivityController.ongC BaseService.onpŠ SoftPhoneManager.php(c) Constants.one(C) CoreUserRequest.onpŠ ScimProvisioning.php x Š CoreUser.php⢠Scimintertace.ongD Seedern lictonorDoloCannotllavo AdminOriarW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio⢠M Conference⢠ConferenceHandlerC) SoftPhoneManader.ohdŠ ConferenceCallbackHandler.phpŠ ConferenceManager.phpIMnTOTM EventD ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onpŠ TwilioRepository.php0 Uploader0 UrlGeneratora Utility0 Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsM Activities>M Analvticc⢠Calendarsv MCrmM Huhsnotclass ScimProvisioningprivate function assignRolesFromScim(Usen Susen, ConeUsenRequest Sdto, Tean Steam): voidroles' => Sroleldsi."roles' =>'array'main: 1'0new DependentRolesPule(SvisibleRoles)lnew ListenerRoleCannotHaveAdmin0rManagerPermissionRule(SvisibleRoles),'roles.*' => [anstinet""an.⢠SvisibleRoles->pluck( value: 'id')->implode( value: ',').now lictononPoloPonuinoclictonenSostunePule/ctoam)lif (Svalidator->fails0) {return:sroles = "viszoleroles->wheren key: "1d', Srolelds):Sdto = new UserRolesSvncoT0roles: Sroles.public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): GroIntegrationApp⢠M TraitsC) Addl avoutEntities.nhnŠ AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountle RullbornCommand Ahctraat nhn(e) RullbornDinaCommand nhn=laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]& console [EU]A console [STAGING] X554555556557558'_563566-567568569570v Tx: AutovGo jiminny_jupiterwhere crm_configuration_id = 1 and pl.playbook_id = 175:019 A19 V17 ^select * from teamsSELECT r.* FROM automated_reports rjoin teams t on r.team id = t.idhckE r.trequency = "dallyAND t.status = 'active'AND (r.expires.at >= now() OR r.expires.at IS NULL);1 automated_report_results where report 1d IN (18, 339select * from users where team_id = 1 and id = 1047;SELE * FROMIsochal accounts WHERE soctable 10 = 10471select * from activity_searches where id = 10932:select * from activity_search_filters where activity_search_id = 10932;select * fromautomated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_reports where id IN (55);select * from automated_report_results where id IN (81);select * from users where id IN (10633, 13987, 11985);select * from users where group_id IN (3710):SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuidSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuidselect * from teams;select * from accounts where team_id = 1:select * trom automated report results where media type = "pdt' and status = 2SFLECT * FROM automated report results WHERE uuid_ to_ bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid)select * from teams where id = 1029;select * fromcrm_configurations where provider = 'pipedrive':SELECTCONCAT(u,id. CASE WHEN u.id = t.owner id THEN ⢠(owner)' ELSE â˘â˘ END) AS user idisa.*t.owner id FROM social accounts saJJouN users u on u.id = sa.sociable idi1.n<->1: on +.id = u.team idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idl. "23460 ownen)""idi. ko⢠Mon 10 May 10.09.12AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token FalliSCIM Role Manageme+0 ..inp on LineWARN Metadata found iin doc-comment for method9/ 10 tacke doneWrite unit tests for SCIM role management10) Contact Mario to vodate customer10 / 10 tasks doneselm role managementtor leamtallor has been successtully implemented. Here's what was completed:Implementation Summary:1. CoreUserRequest DTO - Added role parsina from SCIM requests2. SCIM Constants - Added META ROLES and USER_PATCH_ ATTR_ ROLES constants3. RoleAttr Mutator - Created mutator for handlina role assianments via SCIM PATCH operations4. ScimProvisioning - Updated to handle roles during user creation with proper validation5. ListenerRoleCannotHaveAdminOrManagerPermissionRule - Created validation rule to prevent listener role fromhaving admin/manager permissions6. CoreUser Response - Updated to include roles in SClM responses7. Unit Tests - Created comprehensive tests for the validation ruleKey Features:⢠Customers can now assign roles via SCIM (recorder, recorder & voice, analyst, listener, admin, manager)⢠Validation ensures listener role is onlv assianable if the LISTENER ROLE feature flaa is enabledâ˘LIstener role cannot de comolned with aamin or manager permissions⢠Uses existing UpdateUserRolesAction for role syncing and logging⢠Follows platform validation rules (DependentRolesRule, ListenerRoleRequiresListenerFeatureRule)Next Step: Please contact Mario to update the customer that SCIM role management is now available for Teamtailorintearationposwtn chaten vapp/Component/SClM/ Constants.php +3app/Component/SCIM/ ÂŽ ScimProvisioning.php +85-15nse/ CoreUser.php +21ann/Comnonent/SCIM/Mutatore/Attributes/Ueer/M PoleAttr.nhn +17-ites/Userl áş RoleAttrTest.ohn +224* Reiect alliiAccent alliAsk anvthina 884-L)ÂŤ Code SWF-1.60 01W Windsurf Teams 1:1 UTF-8fo 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53474
|
1872
|
66
|
2026-05-18T12:09:15.450240+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106155450_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
-1012797076754618815
|
-7457906711618134510
|
click
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
FirefoxFileViewTools WindowSupport Daily ⢠nowEditâHistoryCBookmarksProfilesHelpmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)100% C8⢠Mon 18 May 15:09:155=+FieEditoeumatDtonetM Inbo7 PlattF Proje( AtterSche⢠Cursc* Ciauc|0 Cost@ app.c C Alow PipelL UY-Z LUY-2X WJY-28⢠Mon 18 May 15:00U UUY-2:httos://minny.atiassian.net/browse/fY-20912⢠Jminny8 JiMINYg For youŠ Recent |# Starred8. AppsQ SpacesStarred9) Service-DeskJiminny (Old)Jiminny (New)I 0D Platform TeamIID Enterprise Stability L...(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams18% Customise sidebarProjectsE3 SSH⢠Home| Salestorce @ O 88 [l ElDatadoa O @ $ Ciaude CircleciA Sentry⢠xI0 Tasks7 Insights & Coachin DevSearch+ CreateSpaces/Iminey ONew) / &B Ndd parent/A Jy-20912Fallback mechanism for users with active SF tokens for CRM MatchingDescriptionWe identified an issue for Tourlane where Twilio calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM object |matching fails because the system relies only on the admin's Salesforce token.We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use il for CRM matching.Acceptance Criteria:⢠Il the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Subtasksadd suotaskCinxoeohxtchtActivityCommentsWork log= =8Add a comment.Suggest a replyâŚWho is working on this...?Status update...Yro Lp: press M to conTurn on microphone (g + d)3:09 PM | [Platform] Refinement ÂŽCJ All BookmarkaAsk RovoDetailsstory point esumaseStory PointsNoneOrganisationsNonePriority= MediumFix versionsNoneSprintPlatform Sprint 5 Q2DaysNeed QAYesCanny LinksOpen Canny Links~ More fieldsParentNone..â˘Nikolay YankoAneliya AngelovaNikolay IvanovLukas Kovalik...
|
53473
|
NULL
|
NULL
|
NULL
|
|
53476
|
1872
|
67
|
2026-05-18T12:09:21.328550+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106161328_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn off microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options
Leave call
Meeting details
Chat with everyone
Meeting tools
Your microphone is on....
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"3:09","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.022916667,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07673611,"top":0.9444444,"width":0.016666668,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"[Platform] Refinement đ","depth":12,"bounds":{"left":0.11076389,"top":0.9111111,"width":0.12881945,"height":0.08888888},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"[Platform] Refinement đ","depth":15,"bounds":{"left":0.11076389,"top":0.9438889,"width":0.12881945,"height":0.023333333},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Audio settings","depth":13,"bounds":{"left":0.32118055,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off microphone","depth":13,"bounds":{"left":0.34895834,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":true,"is_selected":false},{"role":"AXButton","text":"Video settings","depth":13,"bounds":{"left":0.38784721,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off camera","depth":13,"bounds":{"left":0.415625,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Nikolay Yankov is presenting","depth":12,"bounds":{"left":0.45451388,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Send a reaction","depth":12,"bounds":{"left":0.49895832,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on captions","depth":13,"bounds":{"left":0.5434028,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Raise hand (ctrl + â + h)","depth":12,"bounds":{"left":0.58784723,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options","depth":12,"bounds":{"left":0.6322917,"top":0.9288889,"width":0.025,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Leave call","depth":12,"bounds":{"left":0.6628472,"top":0.9288889,"width":0.05,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Meeting details","depth":12,"bounds":{"left":0.89166665,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Chat with everyone","depth":12,"bounds":{"left":0.925,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Meeting tools","depth":12,"bounds":{"left":0.9583333,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Your microphone is on.","depth":8,"on_screen":false,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
4418058558376710289
|
-7435249070949934318
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn off microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options
Leave call
Meeting details
Chat with everyone
Meeting tools
Your microphone is on.
+FirefoxViewTools WindowSupport Daily ⢠nowâ˘$18FileEditHistoryBookmarksProfilesHelpâCmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)FileEditM Inbo# Proje( AtterC SchelŠ Cursc* Ciauc|⢠Cost app.c | C Alow | Pipel⢠JimirKKJY-C UY-2Z [JY-27 [JY-28⢠Mon 18 May 15:00Z (JY-2"httosr⢠Jminny0 ProjectsE3 SSH⢠Home| Salestorce @ O 88 [I ElDatadoo O @ $ Ciaude O CircieciA Sentry0 Tasks7 Insights & Coachin DevDJ Al Bookmarka8 JMINAYSearch+ CreateAsk Rovog For youŠ Recent |# Starred8. AppsQ SpacesStarred9) Service-DeskJiminny (Old)Spaces/Iminey ONew) / (@ Add parent / [] Jy-20912Fallback mechanism for users with active SF tokens for CRM MatchingDetailsstory point esumaseDescription|We identified an issue for Tourlane where Twilio calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM objectmatching fails because the system relies only on the admin's Salesforce token.We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use il for CRM matching.Story PointsNoneOrganisationsNoneJiminny (New)I CD Platform TeamPriority= Medium(ID Enterprise Stability I...181 Processing TeamAcceptance Criteria:⢠Il the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Fix versionsNone(ID SE Kanban= More spaces= Filters(B DashboardsOperationsSprintPlatform Sprint 5 Q2Subtasksaod suotaskDaysworelLinked work itemsNeed QAYesx Confiuencei: TeamsActivityCanny LinksOpen Canny Links% Customise sidebarCommentsHiskoryWork logAdd a comment.More fieldsSuggest a replyâŚWho is working on this...?Status updateâŚParentNoneYro Lp: press M to com100% C8⢠Mon 18 May 15:09:215Nikolay Yanko)Aneliya AngelovaNikolay IvanovLukas Kovalik3:09 PM | [Platform] Refinement ÂŽ..â˘...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53477
|
1872
|
68
|
2026-05-18T12:09:30.465813+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106170465_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video....
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
2490078026332844675
|
-7457836617491949038
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelpSupport Daily ⢠nowâCmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)FleEdtTabProje( AtterC SchelŠ Curs* Ciauc⢠Com app.o Alov Poe Jmi⢠Jimir⢠JmiC UYZ JY-Z tY-8Mon 18 May 16:00A UY-2httosshminny.atiassian.net/browso/fy-20912C SminnyProjects |E3 SSH⢠Home|Salesforce 0 O 88 E El Datadog ÂŽ * Cuude O CICACISentry0 Taska 7 insights& Coachin. O Dev O UxDJ Al Bockomrarka88Search+ CreateAsk RovoÂŽ For youŠ Recent# Starred%. AppsQ SpacesStarredY Service-DeskJiminny (Oid)Spaces /Iminey NNew) / (B Ndd sarect: / F] Jv-20912Fallback mechanism for users with active SF tokens for CRM MatchingDetailssrory pont esumaseNone⢠Description|We identified an issue for Tourlane where Twilio calls appear as "Unknown Customer* when the Salesforce admin connection token has expired. In this case. CRM object |matching faits because the system relies only on the admin's Satesforce tokenStory PointsNoneWe should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use it for CRM matching.OrganisationsNoneJiminny (New)10D Piatform TeamPriority= Medium(ID Enterprise Stabilty L.181 Procossina TearmlAcceptance Criteria:⢠Il the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback toien.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.For versionsNoneCID SE Kanban|= More spaces= Fiiters(B DashboardsOperationsSprintPlatform Sprint 5 Q2SubtasksDaysAO0 SUOCOSKLinked work itemsNeed QAYesE Confiuencea8 Teams |-Activity18Canny LinksOpen Canny Links$; Customise sidebarAll CommentsWork logAdd a commentMore fieidsSuggest a reply-Who is working on this.?Status update...ParentNonePro tip: press M to cum3:09 PM | [Platform] Refinement ÂŽ..â˘100% C8⢠Mon 18 May 15:09:305Nikolay Yanko)Aneliya AngelovaNikolay IivanovLukas Kovalik...
|
53476
|
NULL
|
NULL
|
NULL
|
|
53478
|
1872
|
69
|
2026-05-18T12:09:33.506569+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106173506_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4417380801178660783
|
-7437570419437085421
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
+FirefoxViewTools WindowSupport Daily ⢠now81Bâ˘$18FileEditHistoryBookmarksProfilesHelpâCmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)FleEditTabM InborC AtterSchelŠ Curs* Ciauc | Com app.c Alon Pioe JminZ JY-8Mon 18 May 15:00A UY-2httosshminny.atiassian.net/browse/fY-20912⢠SminnyProjects |E3 SSH⢠Home| Salesforce O O 88 L El Dacadog @ I curude O CircecIA Sentry0J Tasks|227 Insights & Coachin. C Dev O UXDD Al Bookmarkaod8 JMInwYSearch+ CreateAsk Rovoâ˘ÂŽ For youŠ Recent# Starred8. Apps( Spaces|Starred(9) Service-DeskJiminny (Oid)Spaces/Iminny (Newl / (B Add parent. / [ JY-20912Fallback mechanism for users with active SF tokens for CRM MatchingDetailssrory pont esumare⢠Description|We identified an issue for Tourlane where Twillo calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM object|matching fails because the system relies only on the admin's Salesforce token.We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use il for CRM matching.Story PointsNoneOrganisationsNoneJiminny (New)I(ID Platform TeamPriority= MediumAcceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Fic versionsNoneIID Enterprise Stability L..IID Processing Team |I SE Kanban= More spaces= Filters(B DashboardsOperationsSprintPlatform Sprint 5 Q2SubtasksDaysAod suotaskLinked work itemsNeed QAYes3 Confiuence:: TeamsActivityCanny LinksOpen Canny Links%; Customise sidebarCommentsHiskoryWork logAdd a comment.More fieldsSuggest a replyWho is working on this...?Status updateâŚ..ParentNoneYro Lp: press M lo come3:09 PM | [Platform] Refinement ÂŽ:100% C8⢠Mon 18 May 15:09:335=Nikolay YankoiAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53479
|
1872
|
70
|
2026-05-18T12:09:36.542978+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106176542_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn off microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"3:09","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.022916667,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07673611,"top":0.9444444,"width":0.016666668,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"[Platform] Refinement đ","depth":12,"bounds":{"left":0.11076389,"top":0.9111111,"width":0.12881945,"height":0.08888888},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"[Platform] Refinement đ","depth":15,"bounds":{"left":0.11076389,"top":0.9438889,"width":0.12881945,"height":0.023333333},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Audio settings","depth":13,"bounds":{"left":0.32118055,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off microphone","depth":13,"bounds":{"left":0.34895834,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":true,"is_selected":false},{"role":"AXButton","text":"Video settings","depth":13,"bounds":{"left":0.38784721,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off camera","depth":13,"bounds":{"left":0.415625,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Nikolay Yankov is presenting","depth":12,"bounds":{"left":0.45451388,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Send a reaction","depth":12,"bounds":{"left":0.49895832,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-1044203509059414774
|
-7457695875708626926
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn off microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
+FirefoxViewTools WindowSupport Daily ⢠nowâ˘$18FileEditHistoryBookmarksProfilesHelpâCmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)FleEdit# Proje0 Atter( SchelŠ Cursc* Ciauc|⢠Cost ⏠app.o Allow PipelL UY-2Z LJY-2Z UJY-28⢠Mon 18 May 15:00WUY-2httos:/minny.atiassian.net/browse/fY-20912⢠JminnyD ProjectsE3 SSH⢠Home| Salestorce @ O 88 [I ElDatadog @ $ Ciaude CircieciA Sentry8 Tasks7 Insights & Coachin. Dev D UXC Al Bookmarkood8 JMINNYSearch+ CreateAsk RovoÂŽ For youŠ Recent# Starred8. Apps( Spaces|Starred(9) Service-Desk|Jiminny (Old)Spaces/Jminey NNew) / && Add parent/A Jy-20912Fallback mechanism for users with active SF tokens for CRM MatchingDetailsstory point esumateDescription|We identified an issue for Tourlane where Twillo calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM object|matching fails because the system relies only on the admin's Salesforce token.We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use il for CRM matching.Story PointsNoneOrganisationsNoneJiminny (New)I (ID Platform TeamPriority= MediumIID Enterprise Stability L...Acceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Fix versionsNoneI SE Kanban= More spaces= Filters(B DashboardsOperationsSprintPlatform Sprint 5 Q2SubtasksAod suotaskDaysNonelLinked work itemsNeed QAYes3 Confiuence: TeamsActivityCanny LinksOpen Canny Links%; Customise sidebarCommentsWork logAdd a comment.More fieldsSuggest a replyâŚWho is working on this.?Status updateâŚ..Pro tip: press (M to corParentNone3:09 PM | [Platform] Refinement ÂŽ:100% <478⢠Mon 18 May 15:09:365Nikolay YankolAneliya AngelovaNikolay IvanovLukas Kovalik...
|
53478
|
NULL
|
NULL
|
NULL
|
|
53480
|
1872
|
71
|
2026-05-18T12:09:39.554531+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106179554_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn off microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options
Leave call
Meeting details
Chat with everyone
Meeting tools
Your microphone is on....
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"3:09","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.022916667,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07673611,"top":0.9444444,"width":0.016666668,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"[Platform] Refinement đ","depth":12,"bounds":{"left":0.11076389,"top":0.9111111,"width":0.12881945,"height":0.08888888},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"[Platform] Refinement đ","depth":15,"bounds":{"left":0.11076389,"top":0.9438889,"width":0.12881945,"height":0.023333333},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Audio settings","depth":13,"bounds":{"left":0.32118055,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off microphone","depth":13,"bounds":{"left":0.34895834,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":true,"is_selected":false},{"role":"AXButton","text":"Video settings","depth":13,"bounds":{"left":0.38784721,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off camera","depth":13,"bounds":{"left":0.415625,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Nikolay Yankov is presenting","depth":12,"bounds":{"left":0.45451388,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Send a reaction","depth":12,"bounds":{"left":0.49895832,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on captions","depth":13,"bounds":{"left":0.5434028,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Raise hand (ctrl + â + h)","depth":12,"bounds":{"left":0.58784723,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options","depth":12,"bounds":{"left":0.6322917,"top":0.9288889,"width":0.025,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Leave call","depth":12,"bounds":{"left":0.6628472,"top":0.9288889,"width":0.05,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Meeting details","depth":12,"bounds":{"left":0.89166665,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Chat with everyone","depth":12,"bounds":{"left":0.925,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Meeting tools","depth":12,"bounds":{"left":0.9583333,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Your microphone is on.","depth":8,"on_screen":false,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
4418058558376710289
|
-7435249070949934318
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn off microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options
Leave call
Meeting details
Chat with everyone
Meeting tools
Your microphone is on.
+FirefoxViewTools WindowSupport Daily ⢠nowâ˘$18FileEditHistoryBookmarksProfilesHelpâCmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)EditTabM Inbo# Proje( AtterC Schel⢠Cursc* Ciauc|⢠Cost app.o C Allow | PipelŠ JimirL Y-2Z LUY-27 [JY-28⢠Mon 18 May 15:00Z (JY-2httts://mnny.atiassian.net/browse/fy-20912⢠JminnyD ProjectsE3 SSH⢠Home| Salesforce @ O 88 [I ElDatadoo O @ # Ciaude CircleciA Sentry0 Tasks7 Insights & Coachin. C Dev D UX0 Al Bookmarkood8 JMINNYSearch+ CreateAsk RovoÂŽ For youŠ Recent# Starred8. AppsQ Spaces|Starred(9) Service-DeskJiminny (Old)Spaces/Iminay ONew) / && Add parent/A Jy-20912Fallback mechanism for users with active SF tokens for CRM MatchingDetailsstory point esumate⢠Description|We identified an issue for Tourlane where Twillo calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM object |matching fails because the system relies only on the admin's Salesforce token.We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use il for CRM matching.Story PointsNoneOrganisationsNoneJiminny (New)I (D Platform TeamPriority= MediumIID Enterprise Stability L...Acceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Callis should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Foc versionsNone(ID SE Kanban= More spaces= Filters(B DashboardsOperationsSprintPlatform Sprint 5 Q2SubtasksAdd suotaskDaysworeLinked work itemsNeed QAYesx Confiuencei: TeamsActivityCanny LinksOpen Canny Links% Customise sidebarHiskoryWork logAdd a comment.More fieldsSuggest a reply.âŚWho is working on this...?Status updateâŚParentNoneYro up: press M to con100% C8⢠Mon 18 May 15:09:395Nikolay YankoAneliya AngelovaNikolay IvanovLukas Kovalik3:09 PM | [Platform] Refinement ÂŽ...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53481
|
1872
|
72
|
2026-05-18T12:09:42.562432+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106182562_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
Mute Nikolay Ivanov's microphone
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn off microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options
Leave call
Meeting details
Chat with everyone
Meeting tools
Your microphone is on....
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Ivanov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"3:09","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.022916667,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07673611,"top":0.9444444,"width":0.016666668,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"[Platform] Refinement đ","depth":12,"bounds":{"left":0.11076389,"top":0.9111111,"width":0.12881945,"height":0.08888888},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"[Platform] Refinement đ","depth":15,"bounds":{"left":0.11076389,"top":0.9438889,"width":0.12881945,"height":0.023333333},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Audio settings","depth":13,"bounds":{"left":0.32118055,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off microphone","depth":13,"bounds":{"left":0.34895834,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":true,"is_selected":false},{"role":"AXButton","text":"Video settings","depth":13,"bounds":{"left":0.38784721,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off camera","depth":13,"bounds":{"left":0.415625,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Nikolay Yankov is presenting","depth":12,"bounds":{"left":0.45451388,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Send a reaction","depth":12,"bounds":{"left":0.49895832,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn on captions","depth":13,"bounds":{"left":0.5434028,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Raise hand (ctrl + â + h)","depth":12,"bounds":{"left":0.58784723,"top":0.9288889,"width":0.03888889,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options","depth":12,"bounds":{"left":0.6322917,"top":0.9288889,"width":0.025,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Leave call","depth":12,"bounds":{"left":0.6628472,"top":0.9288889,"width":0.05,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Meeting details","depth":12,"bounds":{"left":0.89166665,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Chat with everyone","depth":12,"bounds":{"left":0.925,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Meeting tools","depth":12,"bounds":{"left":0.9583333,"top":0.9288889,"width":0.033333335,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Your microphone is on.","depth":8,"on_screen":false,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
-1553175773094991316
|
-7435249062594618608
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
Mute Nikolay Ivanov's microphone
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn off microphone
Video settings
Turn off camera
Nikolay Yankov is presenting
Send a reaction
Turn on captions
Raise hand (ctrl + â + h)
More options
Leave call
Meeting details
Chat with everyone
Meeting tools
Your microphone is on.
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelpSupport Daily ⢠nowâmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)EditM Inba8 JiMINY100% C8⢠Mon 18 May 15:09:4220 5â˘$ÂŽ For youŠ Recent |# Starred8. AppsQ SpacesStarredS) Service-DeskJiminny (Old)Jiminny (New)I CD Platform TeamIID Enterprise Stability L...(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence: Teams% Customise sidebartonetTab# Proje( AtterC SchelŠ Cursc* Ciauc|⢠Cost app.c C Allow | Pipel8Jimil⢠JminnyProjects |E3 SSH⢠Homel Salestorce O O 88 L El Datadog # Clrude O CircleciA SentrySearchSpaces/Iminay ONew) / && Add parent/A Jy-20912Fallback mechanism for users with active SF tokens for CRM MatchingDescriptionWe identified an issue for Tourlane where Twilio calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM object |matching fails because the system relies only on the admin's Salesforce token.We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use i for CRM matching.Acceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.SubtasksAdd suotaskLinked work itemsActivityCommentsHiskoryWork logAdd a comment.Suggest a reply.âŚWho is working on this...?Status updateâŚ.Yro up: press M to conKKJY-1 UY-2Z LJY-27 [JY-28⢠Mon 18 May 15:00Z (JY-20 Tasks7 Insights & Coachin. C Dev C UXDD Al Bookmarka+ CreateAsk RovoDetailsstory point esummateStory PointsNoneOrganisationsNonePriority= MediumFix versionsNoneSprintPlatform Sprint 5 Q2DaysNoneNeed QAYesCanny LinksOpen Canny LinksMore fieldsParentNoneNikolay Yanko)Aneliya AngelovaNikolay IvanovLukas Kovalik3:09 PM | [Platform] Refinement ÂŽ..â˘...
|
53480
|
NULL
|
NULL
|
NULL
|
|
53482
|
1873
|
26
|
2026-05-18T12:09:48.284241+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106188284_m2.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
Mute Nikolay Ivanov's microphone
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn off microphone
Video settings...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.016123671,"height":-0.051875472},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.27094415,"top":1.0,"width":0.004986702,"height":-0.051875472},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.27310506,"top":1.0,"width":0.010638298,"height":-0.086193085},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.30634972,"top":1.0,"width":0.059507977,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.30634972,"top":1.0,"width":0.059507977,"height":-0.07342374},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.69481385,"top":1.0,"width":0.019614361,"height":-0.06424582},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.7081117,"top":1.0,"width":0.0023271276,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.71708775,"top":1.0,"width":0.011968086,"height":-0.06424582},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.7184175,"top":1.0,"width":0.043550532,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.7330452,"top":1.0,"width":0.013464096,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.73204786,"top":1.0,"width":0.011303191,"height":-0.065043926},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Ivanov's microphone","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"3:09","depth":12,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"[Platform] Refinement đ","depth":12,"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"[Platform] Refinement đ","depth":15,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Audio settings","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Turn off microphone","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":true,"is_selected":false},{"role":"AXButton","text":"Video settings","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-237734193056961897
|
-2846185770820249326
|
idle
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
Mute Nikolay Ivanov's microphone
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:09
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
Turn off microphone
Video settings
PhostormVIewINavicatecodeLaravelKeŃactolFV faVsco.js°9 master kProledeyCActivityController.ongC BaseService.onpŠ SoftPhoneManager.php(c) Constants.one(C) CoreUserRequest.onpŠ ScimProvisioning.php x Š CoreUser.php⢠Scimintertace.ongD Seedern lictonorDoloCannotllavo AdminOriarW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio⢠M Conference⢠ConferenceHandlerC) SoftPhoneManader.ohdŠ ConferenceCallbackHandler.phpŠ ConferenceManager.phpIMnTOTM EventD ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onpŠ TwilioRepository.php0 Uploader0 UrlGeneratora Utility0 Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsM Activities>M Analvticc⢠Calendarsv MCrmM Huhsnotclass ScimProvisioningprivate function assignRolesFromScim(Usen Susen, ConeUsenRequest Sdto, Tean Steam): voidroles' => Sroleldsi."roles' =>'array'main: 1'0new DependentRolesPule(SvisibleRoles)lnew ListenerRoleCannotHaveAdmin0rManagerPermissionRule(SvisibleRoles),'roles.*' => [anstinet""an.⢠SvisibleRoles->pluck( value: 'id')->implode( value: ',').now lictononPoloPonuinoclictonenSostunePule/ctoam)lif (Svalidator->fails0) {return:sroles = "viszoleroles->wheren key: "1d', Srolelds):Sdto = new UserRolesSvncoT0roles: Sroles.public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): GroIntegrationApp⢠M TraitsC) Addl avoutEntities.nhnŠ AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountle RullbornCommand Ahctraat nhn(e) RullbornDinaCommand nhn=laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]# console [euyA console [STAGING] X554555556557558'_563566-567568569570v Tx: AutovGo jiminny_jupiterwhere crm_configuration_id = 1 and pl.playbook_id = 175:BlS BIS XUAselect * from teamsSELECT r.* FROM automated_reports rjoin teams t on r.team id = t.idhckE r.trequency = "dallyAND t.status = 'active'AND (r.expires.at >= now() OR r.expires.at IS NULL);1 automated_report_results where report 1d IN (18, 339select * from users where team_id = 1 and id = 1047;SELE * FROMIsochal accounts WHERE soctable 10 = 10471select * from activity_searches where id = 10932:select * from activity_search_filters where activity_search_id = 10932;select * fromautomated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_reports where id IN (55);select * from automated_report_results where id IN (81);select * from users where id IN (10633, 13987, 11985);select * from users where group_id IN (3710):SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuidSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuidselect * from teams;select * from accounts where team_id = 1:select * trom automated report results where media type = "pdt' and status = 2SFLECT * FROM automated report results WHERE uuid_ to_ bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid)select * from teams where id = 1029;select * fromcrm_configurations where provider = 'pipedrive':SELECTCONCAT(u,id. CASE WHEN u.id = t.owner id THEN ⢠(owner)' ELSE â˘â˘ END) AS user idisa.*t.owner id FROM social accounts saJJouN users u on u.id = sa.sociable idi1.n<->1: on +.id = u.team idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idl. "23460 ownen)""idi. ko⢠Пon 10 May 10.09.41AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token FalliSCIM Role Manageme+0 ..inp on LineWARN Metadata found iin doc-comment for method9/ 10 tacke doneWrite unit tests for SCIM role management10) Contact Mario to vodate customer10 / 10 tasks doneselm role managementtor leamtallor has been successtully implemented. Here's what was completed:Implementation Summary:1. CoreUserRequest DTO - Added role parsina from SCIM requests2. SCIM Constants - Added META ROLES and USER_PATCH_ ATTR_ ROLES constants3. RoleAttr Mutator - Created mutator for handlina role assianments via SCIM PATCH operations4. ScimProvisioning - Updated to handle roles during user creation with proper validation5. ListenerRoleCannotHaveAdminOrManagerPermissionRule - Created validation rule to prevent listener role fromhaving admin/manager permissions6. CoreUser Response - Updated to include roles in SClM responses7. Unit Tests - Created comprehensive tests for the validation ruleKey Features:⢠Customers can now assign roles via SCIM (recorder, recorder & voice, analyst, listener, admin, manager)⢠Validation ensures listener role is onlv assianable if the LISTENER ROLE feature flaa is enabledâ˘LIstener role cannot de comolned with aamin or manager permissions⢠Uses existing UpdateUserRolesAction for role syncing and logging⢠Follows platform validation rules (DependentRolesRule, ListenerRoleRequiresListenerFeatureRule)Next Step: Please contact Mario to update the customer that SCIM role management is now available for Teamtailorintearationposwtn chaten vapp/Component/SClM/ Constants.php +3app/Component/SCIM/ ÂŽ ScimProvisioning.php +85-15nse/ CoreUser.php +21ann/Comnonent/SCIM/Mutatore/Attributes/Ueer/M PoleAttr.nhn +17-ites/Userl áş RoleAttrTest.ohn +224* Reiect alliiAccent alliAsk anvthina 884-L)ÂŤ Code SWF-1.60 01W Windsurf Teams 1:1 UTF-8fo 4 spaces...
|
53475
|
NULL
|
NULL
|
NULL
|
|
53483
|
1872
|
73
|
2026-05-18T12:10:13.488090+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106213488_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video....
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
2490078026332844675
|
-7457836617491949038
|
idle
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelp# Support Daily ⢠5 m leftâCmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)einhomtEditTabâ˘$18tonetM Inbo# Proje( AtterC SchelŠ Cursc* Ciauc|⢠Cost app.c | C Allow | Pipel8JiriKEJY-C UY-2Z LUY-27 [JY-28⢠Mon 18 May 15:10Z UUY-2⢠Jminny0 Projects |E3 SSH⢠Home| Salestorce @ O 88 [I ElDatadoo O @ # Ciaude O CircleciA Sentry0 Tasks7 Insights & Coachin. C Dev D UXDD All Bookmarka8 JiMINNYSearch+ CreateAsk RovoÂŽ For youRecent|# Starred8. AppsQ SpacesStarredS) Service-DeskJiminny (Old)Spaces/Iminay ONew) / && Add parent/A Jy-20912Fallback mechanism for users with active SF tokens for CRM MatchingDetailsstory point esumateDescriptionWe identified an issue for Tourlane where Twilio calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM object|matching fails because the system relies only on the admin's Salesforce token.We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use i for CRM matching.Story PointsNoneOrganisationsNoneJiminny (New)ICID Platform TeamPriority= MediumIID Enterprise Stability L...110 Processina TeamiAcceptance Criteria:⢠Il the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Fix versionsNone(ID SE Kanban= More spaces= Filters(B DashboardsOperationsSprintPlatform Sprint 5 Q2Subtasks*Add suotaskDayswonelLinked work itemsNeed QAYesx Confiuence:: TeamsActivityCanny LinksOpen Canny Links% Customise sidebarCommentsHiskoryWork logAdd a comment.More fieldsSuggest a replyâŚWho is working on this.?Status updateâŚ.ParentNoneYro Lp: press M to con3:10 PM | [Platform] Refinement ÂŽ..â˘..â˘100% C8⢠Mon 18 May 15:10:1220 5Nikolay YankAneliya AngelovaNikolay IvaLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53484
|
NULL
|
0
|
2026-05-18T12:10:13.979070+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106213979_m2.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video....
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.27027926,"top":1.0,"width":0.016123671,"height":-0.051875472},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.27094415,"top":1.0,"width":0.004986702,"height":-0.051875472},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.27310506,"top":1.0,"width":0.010638298,"height":-0.086193085},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.30634972,"top":1.0,"width":0.059507977,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.30634972,"top":1.0,"width":0.059507977,"height":-0.07342374},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.69481385,"top":1.0,"width":0.019614361,"height":-0.06424582},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.7081117,"top":1.0,"width":0.0023271276,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.71708775,"top":1.0,"width":0.011968086,"height":-0.06424582},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.7184175,"top":1.0,"width":0.043550532,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.7330452,"top":1.0,"width":0.013464096,"height":-0.072625756},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.73204786,"top":1.0,"width":0.011303191,"height":-0.065043926},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
2490078026332844675
|
-7457836617491949038
|
click
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
PhostormVIewINavicatecodeLaravelKeŃactolFV faVsco.js°9 master kProledeyCActivityController.ongC BaseService.onpŠ SoftPhoneManager.php(c) Constants.one(C) CoreUserRequest.onpŠ ScimProvisioning.php x Š CoreUser.php⢠Scimintertace.ongD Seedern lictonorDoloCannotllavo AdminOriarW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio⢠M Conference⢠ConferenceHandlerC) SoftPhoneManader.ohd1ConferenceCallbackLandier.nhnlŠ ConferenceManager.phpIMnTOTM EventD ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onpŠ TwilioRepository.php0 Uploader0 UrlGeneratora Utility0 Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsM Activities>M Analvticc⢠Calendarsv MCrmM Huhsnotclass ScimProvisioningprivate function assignRolesFromScim(Usen Susen, ConeUsenRequest Sdto, Tean Steam): voidroles' => Sroleldsi."roles' =>'array'main: 1'0new DependentRolesPule(SvisibleRoles)lnew ListenerRoleCannotHaveAdmin0rManagerPermissionRule(SvisibleRoles),'roles.*' => [anstinet""an.⢠SvisibleRoles->pluck( value: 'id')->implode( value: ',').now lictononPoloPonuinoclictonenSostunePule/ctoam)lif (Svalidator->fails0) {return:sroles = "viszoleroles->wheren key: "1d', Srolelds):Sdto = new UserRolesSvncoT0roles: Sroles.public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): GroIntegrationApp⢠M TraitsC) Addl avoutEntities.nhnŠ AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountle RullbornCommand Ahctraat nhn(e) RullbornDinaCommand nhn=laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]& console [EU]A console [STAGING] X554555556557558'_563566-567568569570v Tx: AutovGo jiminny_jupiterwhere crm_configuration_id = 1 and pl.playbook_id = 175:019 A19 V17 ^ Vselect * from teamsSELECT r.* FROM automated_reports rjoin teams t on r.team id = t.idhckE r.trequency = "dallyAND t.status = 'active'AND (r.expires.at >= now() OR r.expires.at IS NULL);1 automated_report_results where report 1d IN (18, 339select * from users where team_id = 1 and id = 1047;SELE * FROMIsochal accounts WHERE soctable 10 = 10471select * from activity_searches where id = 10932:select * from activity_search_filters where activity_search_id = 10932;select * fromautomated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_reports where id IN (55);select * from automated_report_results where id IN (81);select * from users where id IN (10633, 13987, 11985);select * from users where group_id IN (3710):SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuidSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuidselect * from teams;select * from accounts where team_id = 1:select * trom automated report results where media type = "pdt' and status = 2SFLECT * FROM automated report results WHERE uuid_ to_ bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid)select * from teams where id = 1029;select * fromcrm_configurations where provider = 'pipedrive':SELECTCONCAT(u,id. CASE WHEN u.id = t.owner id THEN ⢠(owner)' ELSE â˘â˘ END) AS user idisa.*t.owner id FROM social accounts saJJouN users u on u.id = sa.sociable idi1.n<->1: on +.id = u.team idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idl. "23460 ownen)""idi. ko⢠Пon 10 May 10.10.19AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token FalliSCIM Role Manageme+0 ..inp on LineWARN Metadata found iin doc-comment for method9/ 10 tacke doneWrite unit tests for SCIM role management10) Contact Mario to vodate customer10 / 10 tasks doneselm role managementtor leamtallor has been successtully implemented. Here's what was completed:Implementation Summary:1. CoreUserRequest DTO - Added role parsina from SCIM requests2. SCIM Constants - Added META ROLES and USER_PATCH_ ATTR_ ROLES constants3. RoleAttr Mutator - Created mutator for handlina role assianments via SCIM PATCH operations4. ScimProvisioning - Updated to handle roles during user creation with proper validation5. ListenerRoleCannotHaveAdminOrManagerPermissionRule - Created validation rule to prevent listener role fromhaving admin/manager permissions6. CoreUser Response - Updated to include roles in SClM responses7. Unit Tests - Created comprehensive tests for the validation ruleKey Features:⢠Customers can now assign roles via SCIM (recorder, recorder & voice, analyst, listener, admin, manager)⢠Validation ensures listener role is onlv assianable if the LISTENER ROLE feature flaa is enabledâ˘LIstener role cannot de comolned with aamin or manager permissions⢠Uses existing UpdateUserRolesAction for role syncing and logging⢠Follows platform validation rules (DependentRolesRule, ListenerRoleRequiresListenerFeatureRule)Next Step: Please contact Mario to update the customer that SCIM role management is now available for Teamtailorintearationposwtn chaten vapp/Component/SClM/ Constants.php +3app/Component/SCIM/ ÂŽ ScimProvisioning.php +85-15nse/ CoreUser.php +21ann/Comnonent/SCIM/Mutatore/Attributes/Ueer/M PoleAttr.nhn +17-ites/Userl áş RoleAttrTest.ohn +224* Reiect alliiAccent alliAsk anvthina 884-L)ÂŤ Code SWF-1.60 01W Windsurf Teams 1:1 UTF-8fo 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53485
|
NULL
|
0
|
2026-05-18T12:10:15.869882+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106215869_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Aneliya Angelova's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
4417380801178660783
|
-7437570419437085421
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
Mute Aneliya Angelova's microphone
More options for Aneliya Angelova
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelp# Support Daily ⢠5 m leftâmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)etomtEdit8 JiMINNY100% C8⢠Mon 18 May 15:10:1520 5â˘$18* For youŠ Recent |# Starred8. AppsQ Spaces|StarredS) Service-DeskJiminny (Old)Jiminny (New)I CID Platform TeamIID Enterprise Stablity L...111 Processina Team(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams%; Customise sidebartonetTab# Proje( AtterSchelŠ Cursc* Ciauc|⢠Cost5app.oAlowoPiot⢠Jmin|C UY-27 LJY-27 [JY-28⢠Mon 18 May 15:10Z UUY-2⢠Jminny0 Projects |E3 SSH⢠Home| Salesforce ⢠O 8 [ Ee Datadog * Claude3 CircleciA Sentry0 Tasks7 Insights & Coachin.0 DevDD All BookmarkaSearch+ CreateAsk Rovo(@, Addparent / JY-20912DescriptionWe identified an issue for Tourlane where Twillo calls appear as "Unknown Customer" when the Salesforce admin connection token has expired. In this case, CRM objectmatching fails because the system relies only on the admin's Salesforce token.Detailsstory point esumateWe should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use iR for CRM matchingStory PointsNoneOrganisationsNone⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.PrioritySubtasksFix versionsNoneno0a5KSprintPlatform Sprint 5 Q2Linked work itemshoo lnked work kerDaysNonehcuvityHistoryWork logNeed QAYesAdd a comment.Canny LinksOpen Canny LinksSuggest a reply..Who is working on thisâŚ..?Status update..Pro tip: press M toclMore fieldsNikolay Yankov18 May 2026 at 13:081ParentNoneNikolay YankAneliya AngelovaNikolay IvaLukas Kovalik3:10 PM | [Platform] Refinement ÂŽ...
|
53483
|
NULL
|
NULL
|
NULL
|
|
53486
|
1874
|
0
|
2026-05-18T12:10:18.915590+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106218915_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
You can't unmute someone else
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video....
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false}]...
|
6772014133629545213
|
-7457836480052864494
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
You can't unmute someone else
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
FirefoxFileViewTools Window# Support Daily ⢠5 m leftEditâHistoryCBookmarksProfilesHelpmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)100% C8⢠Mon 18 May 15:10:1820 5+FleEditViewBookmarksProfilesTab7 PŃŃF Proje* AteSchelŠ cursi Clau Š Cois5 appuC Alon 3 PipeŠ Jmmlhttps:/fiminny.atlassian.net/browse/JY-20912⢠Sminny⢠Home|Salesforce 0 O 8 E El Datadog Clude O CirclCIa ĐťwYÂŽ. For youŠ Recent# Starred8. AppsQ SpacesStarredY) Service-DeskJiminny (Old)Jiminny (New)I WD Platform Teamwtote(ID Enterprise Stabilty L..181 Processing Teammi(D) SE Kanban= More spacesE Filters(B DashboardsOperationsConfluence?: Teams$, Customise sidebar( ProjectsE3 SSHSentrySearch(e, Addpareet / ( Jy-20912⢠UŃ UU mвŃg ŃикгО СUŃокаŃĐ¸ĐşŃ ŃŃĐşĐ¸Ń Đ¸ŃĐľ ŃонавŃŃ ĐşŃкоŃ⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.SublasksAdd subtaskLinked work itemsAdd linked work itemActivityHISNOYwork locAdd a commentSuggest a reptyWho is working on this...?Status update...Pro tip: press M. to colNikolay YankovNormal textI ⢠A-BE: 1 dayQA: 0.5 day|Cancel3 1Y-2 IJY-8: Mon 18 May 16:10a UY-0 Tasks|7 Insights & Coachin. DevDJ Al Bockonarka+ CreateAsk RovoNikolay YankDetailssrory point esumaseNoneStory PointsNoneOrganisationsNonePriority= MediumFix versionsNoneSprintPlatform Sprint 5 Q2DaysNoneNeed QAYesCanny LinksOpen Canny LinksMore fieldsParentNonelAneliya AngelovaNikolay IvaLukas Kovalik3:10 PM | [Platform] Refinement ÂŽ...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53487
|
1874
|
1
|
2026-05-18T12:10:21.976392+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106221976_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
You can't unmute someone else
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:10
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Meet - [Platform] Refinement đ","depth":4,"bounds":{"left":0.0,"top":0.072222225,"width":0.033680554,"height":0.045555554},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":true},{"role":"AXButton","text":"Close tab","depth":5,"bounds":{"left":0.0013888889,"top":0.072222225,"width":0.010416667,"height":0.016666668},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"New Tab","depth":4,"bounds":{"left":0.005902778,"top":0.12,"width":0.022222223,"height":0.035555556},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open Google Gemini (âX)","depth":6,"bounds":{"left":0.0,"top":0.7977778,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Tabs from other devices","depth":6,"bounds":{"left":0.0,"top":0.8411111,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open history (â§âH)","depth":6,"bounds":{"left":0.0,"top":0.8794444,"width":0.033680554,"height":0.03888889},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Open bookmarks (âB)","depth":6,"bounds":{"left":0.0,"top":0.91833335,"width":0.033680554,"height":0.038333334},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXCheckBox","text":"Customize sidebar","depth":6,"bounds":{"left":0.0,"top":0.95666665,"width":0.033680554,"height":0.043333333},"on_screen":true,"help_text":"","role_description":"toggle button","subrole":"AXToggle","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXHeading","text":"Nikolay Yankov (Presenting)","depth":12,"bounds":{"left":0.07534722,"top":0.101111114,"width":0.124305554,"height":0.022222223},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Nikolay Yankov (Presenting)","depth":13,"bounds":{"left":0.07534722,"top":0.10222222,"width":0.124305554,"height":0.020555556},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"People","depth":15,"bounds":{"left":0.88680553,"top":0.08944444,"width":0.04097222,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"5","depth":22,"bounds":{"left":0.9145833,"top":0.101111114,"width":0.0048611113,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Take notes with Gemini","depth":14,"bounds":{"left":0.93333334,"top":0.08944444,"width":0.025,"height":0.04},"on_screen":true,"role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Take notes with Gemini","depth":17,"bounds":{"left":0.9361111,"top":0.101111114,"width":0.06388891,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"Gemini","depth":17,"bounds":{"left":0.96666664,"top":0.101111114,"width":0.028125,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Gemini","depth":17,"bounds":{"left":0.96458334,"top":0.090555556,"width":0.023611112,"height":0.037777778},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Unpin Nikolay Yankov's presentation from your main screen","depth":13,"bounds":{"left":0.36840278,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else's presentation","depth":13,"bounds":{"left":0.39618057,"top":0.50666666,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.42673612,"top":0.5088889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Zoom in","depth":13,"bounds":{"left":0.6753472,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Open in new window","depth":13,"bounds":{"left":0.70868057,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Enter Full Screen","depth":13,"bounds":{"left":0.7420139,"top":0.80333334,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Pin Nikolay Yankov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"Mute Nikolay Yankov's microphone","depth":13,"bounds":{"left":0.87395835,"top":0.21666667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Yankov","depth":13,"bounds":{"left":0.9045139,"top":0.2188889,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Yankov","depth":17,"bounds":{"left":0.79618055,"top":0.30555555,"width":0.058680557,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Aneliya Angelova to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.41,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Aneliya Angelova","depth":13,"bounds":{"left":0.9045139,"top":0.41222224,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Aneliya Angelova","depth":17,"bounds":{"left":0.79618055,"top":0.49888888,"width":0.06736111,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Pin Nikolay Ivanov to your main screen","depth":13,"bounds":{"left":0.84618056,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"You can't unmute someone else","depth":13,"bounds":{"left":0.87395835,"top":0.60333335,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Nikolay Ivanov","depth":13,"bounds":{"left":0.9045139,"top":0.60555553,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Nikolay Ivanov","depth":17,"bounds":{"left":0.79618055,"top":0.69222224,"width":0.05659722,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Youâre continuously framed","depth":13,"bounds":{"left":0.84479165,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":false,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"Backgrounds and effects","depth":13,"bounds":{"left":0.8753472,"top":0.7966667,"width":0.030555556,"height":0.04888889},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXButton","text":"More options for Lukas Kovalik","depth":13,"bounds":{"left":0.9059028,"top":0.79888886,"width":0.027777778,"height":0.044444446},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXStaticText","text":"Lukas Kovalik","depth":17,"bounds":{"left":0.79618055,"top":0.88555557,"width":0.052430555,"height":0.017222222},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Others might see more of your background. Click to view your full video.","depth":14,"bounds":{"left":0.96979165,"top":0.88055557,"width":0.016666668,"height":0.026666667},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"3:10","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.021527778,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07534722,"top":0.9444444,"width":0.016666668,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXHeading","text":"[Platform] Refinement đ","depth":12,"bounds":{"left":0.109375,"top":0.9111111,"width":0.12881945,"height":0.08888888},"on_screen":true,"help_text":"","role_description":"heading","subrole":"AXUnknown"},{"role":"AXStaticText","text":"[Platform] Refinement đ","depth":15,"bounds":{"left":0.109375,"top":0.9438889,"width":0.12881945,"height":0.023333333},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXButton","text":"Audio settings","depth":13,"bounds":{"left":0.32118055,"top":0.9288889,"width":0.06111111,"height":0.053333335},"on_screen":true,"help_text":"","role_description":"button","subrole":"AXUnknown","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
2070149893860192793
|
-7455443663578080750
|
visual_change
|
hybrid
|
NULL
|
Meet - [Platform] Refinement đ
Close tab
New Tab
O Meet - [Platform] Refinement đ
Close tab
New Tab
Open Google Gemini (âX)
Tabs from other devices
Open history (â§âH)
Open bookmarks (âB)
Customize sidebar
Nikolay Yankov (Presenting)
Nikolay Yankov (Presenting)
People
5
Take notes with Gemini
Take notes with Gemini
Gemini
Gemini
Unpin Nikolay Yankov's presentation from your main screen
You can't unmute someone else's presentation
More options for Nikolay Yankov
Zoom in
Open in new window
Enter Full Screen
Pin Nikolay Yankov to your main screen
Mute Nikolay Yankov's microphone
More options for Nikolay Yankov
Nikolay Yankov
Pin Aneliya Angelova to your main screen
You can't unmute someone else
More options for Aneliya Angelova
Aneliya Angelova
Pin Nikolay Ivanov to your main screen
You can't unmute someone else
More options for Nikolay Ivanov
Nikolay Ivanov
Youâre continuously framed
Backgrounds and effects
More options for Lukas Kovalik
Lukas Kovalik
Others might see more of your background. Click to view your full video.
3:10
PM
[Platform] Refinement đ
[Platform] Refinement đ
Audio settings
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelp# Support Daily ⢠5 m leftâCmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)EditTabWedow# ProjeAttenSche⢠Curs* Ciauc⢠Cos app.o C Allov PipeŠ JimirZ UY-3 LUY-2X [JY-28⢠Mon 18 May 16:10A [JY-2httos//minny.stiassian.net/browse/JY-20912⢠Jminny⢠ProjectsE3 SSH⢠Home | Salestorce M O 88 R El Datadog * Caruse3 CircieclA Sentry0 Tasks|Insights & Coachin⌠Dev0J Al Bookmarks8 JMINNYSearch+ CreateAsk RovoÂŽ. For youŠ Recent# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Oid)[l, Add parent./A Jy-20912Salesforce token from any user within the same organisation and use it for CRM matching.Detailsstory point esumateAcceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Joory roksNoneSubtasksOrganisationsNoneJiminny (New)I (D Platform TeamPriorityâ˘$Linked work itemsFix versionsNone(D Enterprise Stability L..181 Processing TeamActivity(ID SE Kanban= More spaces= Filters(B DashboardsOperationsWork logSprintPlatform Sprint 5 Q2Days &hoo a comment1.5Suggest a reply..Who is working on thisâŚ..?Status update...Need QAYesx Confluence2: TeamsPro tio: press M to co18Canny LinksOpen Canny Links% Customise sidebarNikoly ŃапкОv18 May 2026 at 13.08BE: 1 dayQA: 0.5 day⢠More fields0 ..ParentNone100% <*8⢠Mon 18 May 15:10:2120 5Nikolay YankAneliya AngelovaNikolay IvaLukas Kovalik3:10 PM | [Platform] Refinement ÂŽ...
|
53486
|
NULL
|
NULL
|
NULL
|
|
53489
|
1875
|
0
|
2026-05-18T12:10:41.006203+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106241006_m2.jpg...
|
iTerm2
|
NULL
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhostormVIewINavicatecodeLaravelKeŃactolFV faVsco. PhostormVIewINavicatecodeLaravelKeŃactolFV faVsco.js°9 master kProledeyCActivityController.ongC BaseService.onpŠ SoftPhoneManager.php(c) Constants.one(C) CoreUserRequest.onpŠ ScimProvisioning.php x Š CoreUser.php⢠Scimintertace.ongD Seedern lictonorDoloCannotllavo AdminOriarW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio⢠M Conference⢠ConferenceHandlerC) SoftPhoneManader.ohd1ConferenceCallbackLandier.nhnlŠ ConferenceManager.phpIMnTOTM EventD ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onpŠ TwilioRepository.php0 Uploader0 UrlGeneratora Utility0 Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsM Activities>M Analvticc⢠Calendarsv MCrmM Huhsnotclass ScimProvisioningprivate function assignRolesFromScim(Usen Susen, ConeUsenRequest Sdto, Tean Steam): voidroles' => Sroleldsi."roles' =>'array'main: 1'0new DependentRolesPule(SvisibleRoles)lnew ListenerRoleCannotHaveAdmin0rManagerPermissionRule(SvisibleRoles),'roles.*' => [anstinet""an.⢠SvisibleRoles->pluck( value: 'id')->implode( value: ',').now lictononPoloPonuinoclictonenSostunePule/ctoam)lif (Svalidator->fails0) {return:sroles = "viszoleroles->wheren key: "1d', Srolelds):Sdto = new UserRolesSvncoT0roles: Sroles.public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): GroIntegrationApp⢠M TraitsC) Addl avoutEntities.nhnŠ AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountle RullbornCommand Ahctraat nhn(e) RullbornDinaCommand nhn=laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]# console [euyA console [STAGING] X554555556557558'_563566-567568569570v Tx: AutovGo jiminny_jupiterwhere crm_configuration_id = 1 and pl.playbook_id = 175:BlS BIS XUAselect * from teamsSELECT r.* FROM automated_reports rjoin teams t on r.team id = t.idhckE r.trequency = "dallyAND t.status = 'active'AND (r.expires.at >= now() OR r.expires.at IS NULL);1 automated_report_results where report 1d IN (18, 339select * from users where team_id = 1 and id = 1047;SELE * FROMIsochal accounts WHERE soctable 10 = 10471select * from activity_searches where id = 10932:select * from activity_search_filters where activity_search_id = 10932;select * fromautomated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_reports where id IN (55);select * from automated_report_results where id IN (81);select * from users where id IN (10633, 13987, 11985);select * from users where group_id IN (3710):SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuidSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuidselect * from teams;select * from accounts where team_id = 1:select * trom automated report results where media type = "pdt' and status = 2SFLECT * FROM automated report results WHERE uuid_ to_ bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid)select * from teams where id = 1029;select * fromcrm_configurations where provider = 'pipedrive':SELECTCONCAT(u,id. CASE WHEN u.id = t.owner id THEN ⢠(owner)' ELSE â˘â˘ END) AS user idisa.*t.owner id FROM social accounts saJJouN users u on u.id = sa.sociable idi1.n<->1: on +.id = u.team idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idl. "23460 ownen)""idi. ko⢠Пon 10 May 10.10.40AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token FalliSCIM Role Manageme+0 ..inp on LineWARN Metadata found iin doc-comment for method9/ 10 tacke doneWrite unit tests for SCIM role management10) Contact Mario to vodate customer10 / 10 tasks doneselm role managementtor leamtallor has been successtully implemented. Here's what was completed:Implementation Summary:1. CoreUserRequest DTO - Added role parsina from SCIM requests2. SCIM Constants - Added META ROLES and USER_PATCH_ ATTR_ ROLES constants3. RoleAttr Mutator - Created mutator for handlina role assianments via SCIM PATCH operations4. ScimProvisioning - Updated to handle roles during user creation with proper validation5. ListenerRoleCannotHaveAdminOrManagerPermissionRule - Created validation rule to prevent listener role fromhaving admin/manager permissions6. CoreUser Response - Updated to include roles in SClM responses7. Unit Tests - Created comprehensive tests for the validation ruleKey Features:⢠Customers can now assign roles via SCIM (recorder, recorder & voice, analyst, listener, admin, manager)⢠Validation ensures listener role is onlv assianable if the LISTENER ROLE feature flaa is enabledâ˘LIstener role cannot de comolned with aamin or manager permissions⢠Uses existing UpdateUserRolesAction for role syncing and logging⢠Follows platform validation rules (DependentRolesRule, ListenerRoleRequiresListenerFeatureRule)Next Step: Please contact Mario to update the customer that SCIM role management is now available for Teamtailorintearationposwtn chaten vapp/Component/SClM/ Constants.php +3app/Component/SCIM/ ÂŽ ScimProvisioning.php +85-15nse/ CoreUser.php +21ann/Comnonent/SCIM/Mutatore/Attributes/Ueer/M PoleAttr.nhn +17-ites/Userl áş RoleAttrTest.ohn +224* Reiect alliiAccent alliAsk anvthina 884-L)ÂŤ Code SWF-1.60 01W Windsurf Teams 1:1 UTF-8fo 4 spaces...
|
NULL
|
-4856230255953191118
|
NULL
|
click
|
ocr
|
NULL
|
PhostormVIewINavicatecodeLaravelKeŃactolFV faVsco. PhostormVIewINavicatecodeLaravelKeŃactolFV faVsco.js°9 master kProledeyCActivityController.ongC BaseService.onpŠ SoftPhoneManager.php(c) Constants.one(C) CoreUserRequest.onpŠ ScimProvisioning.php x Š CoreUser.php⢠Scimintertace.ongD Seedern lictonorDoloCannotllavo AdminOriarW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio⢠M Conference⢠ConferenceHandlerC) SoftPhoneManader.ohd1ConferenceCallbackLandier.nhnlŠ ConferenceManager.phpIMnTOTM EventD ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onpŠ TwilioRepository.php0 Uploader0 UrlGeneratora Utility0 Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsM Activities>M Analvticc⢠Calendarsv MCrmM Huhsnotclass ScimProvisioningprivate function assignRolesFromScim(Usen Susen, ConeUsenRequest Sdto, Tean Steam): voidroles' => Sroleldsi."roles' =>'array'main: 1'0new DependentRolesPule(SvisibleRoles)lnew ListenerRoleCannotHaveAdmin0rManagerPermissionRule(SvisibleRoles),'roles.*' => [anstinet""an.⢠SvisibleRoles->pluck( value: 'id')->implode( value: ',').now lictononPoloPonuinoclictonenSostunePule/ctoam)lif (Svalidator->fails0) {return:sroles = "viszoleroles->wheren key: "1d', Srolelds):Sdto = new UserRolesSvncoT0roles: Sroles.public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): GroIntegrationApp⢠M TraitsC) Addl avoutEntities.nhnŠ AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountle RullbornCommand Ahctraat nhn(e) RullbornDinaCommand nhn=laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]# console [euyA console [STAGING] X554555556557558'_563566-567568569570v Tx: AutovGo jiminny_jupiterwhere crm_configuration_id = 1 and pl.playbook_id = 175:BlS BIS XUAselect * from teamsSELECT r.* FROM automated_reports rjoin teams t on r.team id = t.idhckE r.trequency = "dallyAND t.status = 'active'AND (r.expires.at >= now() OR r.expires.at IS NULL);1 automated_report_results where report 1d IN (18, 339select * from users where team_id = 1 and id = 1047;SELE * FROMIsochal accounts WHERE soctable 10 = 10471select * from activity_searches where id = 10932:select * from activity_search_filters where activity_search_id = 10932;select * fromautomated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_reports where id IN (55);select * from automated_report_results where id IN (81);select * from users where id IN (10633, 13987, 11985);select * from users where group_id IN (3710):SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuidSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuidselect * from teams;select * from accounts where team_id = 1:select * trom automated report results where media type = "pdt' and status = 2SFLECT * FROM automated report results WHERE uuid_ to_ bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid)select * from teams where id = 1029;select * fromcrm_configurations where provider = 'pipedrive':SELECTCONCAT(u,id. CASE WHEN u.id = t.owner id THEN ⢠(owner)' ELSE â˘â˘ END) AS user idisa.*t.owner id FROM social accounts saJJouN users u on u.id = sa.sociable idi1.n<->1: on +.id = u.team idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idl. "23460 ownen)""idi. ko⢠Пon 10 May 10.10.40AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token FalliSCIM Role Manageme+0 ..inp on LineWARN Metadata found iin doc-comment for method9/ 10 tacke doneWrite unit tests for SCIM role management10) Contact Mario to vodate customer10 / 10 tasks doneselm role managementtor leamtallor has been successtully implemented. Here's what was completed:Implementation Summary:1. CoreUserRequest DTO - Added role parsina from SCIM requests2. SCIM Constants - Added META ROLES and USER_PATCH_ ATTR_ ROLES constants3. RoleAttr Mutator - Created mutator for handlina role assianments via SCIM PATCH operations4. ScimProvisioning - Updated to handle roles during user creation with proper validation5. ListenerRoleCannotHaveAdminOrManagerPermissionRule - Created validation rule to prevent listener role fromhaving admin/manager permissions6. CoreUser Response - Updated to include roles in SClM responses7. Unit Tests - Created comprehensive tests for the validation ruleKey Features:⢠Customers can now assign roles via SCIM (recorder, recorder & voice, analyst, listener, admin, manager)⢠Validation ensures listener role is onlv assianable if the LISTENER ROLE feature flaa is enabledâ˘LIstener role cannot de comolned with aamin or manager permissions⢠Uses existing UpdateUserRolesAction for role syncing and logging⢠Follows platform validation rules (DependentRolesRule, ListenerRoleRequiresListenerFeatureRule)Next Step: Please contact Mario to update the customer that SCIM role management is now available for Teamtailorintearationposwtn chaten vapp/Component/SClM/ Constants.php +3app/Component/SCIM/ ÂŽ ScimProvisioning.php +85-15nse/ CoreUser.php +21ann/Comnonent/SCIM/Mutatore/Attributes/Ueer/M PoleAttr.nhn +17-ites/Userl áş RoleAttrTest.ohn +224* Reiect alliiAccent alliAsk anvthina 884-L)ÂŤ Code SWF-1.60 01W Windsurf Teams 1:1 UTF-8fo 4 spaces...
|
53484
|
NULL
|
NULL
|
NULL
|
|
53488
|
1874
|
2
|
2026-05-18T12:10:41.013612+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106241013_m1.jpg...
|
iTerm2
|
NULL
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
+FirefoxFileEditViewHistoryBookmarksProfilesTools +FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelp# Support Daily ⢠5 m leftâmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)ChromeEditHistorytonetTabWindowM Inbol# Proje( AtterC Schel⢠Cursc* Ciauc|⢠Cost | app.c | C Allow | Pipel⢠JmirKEJY-ZC UY-2Z LJY-27 [JY-28⢠Mon 18 May 15:10Z (JY-2httos:/wminny.atiassian.net/browse/fY-20912l⢠Sminny0 Projects|E3 SSH⢠Home| Salesforce O 8 [ Ee Datadog % Claude3 CircleclA Sentry0 TasksInsights & Coachin⌠DevDJ All Bookmarka8 JiMINNYSearch+ CreateAsk Rovo(@, Addparent / JY-20912ÂŽ For youŠ Recent |# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Acceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Detailsstory point esumateStory PointsNoneAdd subtaskOrganisationsNoneJiminny (New)I CID Platform Teamâ˘$PriorityLinked work items= MediumAdd linked work itemFix versionsIID Enterprise Stability I...111 Processing Team⢠Activity(ID SE Kanban= More spaces= Filters(B DashboardsOperationsSprint|Platform Sprint 5 Q2Add a comment.Suggest a reply.Who is working on this...?Status updateâŚDays1.5Yro tp: press M to comNeed QAYesx Confiuence1: TeamsNikolay Yankov18 May 2026 at 13:08Canny LinksOpen Canny Links% Customise sidebar~ More fieldsBE: 1 dayQA: 0.5 day - Test only Twilio disconnect flowParentonel100% C8⢠Mon 18 May 15:10:4020 5Nikolay YankovAneliya AngelovaNikolay IvanoLukas Kovalik3:10 PM | [Platform] Refinement ÂŽ...
|
NULL
|
-6469607747550983620
|
NULL
|
click
|
ocr
|
NULL
|
+FirefoxFileEditViewHistoryBookmarksProfilesTools +FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelp# Support Daily ⢠5 m leftâmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)ChromeEditHistorytonetTabWindowM Inbol# Proje( AtterC Schel⢠Cursc* Ciauc|⢠Cost | app.c | C Allow | Pipel⢠JmirKEJY-ZC UY-2Z LJY-27 [JY-28⢠Mon 18 May 15:10Z (JY-2httos:/wminny.atiassian.net/browse/fY-20912l⢠Sminny0 Projects|E3 SSH⢠Home| Salesforce O 8 [ Ee Datadog % Claude3 CircleclA Sentry0 TasksInsights & Coachin⌠DevDJ All Bookmarka8 JiMINNYSearch+ CreateAsk Rovo(@, Addparent / JY-20912ÂŽ For youŠ Recent |# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Acceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Detailsstory point esumateStory PointsNoneAdd subtaskOrganisationsNoneJiminny (New)I CID Platform Teamâ˘$PriorityLinked work items= MediumAdd linked work itemFix versionsIID Enterprise Stability I...111 Processing Team⢠Activity(ID SE Kanban= More spaces= Filters(B DashboardsOperationsSprint|Platform Sprint 5 Q2Add a comment.Suggest a reply.Who is working on this...?Status updateâŚDays1.5Yro tp: press M to comNeed QAYesx Confiuence1: TeamsNikolay Yankov18 May 2026 at 13:08Canny LinksOpen Canny Links% Customise sidebar~ More fieldsBE: 1 dayQA: 0.5 day - Test only Twilio disconnect flowParentonel100% C8⢠Mon 18 May 15:10:4020 5Nikolay YankovAneliya AngelovaNikolay IvanoLukas Kovalik3:10 PM | [Platform] Refinement ÂŽ...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53490
|
1874
|
3
|
2026-05-18T12:10:43.192820+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106243192_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
FirefoxFileEditViewHistoryBookmarksProfilesToolsWi FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 5 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com100% <78⢠Mon 18 May 15:10:42+â˘$18Nikolay Yankov (Presenting)EditHistoryTab# Proje( AtterSchel⢠Cursc* Ciauc|⢠Cost5app.oAllowoPiot8JimirZ (JY-2C UY-2Z [JY-27 [JY-28⢠Mon 18 May 15:10Z (JY-2https://fiminny.atlassian.net/browse/JY-20912⢠Sminny⢠Home| Salesforce M O 8 [ E Datadoa * Claude3 Circleci8 JiMINNY* For youŠ Recent |# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Jiminny (New)I CID Platform TeamIID Enterprise Stability I...111 Processing Tearn(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams% Customise sidebar0 Projects|E3 SSHA Sentry0 Tasks7 Insights & CoachinâŚ0 DevDJ All BookmarkaSearch+ CreateAsk RovoCe, Add parent1 A Jy-20912We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use it for CRM matching.Detailsstory point esumateAcceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Story PointsNoneOrganisationsNoneSubtasksAdd subtaskPriority= Medium'Linked work itemsAdd linked work itemFix versionsNone⢠ActivitySprintPlatform Sprint 5 Q2Work logDays1.5Add a comment.Suggest a replyâŚWho is working on this...?Status updateâŚNeed QAYesPto tos cretWoconCanny LinksOpen Canny LinksNikolay YankovMore fieldsBE: 1 dayQA: 0.5 day - Test onily Twillo disconnect flowParentNone20 5Nikolay YankovAneliya AngelovaNikolay IvanoLukas Kovalik3:10 PM | [Platform] Refinement ÂŽ...
|
NULL
|
2669527475592886929
|
NULL
|
visual_change
|
ocr
|
NULL
|
FirefoxFileEditViewHistoryBookmarksProfilesToolsWi FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 5 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com100% <78⢠Mon 18 May 15:10:42+â˘$18Nikolay Yankov (Presenting)EditHistoryTab# Proje( AtterSchel⢠Cursc* Ciauc|⢠Cost5app.oAllowoPiot8JimirZ (JY-2C UY-2Z [JY-27 [JY-28⢠Mon 18 May 15:10Z (JY-2https://fiminny.atlassian.net/browse/JY-20912⢠Sminny⢠Home| Salesforce M O 8 [ E Datadoa * Claude3 Circleci8 JiMINNY* For youŠ Recent |# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Jiminny (New)I CID Platform TeamIID Enterprise Stability I...111 Processing Tearn(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams% Customise sidebar0 Projects|E3 SSHA Sentry0 Tasks7 Insights & CoachinâŚ0 DevDJ All BookmarkaSearch+ CreateAsk RovoCe, Add parent1 A Jy-20912We should implement the same fallback logic currently used for dialers - if the Salesforce admin token is expired or inactive, the system should search for another activeSalesforce token from any user within the same organisation and use it for CRM matching.Detailsstory point esumateAcceptance Criteria:⢠If the Salesforce admin token has expired, the system searches for another active Salesforce token within the organisation.⢠CRM object matching continues successfully using the fallback token.⢠Calls should not appear as "Unknown Customer" when another valid Salesforce connection exists in the organisation.Story PointsNoneOrganisationsNoneSubtasksAdd subtaskPriority= Medium'Linked work itemsAdd linked work itemFix versionsNone⢠ActivitySprintPlatform Sprint 5 Q2Work logDays1.5Add a comment.Suggest a replyâŚWho is working on this...?Status updateâŚNeed QAYesPto tos cretWoconCanny LinksOpen Canny LinksNikolay YankovMore fieldsBE: 1 dayQA: 0.5 day - Test onily Twillo disconnect flowParentNone20 5Nikolay YankovAneliya AngelovaNikolay IvanoLukas Kovalik3:10 PM | [Platform] Refinement ÂŽ...
|
53488
|
NULL
|
NULL
|
NULL
|
|
53491
|
1874
|
4
|
2026-05-18T12:10:46.372541+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106246372_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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...
|
[{"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},{"role":"AXButton","text":"AskJiminnyReportActivityServiceTest","depth":6,"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
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 5 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+18Nikolay Yankov (Presenting)ehomtFileEditVewTabM Inbo7 PattF Proje⢠AterSche⢠Cursc* Ciau:|⢠CĐžsŃ|@ app.o C Allov. 3 Pipe⢠SminnyC Projects |888 JiMINNYÂŽ For youŠ Recent# Starred8. AppsQ SpacesStarredS Service-DeskJiminny (Old)Jiminny (New) + --I 0D Platform TeamIID Enterprise Stabilty L..(ID SE Kanban= More spaces= FiitersCB DashboardsOperations* Confiuence:: Teams% Customise sidebarE3 SSH⢠Home| Salesforce @ O 88 [l El Datadoo @ # Ciaude3 CircleciA SentrySearchSpaces/LJinay (New) / 0 Jy-19309 / [J JY-20721Call Scoring filter for Exec reportsDescriptionNow that we have the call scoring feature, customers are asking for their report to be done only on calls with certain scores (either high or tow).|⢠Include the call scoring fĂźter in the Exec Reports section in Kiosk⢠use the same dropdown structure that we have in OD⢠put it before Recipients⢠ensure the scores filter applied for the report whien fetching the calls for aanalisys |SubtasksLinked work itemsActivityWork logAodecomiiWho is working on this...status upoate.Pro tio: press M 50d2 tY-Z tY-2Z [JY-27 [JY-28 - Mon 18 May 15:10QJY-20J Tasks7 insights & Coachin0 DerDD Al BookmarkslCreateAsk RovoBacklog~** Improve StoryDetailsAssignee8 UnassignedAssign to meReporter2 Gelya DimitrovaP Quick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or puli requestDrow, LEd wOsDismissDevelopment[ Open with VS Code!J Create branch* Create commit |ComponentsPlattormSub-ProductAdd optionsLabetsNone3:10 PM | [Platform] Refinement ÂŽ100% C8⢠Mon 18 May 15:10:465Nikolay YankolAneliya AngelovaNikolay IvanoLĂźkas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53492
|
1874
|
5
|
2026-05-18T12:10:52.401596+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106252401_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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...
|
[{"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},{"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}]...
|
-4235983745889776938
|
-8204421443435123770
|
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
JetBrains AI
Search Everywhere
IDE and Project Settings
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 5 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)+â˘$18ehomeFileEditViewtonetTabWndowM Inbol7 PlackF Proje( Atter( SchelŠ Cursc* Ciauc⢠Cos|5app.oAllowo Piothttps://jiminny.atlassian.net/browse/JY-20771⢠SminnyC Projects |888 JiMINNY* For youŠ Recent |# Starred8. AppsQ SpacesStarred9 Service-DeskJiminny (Old)Jiminny (New)ICD Platform Team(ID Enterprise Stability L...(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence: Teams% Customise sidebarE3 SSH⢠Home | Salesforce O 8 L E1 Datadog Š % Ciaude3 CircleciA SentrySearchspaces /Jmicey ONew) / $ JY-19309 / [ JY-20771Call Scoring filter for Exec reports⢠Description|Now that we have the call scoring feature, customers are asking for their report to be done only on calls with certain scores (either high or low).|⢠Include the call scoring fiter in the Exec Reports section in Kiosk⢠use the same dropdown structure that we have in OD⢠put it before Recipients⢠ensure the scores filter applied for the report when fetching the calls for sanalisys |SubtasksLinked work itemsActivityWork logRodacomiterWho is working on thisStatus update...Pro tio: press M to col1 LY-2Z UY-2Z [Y-27 [JY-28 ⢠Mon 18 May 15:10WJY-20 Tasks7 insights & Coachin.0 Dev|0J Al BookomarkaCreateAsk Rovoâ˘1|Backdog~** Improve StoryDetailsAssignee& UnassignedAssign to meReporter2 Galya DimitrovaP Quick start developmentLink this work item to your code byIincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismissDevelopmentOpen with VS CodeJ Create branchCreate commit |ComponentsPlatformSub-ProductAdd optionsLabelsStory point esuim3:10 PM | [Platform] Refinement ÂŽ100% C8⢠Mon 18 May 15:10:525Nikolay YankolAneliya AngelovaNikolay IvanLukas Kovalik...
|
53491
|
NULL
|
NULL
|
NULL
|
|
53493
|
1874
|
6
|
2026-05-18T12:10:58.420467+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106258420_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]...
|
[{"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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","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 id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-8950623343946724334
|
6686367685199443021
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53494
|
1875
|
1
|
2026-05-18T12:11:15.056287+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106275056_m2.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}...
|
[{"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},{"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\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
775695417232670985
|
5527291647994408855
|
idle
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53495
|
1874
|
7
|
2026-05-18T12:11:28.667317+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106288667_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]...
|
[{"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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","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 id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-8950623343946724334
|
6686367685199443021
|
idle
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]...
|
53493
|
NULL
|
NULL
|
NULL
|
|
53496
|
1874
|
8
|
2026-05-18T12:11:34.656649+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106294656_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
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/>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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","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 id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","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}]...
|
5159095835385562987
|
6686367685199443021
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
Project
Project
New File or DirectoryâŚ
Expand Selected
Collapse All
Options
Hide...
|
53493
|
NULL
|
NULL
|
NULL
|
|
53497
|
1874
|
9
|
2026-05-18T12:11:40.739620+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106300739_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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}]...
|
-2240692385361527689
|
5529508263503171479
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53498
|
1874
|
10
|
2026-05-18T12:11:43.769669+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106303769_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]...
|
[{"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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","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 id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","role_description":"text entry area","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
-8950623343946724334
|
6686367685199443021
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]...
|
53497
|
NULL
|
NULL
|
NULL
|
|
53499
|
1875
|
2
|
2026-05-18T12:11:45.450397+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106305450_m2.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
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/>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},{"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\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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.42785904,"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.43650267,"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.4474734,"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.45611703,"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.46476063,"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.47573137,"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.4867021,"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.51329786,"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.5242686,"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_jupiter","depth":4,"bounds":{"left":0.69348407,"top":0.09896249,"width":0.04089096,"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":"19","depth":4,"bounds":{"left":0.6871675,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"bounds":{"left":0.6988032,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","depth":4,"bounds":{"left":0.71043885,"top":0.123703115,"width":0.00930851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.72140956,"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.7287234,"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 id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","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}]...
|
5159095835385562987
|
6686367685199443021
|
idle
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
Project
Project
New File or DirectoryâŚ
Expand Selected
Collapse All
Options
Hide...
|
53494
|
NULL
|
NULL
|
NULL
|
|
53500
|
1874
|
11
|
2026-05-18T12:11:52.837186+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106312837_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19...
|
[{"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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"on_screen":true,"role_description":"text"}]...
|
-797768331299375775
|
5527256463622377366
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53501
|
1874
|
12
|
2026-05-18T12:11:55.832429+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106315832_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
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/>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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","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 id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","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}]...
|
5159095835385562987
|
6686367685199443021
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
Project
Project
New File or DirectoryâŚ
Expand Selected
Collapse All
Options
Hide...
|
53500
|
NULL
|
NULL
|
NULL
|
|
53502
|
1874
|
13
|
2026-05-18T12:12:01.893269+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106321893_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
Project
Project
New File or DirectoryâŚ
Expand Selected
Collapse All...
|
[{"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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","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 id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","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}]...
|
751463405505560672
|
6686367685199443021
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
Project
Project
New File or DirectoryâŚ
Expand Selected
Collapse All...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53503
|
1874
|
14
|
2026-05-18T12:12:04.891064+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106324891_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
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/>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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","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 id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","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}]...
|
5159095835385562987
|
6686367685199443021
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
Project
Project
New File or DirectoryâŚ
Expand Selected
Collapse All
Options
Hide...
|
53502
|
NULL
|
NULL
|
NULL
|
|
53504
|
1875
|
3
|
2026-05-18T12:12:15.817490+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106335817_m2.jpg...
|
iTerm2
|
NULL
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormVIewINavigarecodeLaravelFV faVsco.js?9 mas PhpStormVIewINavigarecodeLaravelFV faVsco.js?9 master k. vProiectg constants.ong⢠Scimintertace.ongD SeederW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio⢠M Conference⢠ConferenceHandler⢠M ConferenceManadeC) SoftPhoneManader.ohoŠ ConferenceCallbackHandler.phpŠ ConferenceManager.phpIMnTOTM Event0 ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onpŠ TwilioRepository.php0 Uploader0 UrlGeneratora UtilityC Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsM Activities>M AnalvticcCalendarsv MCrmM HuhsnotD IntegrationApp⢠M TraitsC) Addl avoutEntities.nhnRefactorJOOISWindowC ActivityController.ongC BaseService.onpŠ SoftPhoneManager.php(C) CoreUserRequest.onpseimFrovistoning.onpxŠ CoreUser.phpclass Sc1mProv1s10n1ng$âŤ3282382383Š AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountl6 Pullborn Command Ahctrant nhn(e) RullbornDinaCommand nhnan assignRolesFromScim(User Suser, CoreUserRequest $dto, Team Steam): Accept['roles' => SroleIdsl."roles' =>'array")main: 1'0newDependentRolesPule(SvisibleRoles)inew ListenerRoleCannotHaveAdmin0rManagerPermissionRule(SvisibleRoles),'roles.*' => [anstinet""an.⢠SvisibleRoles->pluck( value: 'id')->implode( value: ',').new ListenerRoleRequiresListenerFeatureRule(Steam)if (Svalidator->fails0) {return?Sroles = SvisibleRoles->whereIn( kev: 'id'. Srolelds):Sdto = new UserRolesSvncoT0activelser: nulu.roles: Sroles.public function deleteGroup(Sgroup): boolf...}public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Grc1 1 of 4 edits JAccept File &+X Reject File 4%âŹ+ 5 of 8 files â= laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]& console [EU]A console [STAGING]X565566select * fron activity searches where id = 10932:from activity_search_filters where activity_search_id = 10932;570vselect * fromautomated_reports order by id desc;by id desc;T572spllect * +romautomated_reports where id IN (55):select *henp 1d TN 181)select * from users where id IN (10633,13087. 11985)â˘575select * || |593)Tx: AutovGo jiminny_jupiterwhere crm_configuration_id = 1 and pl.playbook_id = 175;019 A19 V17 ^ VSELECT r.* FROM automated_reports rjoin teams t on r.team id = t.idWHERE r. frequency = 'daily'AND t.status = 'active'AND (r.expires.at >= now() OR r.expires.at IS NULL)automated_ report results where report id IN (18, 33)select * from users where team_id = 1 and id = 1047;SELECT * FROMsochable 10 = 1047SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuidselect * from accounts where team_id = 1:select * trom automated report results where media type = "pdt' and status = 2SELECT * FROM automated_report_resultsWHERE uuid to bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuidselect * from teams where id = 1029;select * fromSELECTCONCAT(u.id, CASE WHEN U.id = t.owner_id THEN⢠(owner)' ELSE â˘* END) AS user idisa.*t.owner_id FROM social_accounts saJOIN users u on u.id = sa sociable idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idl. "23460 ownen)"Support Daily - 3 m left100% 1⢠Mon 18 May 15:12:15AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token FalliSClM Role Manageme+0 ..inp on LineWARN Metadata found iin doc-comment for method9/ 10 tacke doneWrite unit tests for SCIM role management10) Contact Mario to vodate customer10 / 10 tasks doneselm role managementtor leamtallor has been successtully implemented. Here's what was completed:Implementation Summary:1. CoreUserRequest DTO - Added role parsina from SCIM requests2. SCIM Constants - Added META ROLES and USER_PATCH_ATTR_ ROLES constants3. RoleAttr Mutator - Created mutator for handlina role assianments via SCIM PATCH operations4. ScimProvisioning - Updated to handle roles during user creation with proper validation5. ListenerRoleCannotHaveAdminOrManagerPermissionRule - Created validation rule to prevent listener role fromhaving admin/manager permissions6. CoreUser Response - Updated to include roles in SClM responses7. Unit Tests - Created comprehensive tests for the validation ruleKey Features:⢠Customers can now assign roles via SCIM (recorder, recorder & voice, analyst, listener, admin, manager)⢠Validation ensures listener role is onlv assianable if the LISTENER ROLE feature flaa is enabled⢠Listener role cannot be combined with admin or manager permissions⢠Uses existing UpdateUserRolesAction for role syncing and logging⢠Follows platform validation rules (DependentRolesRule, ListenerRoleRequiresListenerFeatureRule)Next Step: Please contact Mario to update the customer that SCIM role management is now available for Teamtailorintearationapp/Component/SClM/ Constants.php +3app/Component/SCIM/ ÂŽ ScimProvisioning.php +85-15nse/ CoreUser.php +21ann/Comnonent/SCIM/Mutatore/Attributes/Ucer/M PoleAttr.nho 417ites/User/ áş RoleAttrTest.nhn +224* Reiect alliiAccent alliAsk anvthing 884-D)ÂŤ Code SWF-1.6WN Windsurf Toams 284-57 UTF.8io 4 spaces...
|
NULL
|
-8864888485547287818
|
NULL
|
idle
|
ocr
|
NULL
|
PhpStormVIewINavigarecodeLaravelFV faVsco.js?9 mas PhpStormVIewINavigarecodeLaravelFV faVsco.js?9 master k. vProiectg constants.ong⢠Scimintertace.ongD SeederW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio⢠M Conference⢠ConferenceHandler⢠M ConferenceManadeC) SoftPhoneManader.ohoŠ ConferenceCallbackHandler.phpŠ ConferenceManager.phpIMnTOTM Event0 ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onpŠ TwilioRepository.php0 Uploader0 UrlGeneratora UtilityC Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsM Activities>M AnalvticcCalendarsv MCrmM HuhsnotD IntegrationApp⢠M TraitsC) Addl avoutEntities.nhnRefactorJOOISWindowC ActivityController.ongC BaseService.onpŠ SoftPhoneManager.php(C) CoreUserRequest.onpseimFrovistoning.onpxŠ CoreUser.phpclass Sc1mProv1s10n1ng$âŤ3282382383Š AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountl6 Pullborn Command Ahctrant nhn(e) RullbornDinaCommand nhnan assignRolesFromScim(User Suser, CoreUserRequest $dto, Team Steam): Accept['roles' => SroleIdsl."roles' =>'array")main: 1'0newDependentRolesPule(SvisibleRoles)inew ListenerRoleCannotHaveAdmin0rManagerPermissionRule(SvisibleRoles),'roles.*' => [anstinet""an.⢠SvisibleRoles->pluck( value: 'id')->implode( value: ',').new ListenerRoleRequiresListenerFeatureRule(Steam)if (Svalidator->fails0) {return?Sroles = SvisibleRoles->whereIn( kev: 'id'. Srolelds):Sdto = new UserRolesSvncoT0activelser: nulu.roles: Sroles.public function deleteGroup(Sgroup): boolf...}public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Grc1 1 of 4 edits JAccept File &+X Reject File 4%âŹ+ 5 of 8 files â= laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]& console [EU]A console [STAGING]X565566select * fron activity searches where id = 10932:from activity_search_filters where activity_search_id = 10932;570vselect * fromautomated_reports order by id desc;by id desc;T572spllect * +romautomated_reports where id IN (55):select *henp 1d TN 181)select * from users where id IN (10633,13087. 11985)â˘575select * || |593)Tx: AutovGo jiminny_jupiterwhere crm_configuration_id = 1 and pl.playbook_id = 175;019 A19 V17 ^ VSELECT r.* FROM automated_reports rjoin teams t on r.team id = t.idWHERE r. frequency = 'daily'AND t.status = 'active'AND (r.expires.at >= now() OR r.expires.at IS NULL)automated_ report results where report id IN (18, 33)select * from users where team_id = 1 and id = 1047;SELECT * FROMsochable 10 = 1047SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuidselect * from accounts where team_id = 1:select * trom automated report results where media type = "pdt' and status = 2SELECT * FROM automated_report_resultsWHERE uuid to bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuidselect * from teams where id = 1029;select * fromSELECTCONCAT(u.id, CASE WHEN U.id = t.owner_id THEN⢠(owner)' ELSE â˘* END) AS user idisa.*t.owner_id FROM social_accounts saJOIN users u on u.id = sa sociable idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idl. "23460 ownen)"Support Daily - 3 m left100% 1⢠Mon 18 May 15:12:15AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token FalliSClM Role Manageme+0 ..inp on LineWARN Metadata found iin doc-comment for method9/ 10 tacke doneWrite unit tests for SCIM role management10) Contact Mario to vodate customer10 / 10 tasks doneselm role managementtor leamtallor has been successtully implemented. Here's what was completed:Implementation Summary:1. CoreUserRequest DTO - Added role parsina from SCIM requests2. SCIM Constants - Added META ROLES and USER_PATCH_ATTR_ ROLES constants3. RoleAttr Mutator - Created mutator for handlina role assianments via SCIM PATCH operations4. ScimProvisioning - Updated to handle roles during user creation with proper validation5. ListenerRoleCannotHaveAdminOrManagerPermissionRule - Created validation rule to prevent listener role fromhaving admin/manager permissions6. CoreUser Response - Updated to include roles in SClM responses7. Unit Tests - Created comprehensive tests for the validation ruleKey Features:⢠Customers can now assign roles via SCIM (recorder, recorder & voice, analyst, listener, admin, manager)⢠Validation ensures listener role is onlv assianable if the LISTENER ROLE feature flaa is enabled⢠Listener role cannot be combined with admin or manager permissions⢠Uses existing UpdateUserRolesAction for role syncing and logging⢠Follows platform validation rules (DependentRolesRule, ListenerRoleRequiresListenerFeatureRule)Next Step: Please contact Mario to update the customer that SCIM role management is now available for Teamtailorintearationapp/Component/SClM/ Constants.php +3app/Component/SCIM/ ÂŽ ScimProvisioning.php +85-15nse/ CoreUser.php +21ann/Comnonent/SCIM/Mutatore/Attributes/Ucer/M PoleAttr.nho 417ites/User/ áş RoleAttrTest.nhn +224* Reiect alliiAccent alliAsk anvthing 884-D)ÂŤ Code SWF-1.6WN Windsurf Toams 284-57 UTF.8io 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53505
|
1874
|
15
|
2026-05-18T12:12:35.199750+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106355199_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.php
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Project: faVsco.js, menu
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false}]...
|
8043719072324535154
|
-8628527368849355612
|
visual_change
|
hybrid
|
NULL
|
Project: faVsco.js, menu
+FirefoxFileEditViewHisto Project: faVsco.js, menu
+FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 3 m leftâmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)ChromeFieEdtViewHatoryBookmarksProfiiesTabInbo01 ANC SotŠ Cor⢠cia⢠ConĐżŃŃ.C Alor3 PŃŃи⢠JmC pY-C UY8: Mon 18 May 15:12a UY-wnttossiuoter.staoino.iminnv.comlondemanctpaot=tM9D& JmimyC Projects |Z AWSE3 SSH⢠Home | Salesforce O8 El E Datadog C M ClaudeA Sentry0J Al BookmarksAll timeTopics149 activitiesSort by: Most recent(88)Add RecordingQ: Get NotifedtaircittoesnWeot amaReoeeRecorded: Oely RecordedE Save Search Š Clear all|Activity typeActivity TypeDuration ÂŽMin (minutes)Unknown Customer W2024-05-17-call-to-17608915463MOCODO DO3m07/05/2026, 3:41 PMAl calliscĂ´re0⢠(2*Select Al call scoreUnknown Customer #2024-05-17-call-to-17608915163DO âŹ0 DO DO 3m07/05/2026, 3.41 PMUnknown Customer WNotetakor added by Veselin KulowUnknown Customer WDeleteRecordingAlterEind-on 12-1diam sapien, vel facilisis velit iaculis non. Nam in magna et leotincidunt orcii(1 &1 Äo DO 2m18/12/2023, 11:14 AMUnknown Customer WMo d0 Ä0 D14m13/12/2023, 12:53 PMUnknown Customer WTest-GoogleMeet-JoitOnPironeMO G0 DO D13mCiear AllUnknown Customer WNotctaker Zoom RecordingPolicy-170 &2 Do DoCurrent stageUnknown Customer NNotetaker added on 11-20-23 e 1...MO S0 Ä0 D220/11/2023, 11:30 AM|18Unknown Customer WStaleElementRefcrenceError - ZoomM0 G0 D0 D35m16/11/2023. 3:46 PMRobinson Crusoe Cruises Limi...MOGO DO DO20/10/2023.3/20 PMWoineKinoJY-20613-allow-owner-role-on-tean-setup + 8886333:12 PM | [Platform] Refinement ÂŽ100% <78⢠Mon 18 May 15:12:34=20 5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53506
|
1874
|
16
|
2026-05-18T12:12:38.191106+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106358191_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification...
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Project: faVsco.js, menu","depth":5,"on_screen":true,"help_text":"~/jiminny/app","role_description":"button","is_enabled":true,"is_focused":false,"is_selected":false,"is_expanded":false},{"role":"AXButton","text":"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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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}]...
|
7949613381297106486
|
5529508263503171478
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification...
|
53505
|
NULL
|
NULL
|
NULL
|
|
53507
|
1874
|
17
|
2026-05-18T12:12:44.255784+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106364255_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19...
|
[{"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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"on_screen":true,"role_description":"text"}]...
|
-797768331299375775
|
5527256463622377366
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53508
|
1874
|
18
|
2026-05-18T12:12:47.289599+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106367289_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
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/>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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","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 id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","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}]...
|
5159095835385562987
|
6686367685199443021
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
Project
Project
New File or DirectoryâŚ
Expand Selected
Collapse All
Options
Hide...
|
53507
|
NULL
|
NULL
|
NULL
|
|
53509
|
1875
|
4
|
2026-05-18T12:12:49.135287+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106369135_m2.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
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/>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},{"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\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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.42785904,"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.43650267,"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.4474734,"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.45611703,"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.46476063,"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.47573137,"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.4867021,"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.51329786,"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.5242686,"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_jupiter","depth":4,"bounds":{"left":0.69348407,"top":0.09896249,"width":0.04089096,"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":"19","depth":4,"bounds":{"left":0.6871675,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"19","depth":4,"bounds":{"left":0.6988032,"top":0.123703115,"width":0.009640957,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"17","depth":4,"bounds":{"left":0.71043885,"top":0.123703115,"width":0.00930851,"height":0.015163607},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Previous Highlighted Error","depth":4,"bounds":{"left":0.72140956,"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.7287234,"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 id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","depth":4,"on_screen":true,"value":"SELECT * FROM teams WHERE id = 1;\n\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;\nSELECT * FROM crm_fields WHERE id = 2234;\nSELECT * FROM crm_field_values WHERE crm_field_id = 2234;\n\nselect * from crm_profiles where user_id = 143;\n\nselect * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO\nselect * from business_processes where crm_configuration_id = 39;\n# 01941000000H669AAC, 01941000000H66JAAS\n\nselect * from record_type_field_values\n where record_type_id IN (24);\n\nselect * from crm_field_values where id IN (2730);\n\nselect * from crm_configurations where id = 39;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce'; #1035\n\n\nselect * from users where team_id = 1; # 222 group 3\nSELECT * FROM activities WHERE user_id = 222 order by id desc;\nselect * from sidekick_settings where team_id = 1;\nselect * from teams where id = 1;\nselect * from team_features where team_id = 1;\n\nselect * from activities where crm_configuration_id = 2\nand provider = 'ms-teams' and id = 608765;\n\nSELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';\n\nselect * from sidekick_settings where team_id = 2;\n\nSELECT * FROM activities WHERE id = 608660;\nselect * from activity_summary_logs where activity_id = 608660;\nselect * from ai_prompts where transcription_id = 11214;\n\n# ********************************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;\n# id: 608818, crm: 59628809737\nSELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;\n# id: 608821, crm: 59632069252\nSELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,\nplaybook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,\nscheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at\nFROM activities a\njoin calendar_events ce on a.calendar_event_id = ce.id\nWHERE a.id IN (608818, 608821);\n\nselect * from users where team_id = 1;\nselect * from team_settings where team_id = 1;\nselect * from crm_profiles where crm_configuration_id = 39 order by user_id;\n\nselect * from team_features where team_id = 1;\n\nselect * from users where team_id = 2;\n\nSELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639\n# Preslava N. Ivanova, grou id 3\n\nSELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;\n\nselect * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';\n\nselect\n a.id,\n a.type,\n a.scheduled_start_time,\n a.actual_start_time,\n a.created_at,\n a.opportunity_id,\n a.status\nFROM activities a\nWHERE opportunity_id = 344\nand status IN ('completed', 'received', 'delivered')\nand (\n (a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')\nOR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))\n;\n\nSELECT * FROM users WHERE id = 222;\n\nSELECT * FROM crm_profiles WHERE user_id = 222;\nselect * from crm_layouts where crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;\n\nselect * from group_deal_risk_types;\n\nselect * from opportunities where team_id = 1;\n\nSELECT * FROM opportunities WHERE id = 315;\nSELECT * FROM crm_field_data WHERE object_id = 315;\nselect * from crm_field_data where object_id = 260;\n\nselect * from generic_ai_prompts where subject_id = 315;\n\nselect * from teams; # 36, 21, 121, james.graham@bullhorn.jiminny.com\nSELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';\n\n# ************************************************************************************\nselect * from teams where id = 1;\nselect * from crm_configurations where id = 39;\nselect * from users where team_id = 1;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 1;\n# 1 - 00541000004281rAAA\n# 204 - 0052g000003freeAAA\n# 429 - 0052g000003qGOiAAM\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\nselect * from activities where type = 'softphone'\nand created_at > '2024-12-11 15:24:36' order by id desc;\n\nselect * from activity_providers where team_id = 1;\nselect * from activity_provider_users where activity_provider_id = 328;\n\nselect * from opportunities where crm_configuration_id = 39\nAND account_id = 178 AND is_closed = false\norder by created_at DESC;\n\nselect * from contacts where id = 3952;\nselect * from accounts where id = 178;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations where id = 21;\nselect * from users where team_id = 36;\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 36;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 36\nand sa.provider = 'bullhorn';\n\nselect * from social_accounts where id = 348;\nUPDATE social_accounts SET\nprovider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',\nprovider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',\nexpires = 1733998131,\nstate = 'connected'\nWHERE id = 348;\n\n# ************************************************************************************\nselect * from teams where id = 31;\nselect * from crm_configurations where id = 18;\n\nselect * from users where team_id = 31; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 31;\n\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 31\nand sa.provider = 'close';\n\nselect * from contacts where crm_configuration_id = 18;\n\n# ********************** NEPTUNE **************************************************************\nselect * from teams;\nselect * from users where id IN (1030, 1035, 1052);\nselect * from crm_configurations;\n\nselect * from users where team_id = 65; # 257\nselect * from team_settings where team_id = 65; # 257\nselect * from invitations where team_id = 65; # 257\nselect * from users where email = 'integration-account@jiminny.com'; # 257\nselect u.email, cp.* from users u\njoin crm_profiles cp on u.id = cp.user_id\nwhere u.team_id = 65;\n\nselect * from crm_configurations where id = 53;\nselect * from accounts where crm_configuration_id = 53 order by id desc;\nselect * from leads where crm_configuration_id = 53 order by id desc;\nselect * from contacts where crm_configuration_id = 53 order by id desc;\nselect * from opportunities where crm_configuration_id = 53 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 53 order by id desc;\nselect * from crm_fields where crm_configuration_id = 53 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 53 order by id desc;\nselect * from stages where crm_configuration_id = 53 order by id desc;\n\n\nselect * from crm_profiles where crm_configuration_id = 13;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\nand sa.provider = 'integration-app';\n\nselect * from contacts where crm_configuration_id = 13;\n\nselect * from social_accounts where sociable_id = 283;\n\nSELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';\n\nselect * from activity_providers where team_id = 65;\nSELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 65\n;\n\n# ***************************** STAGING ********************************************\nSELECT * FROM teams;\nSELECT * FROM teams WHERE id = 88;\nSELECT * FROM teams WHERE id = 89;\nselect * from team_settings where team_id = 89;\nSELECT * FROM users WHERE team_id = 89;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 89;\n\nselect * from users;\nSELECT * FROM social_accounts WHERE sociable_id = 1761;\nSELECT * FROM crm_configurations WHERE id = 70;\nselect * from accounts where crm_configuration_id = 70 order by id desc;\nselect * from leads where crm_configuration_id = 70 order by id desc;\nselect * from contacts where crm_configuration_id = 70 order by id desc;\nselect * from opportunities where crm_configuration_id = 70 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 70 order by id desc;\nselect * from crm_fields where crm_configuration_id = 70 order by id desc;\nselect * from crm_field_values where crm_field_id = 3536 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 70 order by id desc;\nselect * from stages where crm_configuration_id = 70 order by id desc;\nselect * from business_processes where crm_configuration_id = 70 order by id desc;\nselect * from business_process_stages where business_process_id = 34;\n\nselect * from contacts where id = 10468;\n\nselect * from crm_layouts where crm_configuration_id = 70;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;\nSELECT * FROM crm_fields WHERE id IN (3533,3534,3535);\n\nselect * from activities where crm_configuration_id = 70\nand (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;\n\nSELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;\nSELECT * FROM activities where crm_configuration_id = 69 ;\n\nSELECT * FROM users WHERE email LIKE '%jiminny_web_sa2@jiminny.com%';\nSELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;\nSELECT * FROM opportunities WHERE id = 385;\n\nselect * from participants p\njoin activities a on p.activity_id = a.id\nwhere a.crm_configuration_id = 70\nand (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);\nSELECT * FROM participants WHERE id = 1013638;\n\nselect * from teams where id = 90;\nselect * from users where team_id = 90;\nselect * from social_accounts where social_accounts.sociable_id IN (1960,1760);\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 71;\nselect * from invitations where team_id = 90;\n\nselect * from crm_configurations where id = 71;\nselect * from accounts where crm_configuration_id = 71 order by id desc;\nselect * from leads where crm_configuration_id = 71 order by id desc;\nselect * from contacts where crm_configuration_id = 71 order by id desc;\nselect * from opportunities where crm_configuration_id = 71 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 71 order by id desc;\nselect * from crm_fields where crm_configuration_id = 71 order by id desc;\nselect * from crm_field_values where crm_field_id = 3341 order by id desc;\nselect * from crm_layouts where crm_configuration_id = 71 order by id desc;\nselect * from stages where crm_configuration_id = 71 order by id desc;\n\nselect * from users order by secondary_email desc;\nselect u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa\n join users u on sa.sociable_id = u.id\nwhere sa.provider = 'google' and u.email LIKE 'aneliya%';\n\nselect * from failed_jobs order by id desc;\n\nselect * from users where email = 'ben.allwright@learningpeople.co.uk' or secondary_email = 'ben.allwright@learningpeople.co.uk';\n\nselect * from teams;\nSELECT * FROM crm_profiles WHERE crm_configuration_id = 39;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 1\nand sa.provider = 'salesforce';\n\n# ************************************************************************************\nSELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;\nSELECT * FROM crm_configurations WHERE id = 70;\n\nselect * from teams where id = 1;\nselect * from groups where team_id = 1;\nselect * from users where team_id = 1;\n\nselect o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o\njoin users u on o.user_id = u.id\njoin groups g on u.group_id = g.id\njoin role_user ru on u.id = ru.user_id\njoin roles r on ru.role_id = r.id\nwhere o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';\n\nselect * from role_user where user_id = 143;\nselect * from roles;\n\nselect * from role_user;\nselect * from groups where id = 9;\nselect * from scope_groups where group_id = 9;\n\n# ************************************************************************************\nselect * from teams where id = 36;\nselect * from crm_configurations;\nSELECT * FROM social_accounts WHERE sociable_id = 121;\n\nhttps://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105\nhttps://crmsandbox.zoho.com/crm/\n\nhttps://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080\n https://crm.zoho.com/crm/\n org3469620\n\nSELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;\n\nselect * from users where email LIKE \"%mobile_automation_%\";\nselect * from social_accounts where sociable_id IN (2228);\nselect * from crm_profiles where user_id IN (2222,2223,2226,2227);\n\nselect * from teams order by id desc;\nSELECT * FROM users WHERE id = 2229;\nSELECT * FROM crm_profiles WHERE user_id = 2229;\nselect * from opportunities where crm_configuration_id = 88;\nselect * from crm_fields where crm_configuration_id = 88;\nselect * from crm_profiles where crm_configuration_id = 88;\n\nSELECT * FROM teams WHERE id = 1;\n\nSELECT * FROM users WHERE id = 143;\nSELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;\n\nhttps://app.staging.jiminny.com/ondemand?\n min_duration=1\n &\n only_recorded=1\n &\n user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e\n &\n sequence_number=2\n\n select * from users where team_id = 1 and email like '%stoyan%'\n\nselect * from coaching_feedbacks;\n\nselect * from teams;\nSELECT * FROM users WHERE team_id = 36;\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from users where id = 143;\n\nSELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\nSELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;\n\nselect * from users where team_id = 2;\nselect * from activities where crm_configuration_id = 39\nand activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'\nAND user_id = 143\norder by id desc;\n\n# ************************************************************************************\nselect * from teams where id = 142; # 2312, 126\nselect * from team_settings;\nselect * from users where team_id = 142; # 21642\nSELECT * FROM social_accounts WHERE sociable_id = 21642;\nSELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;\nselect * from crm_profiles where id IN (93);\nselect * from invitations;\nselect * from team_features where team_id = 1;\n\nSELECT * FROM crm_configurations WHERE id = 126;\nselect * from accounts where crm_configuration_id = 126 order by id desc;\nselect * from leads where crm_configuration_id = 126 order by id desc;\nselect * from contacts where crm_configuration_id = 126 order by id desc;\nselect * from opportunities where crm_configuration_id = 126 order by id desc;\nselect * from crm_profiles where crm_configuration_id = 126 order by id desc;\nselect * from crm_fields where crm_configuration_id = 126 # 11060\n# and type IN ('picklist', 'status')\n# and object_type = 'task'\norder by id desc;\n# 5731,5732,5733\nselect DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;\nselect * from crm_layouts where crm_configuration_id = 126 order by id desc;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);\nselect * from stages where crm_configuration_id = 126 order by id desc;\nselect * from business_processes where crm_configuration_id = 126 order by id desc;\nselect * from business_process_stages where business_process_id IN (76,75,74,73);\nselect * from playbooks where team_id = 142;\nselect * from playbook_layouts where playbook_id IN (108);\nSELECT * FROM playbook_categories WHERE playbook_id IN (108);\n\nselect * from teams where id = 130;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 2\nand sa.provider = 'hubspot';\n\nSELECT * FROM activities\n WHERE crm_configuration_id = 110;\n\nselect * from teams;\nselect * from crm_configurations;\n\nSELECT * FROM activities WHERE id = 628773;\nSELECT * FROM crm_profiles WHERE user_id = 1460;\nSELECT * FROM social_accounts WHERE sociable_id = 2291;\n\nselect * from teams;\nselect ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id\njoin permission_role pr on pr.role_id = ru.role_id\n join permissions p on p.id = pr.permission_id\nwhere team_id = 495 and p.name IN ('dial');\n\nselect * from teams where id = 145;\nselect * from crm_configurations where id = 129;\nselect * from social_accounts where sociable_id = 2317;\nSELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;\n\nselect * from teams where id = 1;\nSELECT * FROM crm_layouts WHERE crm_configuration_id = 39;\nSELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;\nSELECT * FROM crm_layout_entities WHERE id = 5507;\nSELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');\n\nselect * from teams;\nselect * from activities where crm_configuration_id = 14;\n\nSELECT * FROM social_accounts where provider = 'copper';\n\nselect * from activities where id = 628467;\nselect * from participants where activity_id = 628467;\n\nSELECT * FROM contacts WHERE id = 3969;\nSELECT * FROM accounts WHERE id = 177;\n\nSELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;\n\n# ********************* BH\nselect * from teams where id = 36;\nSELECT * FROM crm_configurations WHERE id = 21;\nselect * from activities where crm_configuration_id = 21 and id = 607901;\nselect * from activities where crm_configuration_id = 21;\n\nselect * roles;\nselect * from permissions;\nselect * from permission_role where permission_id = 226;\n\nselect * from migrations order by id desc;\n\n# mercury\n# neptune\n# earth\n\nselect * from teams;\nselect * from teams where id = 19;\nselect * from teams where id = 27;\nselect * from users where team_id = 27;\nSELECT * FROM crm_configurations WHERE id = 42;\n\nselect * from social_accounts sa\njoin users u on sa.sociable_id = u.id\nwhere u.team_id = 19\nand sa.provider = 'pipedrive';\n\nselect * from activities where id = 631461;\nSELECT * FROM crm_field_values WHERE crm_field_id = 180;\n\nselect * from teams where id = 2;\nSELECT * FROM social_accounts WHERE sociable_id = 89;\n\nSELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273\nselect * from activity_summary_logs where activity_id = 634273;\n\nselect * from sidekick_settings where team_id = 2;\n\nselect * from teams; # 2, 2\nSELECT * FROM crm_configurations WHERE team_id = 2; # 2\nselect * from team_features where team_id = 2;\nselect * from features;\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';\nSELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;\n\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from users where team_id = 1 and id IN (7160, 3248);\nselect * from migrations order by 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 = 1052 and sa.provider = 'hubspot';\n\nselect * from teams where id = 1;\nselect * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;\nselect * from groups where id = 565;\nselect * from playbooks where team_id = 1;\nselect * from playbooks where id = 175;\nselect * from playbook_categories where playbook_id = 175;\nselect * from users where team_id = 1052;\nselect * from users where id = 7160;\nselect * from crm_profiles where user_id = 7160;\nselect * from features;\nselect\n *\n# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,\n# crm_configuration_id, crm_provider_id, transcription_id, status\nfrom activities where crm_configuration_id = 1 and type = 'conference'\n# and crm_provider_id IS NOT NULL\nand provider != 'uploader' and actual_start_time IS NOT NULL\nORDER by id desc;\nselect * from activities where id = 54747783; # 00UO400000pCzojMAC\n\nselect p.id, p.activity_type, pc.id, pc.name\nFROM playbooks p\njoin playbook_categories pc on p.id = pc.playbook_id\nwhere p.team_id = 1 and p.activity_type = 'event';\n\nSELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';\nSELECT * FROM crm_field_values WHERE crm_field_id = 4;\n\nselect * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id\nwhere crm_configuration_id = 1 and pl.playbook_id = 175;\n\nselect * from teams;\nSELECT r.* FROM automated_reports r\njoin teams t on r.team_id = t.id\nWHERE r.frequency = 'daily'\n and r.status = 1\nAND t.status = 'active'\nAND (r.expires_at >= now() OR r.expires_at IS NULL);\n\nselect * from automated_report_results where report_id IN (18, 33);\n\nselect * from users where team_id = 1 and id = 1047;\nSELECT * FROM social_accounts WHERE sociable_id = 1047;\n\nselect * from activity_searches where id = 10932;\nselect * from activity_search_filters where activity_search_id = 10932;\nselect * from automated_reports order by id desc;\nselect * from automated_report_results order by id desc;\nselect * from automated_reports where id IN (55);\nselect * from automated_report_results where id IN (81);\nselect * from users where id IN (10633, 13987, 11985);\nselect * from users where group_id IN (3710);\n\nSELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;\n\nselect * from teams;\nselect * from accounts where team_id = 1;\n\nselect * from automated_report_results where media_type = 'pdf' and status = 2;\nSELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;\n\nselect * from teams where id = 1029;\nselect * from crm_configurations where provider = 'pipedrive';\nSELECT\n CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,\n u.email,\n sa.*,\n t.owner_id FROM social_accounts sa\nJOIN users u on u.id = sa.sociable_id\nJOIN teams t on t.id = u.team_id\nWHERE u.team_id = 1029 and sa.provider = 'pipedrive';\n\n[\n {\n \"user_id\": \"23460 (owner)\",\n \"email\": \"integration-account@pipedrive.jiminny.com\",\n \"id\": 69,\n \"sociable_id\": 23460,\n \"provider_user_id\": \"19555731\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA\",\n \"provider_refresh_token\": \"5034113:19555731:87c14258f0c813d02767ee975f6044d46b6b2bfc\",\n \"expires\": 1779091997,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"connected\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 08:23:28\",\n \"updated_at\": \"2026-05-18 07:13:18\",\n \"provider_user_token_encrypted\": \"eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n },\n {\n \"user_id\": \"23463\",\n \"email\": \"jiminny_web_sa@pipedrive.jiminny.com\",\n \"id\": 72,\n \"sociable_id\": 23463,\n \"provider_user_id\": \"23270841\",\n \"provider_user_token\": \"v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU\",\n \"provider_refresh_token\": \"5034113:23270841:34790b44838f5fd422c2d2c82e00f1ecf2178ad1\",\n \"expires\": 1753837219,\n \"refresh_token_expires\": null,\n \"provider\": \"pipedrive\",\n \"state\": \"full-refresh\",\n \"auth_scope\": \"base,deals:full,activities:full,contacts:full,search:read\",\n \"retry_after\": null,\n \"created_at\": \"2025-04-16 10:41:12\",\n \"updated_at\": \"2025-07-30 01:00:17\",\n \"provider_user_token_encrypted\": \"eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=\",\n \"provider_refresh_token_encrypted\": \"eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==\",\n \"encryption_key\": \"0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91\",\n \"sociable_type\": \"user\",\n \"owner_id\": 23460\n }\n]","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}]...
|
5159095835385562987
|
6686367685199443021
|
idle
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:
Hide
19
19
17
Previous Highlighted Error
Next Highlighted Error
SELECT * FROM teams WHERE id = 1;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 283;
SELECT * FROM crm_fields WHERE id = 2234;
SELECT * FROM crm_field_values WHERE crm_field_id = 2234;
select * from crm_profiles where user_id = 143;
select * from record_types where crm_configuration_id = 39; # 0121K000001MHElQAO,0121K000001MHEqQAO
select * from business_processes where crm_configuration_id = 39;
# 01941000000H669AAC, 01941000000H66JAAS
select * from record_type_field_values
where record_type_id IN (24);
select * from crm_field_values where id IN (2730);
select * from crm_configurations where id = 39;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce'; #1035
select * from users where team_id = 1; # 222 group 3
SELECT * FROM activities WHERE user_id = 222 order by id desc;
select * from sidekick_settings where team_id = 1;
select * from teams where id = 1;
select * from team_features where team_id = 1;
select * from activities where crm_configuration_id = 2
and provider = 'ms-teams' and id = 608765;
SELECT * FROM activities WHERE crm_configuration_id = 2 and crm_provider_id = '59523413338';
select * from sidekick_settings where team_id = 2;
SELECT * FROM activities WHERE id = 608660;
select * from activity_summary_logs where activity_id = 608660;
select * from ai_prompts where transcription_id = 11214;
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('ed78a437-2804-450e-ab2f-56ab1c641346') = uuid;
# id: 608818, crm: 59628809737
SELECT * FROM activities WHERE uuid_to_bin('36b06e55-afdd-4782-8dee-c624cd0af191') = uuid;
# id: 608821, crm: 59632069252
SELECT ce.start_time, ce.end_time, a.id, a.uuid, crm_provider_id, calendar_event_id, title,
playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id,
scheduled_start_time, scheduled_end_time, actual_start_time, actual_end_time, a.created_at
FROM activities a
join calendar_events ce on a.calendar_event_id = ce.id
WHERE a.id IN (608818, 608821);
select * from users where team_id = 1;
select * from team_settings where team_id = 1;
select * from crm_profiles where crm_configuration_id = 39 order by user_id;
select * from team_features where team_id = 1;
select * from users where team_id = 2;
SELECT * FROM activities WHERE uuid_to_bin('ec7647e9-5225-458b-b475-f31aa2769204') = uuid; # 612639
# Preslava N. Ivanova, grou id 3
SELECT * FROM opportunities WHERE uuid_to_bin('a2928fe5-aec5-46cb-85d9-7654c89e46a6') = uuid;
select * from activities where opportunity_id = 344 and actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00';
select
a.id,
a.type,
a.scheduled_start_time,
a.actual_start_time,
a.created_at,
a.opportunity_id,
a.status
FROM activities a
WHERE opportunity_id = 344
and status IN ('completed', 'received', 'delivered')
and (
(a.actual_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.created_at between '2024-10-11 00:00:00' and '2024-10-12 00:00:00')
OR (a.scheduled_start_time between '2024-10-11 00:00:00' and '2024-10-12 00:00:00'))
;
SELECT * FROM users WHERE id = 222;
SELECT * FROM crm_profiles WHERE user_id = 222;
select * from crm_layouts where crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 281;
select * from group_deal_risk_types;
select * from opportunities where team_id = 1;
SELECT * FROM opportunities WHERE id = 315;
SELECT * FROM crm_field_data WHERE object_id = 315;
select * from crm_field_data where object_id = 260;
select * from generic_ai_prompts where subject_id = 315;
select * from teams; # 36, 21, 121, [EMAIL]
SELECT * FROM social_accounts WHERE sociable_id = 121 and provider = 'bullhorn';
# [PASSWORD_DOTS]
select * from teams where id = 1;
select * from crm_configurations where id = 39;
select * from users where team_id = 1;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 1;
# 1 - 00541000004281rAAA
# 204 - 0052g000003freeAAA
# 429 - 0052g000003qGOiAAM
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
select * from activities where type = 'softphone'
and created_at > '2024-12-11 15:24:36' order by id desc;
select * from activity_providers where team_id = 1;
select * from activity_provider_users where activity_provider_id = 328;
select * from opportunities where crm_configuration_id = 39
AND account_id = 178 AND is_closed = false
order by created_at DESC;
select * from contacts where id = 3952;
select * from accounts where id = 178;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations where id = 21;
select * from users where team_id = 36;
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 36
and sa.provider = 'bullhorn';
select * from social_accounts where id = 348;
UPDATE social_accounts SET
provider_user_token = '21442_6802599_91:41179a58-21e7-4d7c-ad58-56bb666b2f65',
provider_refresh_token = '21442_6802599_91:01c6b335-3f2a-42e4-85ff-8a08fa65fceb',
expires = 1733998131,
state = 'connected'
WHERE id = 348;
# [PASSWORD_DOTS]
select * from teams where id = 31;
select * from crm_configurations where id = 18;
select * from users where team_id = 31; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 31;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 31
and sa.provider = 'close';
select * from contacts where crm_configuration_id = 18;
# [PASSWORD_DOTS] NEPTUNE [PASSWORD_DOTS]
select * from teams;
select * from users where id IN (1030, 1035, 1052);
select * from crm_configurations;
select * from users where team_id = 65; # 257
select * from team_settings where team_id = 65; # 257
select * from invitations where team_id = 65; # 257
select * from users where email = '[EMAIL]'; # 257
select u.email, cp.* from users u
join crm_profiles cp on u.id = cp.user_id
where u.team_id = 65;
select * from crm_configurations where id = 53;
select * from accounts where crm_configuration_id = 53 order by id desc;
select * from leads where crm_configuration_id = 53 order by id desc;
select * from contacts where crm_configuration_id = 53 order by id desc;
select * from opportunities where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 53 order by id desc;
select * from crm_fields where crm_configuration_id = 53 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 53 order by id desc;
select * from stages where crm_configuration_id = 53 order by id desc;
select * from crm_profiles where crm_configuration_id = 13;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
and sa.provider = 'integration-app';
select * from contacts where crm_configuration_id = 13;
select * from social_accounts where sociable_id = 283;
SELECT * FROM opportunities WHERE crm_provider_id = '006O400000E9bzeIAB';
select * from activity_providers where team_id = 65;
SELECT * FROM activities WHERE crm_configuration_id IN (51, 52, 53);
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 65
;
# [PASSWORD_DOTS] STAGING [PASSWORD_DOTS]
SELECT * FROM teams;
SELECT * FROM teams WHERE id = 88;
SELECT * FROM teams WHERE id = 89;
select * from team_settings where team_id = 89;
SELECT * FROM users WHERE team_id = 89;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 89;
select * from users;
SELECT * FROM social_accounts WHERE sociable_id = 1761;
SELECT * FROM crm_configurations WHERE id = 70;
select * from accounts where crm_configuration_id = 70 order by id desc;
select * from leads where crm_configuration_id = 70 order by id desc;
select * from contacts where crm_configuration_id = 70 order by id desc;
select * from opportunities where crm_configuration_id = 70 order by id desc;
select * from crm_profiles where crm_configuration_id = 70 order by id desc;
select * from crm_fields where crm_configuration_id = 70 order by id desc;
select * from crm_field_values where crm_field_id = 3536 order by id desc;
select * from crm_layouts where crm_configuration_id = 70 order by id desc;
select * from stages where crm_configuration_id = 70 order by id desc;
select * from business_processes where crm_configuration_id = 70 order by id desc;
select * from business_process_stages where business_process_id = 34;
select * from contacts where id = 10468;
select * from crm_layouts where crm_configuration_id = 70;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 388;
SELECT * FROM crm_fields WHERE id IN (3533,3534,3535);
select * from activities where crm_configuration_id = 70
and (account_id IS NOT NULL or lead_id IS NOT NULL or contact_id IS NOT NULL or opportunity_id IS NOT NULL) order by id desc;
SELECT * FROM activities WHERE uuid_to_bin('2e10b60f-8a61-41c5-a3d4-28835353dc65') = uuid;
SELECT * FROM activities where crm_configuration_id = 69 ;
SELECT * FROM users WHERE email LIKE '%[EMAIL]%';
SELECT * FROM activities WHERE uuid_to_bin('5a150c93-40fc-42ec-b3bd-c1d328e09f6e') = uuid;
SELECT * FROM opportunities WHERE id = 385;
select * from participants p
join activities a on p.activity_id = a.id
where a.crm_configuration_id = 70
and (p.lead_id IS NOT NULL or p.contact_id IS NOT NULL);
SELECT * FROM participants WHERE id = 1013638;
select * from teams where id = 90;
select * from users where team_id = 90;
select * from social_accounts where social_accounts.sociable_id IN (1960,1760);
SELECT * FROM crm_profiles WHERE crm_configuration_id = 71;
select * from invitations where team_id = 90;
select * from crm_configurations where id = 71;
select * from accounts where crm_configuration_id = 71 order by id desc;
select * from leads where crm_configuration_id = 71 order by id desc;
select * from contacts where crm_configuration_id = 71 order by id desc;
select * from opportunities where crm_configuration_id = 71 order by id desc;
select * from crm_profiles where crm_configuration_id = 71 order by id desc;
select * from crm_fields where crm_configuration_id = 71 order by id desc;
select * from crm_field_values where crm_field_id = 3341 order by id desc;
select * from crm_layouts where crm_configuration_id = 71 order by id desc;
select * from stages where crm_configuration_id = 71 order by id desc;
select * from users order by secondary_email desc;
select u.id, u.email, u.status, sa.id, sa.provider_user_id from social_accounts sa
join users u on sa.sociable_id = u.id
where sa.provider = 'google' and u.email LIKE 'aneliya%';
select * from failed_jobs order by id desc;
select * from users where email = '[EMAIL]' or secondary_email = '[EMAIL]';
select * from teams;
SELECT * FROM crm_profiles WHERE crm_configuration_id = 39;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type = 'task';
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 1
and sa.provider = 'salesforce';
# [PASSWORD_DOTS]
SELECT * FROM activities WHERE uuid_to_bin('c38b3895-fd0f-4b1f-9fb2-c170dba137c6') = uuid;
SELECT * FROM crm_configurations WHERE id = 70;
select * from teams where id = 1;
select * from groups where team_id = 1;
select * from users where team_id = 1;
select o.id, o.name,o.close_date, u.id, u.name, u.group_id, r.id, r.display_name, g.name, g.scope from opportunities o
join users u on o.user_id = u.id
join groups g on u.group_id = g.id
join role_user ru on u.id = ru.user_id
join roles r on ru.role_id = r.id
where o.crm_configuration_id = 39 and close_date > '2024-01-01 00:00:00';
select * from role_user where user_id = 143;
select * from roles;
select * from role_user;
select * from groups where id = 9;
select * from scope_groups where group_id = 9;
# [PASSWORD_DOTS]
select * from teams where id = 36;
select * from crm_configurations;
SELECT * FROM social_accounts WHERE sociable_id = 121;
https://crmsandbox.zoho.com/crm/jiminnyw4/tab/Leads/4776201000005049105
https://crmsandbox.zoho.com/crm/
https://crm.zoho.com/crm/org3469620/tab/Leads/230045000229559080
https://crm.zoho.com/crm/
org3469620
SELECT * FROM activities WHERE uuid_to_bin('03382d20-c8bc-48e7-a3d4-90b52fa5ceab') = uuid;
select * from users where email LIKE "%mobile_automation_%";
select * from social_accounts where sociable_id IN (2228);
select * from crm_profiles where user_id IN (2222,2223,2226,2227);
select * from teams order by id desc;
SELECT * FROM users WHERE id = 2229;
SELECT * FROM crm_profiles WHERE user_id = 2229;
select * from opportunities where crm_configuration_id = 88;
select * from crm_fields where crm_configuration_id = 88;
select * from crm_profiles where crm_configuration_id = 88;
SELECT * FROM teams WHERE id = 1;
SELECT * FROM users WHERE id = 143;
SELECT * FROM users WHERE uuid_to_bin('fde193d3-06a2-4e1a-8895-62b94039215d') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73385071-a756-42ae-9c73-8b53f2309467') = uuid;
https://app.staging.jiminny.com/ondemand?
min_duration=1
&
only_recorded=1
&
user_id%5B%5D=641f1acb-16b8-42d1-8726-df52979dad0e
&
sequence_number=2
select * from users where team_id = 1 and email like '%stoyan%'
select * from coaching_feedbacks;
select * from teams;
SELECT * FROM users WHERE team_id = 36;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from users where id = 143;
SELECT * FROM users WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM teams WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
SELECT * FROM activity_shares WHERE uuid_to_bin('73180eeb-33de-4065-977d-ccbe0e6c94fc') = uuid;
select * from users where team_id = 2;
select * from activities where crm_configuration_id = 39
and activities.scheduled_start_time BETWEEN '2025-04-09 00:00:00' AND '2025-04-09 23:59:59'
AND user_id = 143
order by id desc;
# [PASSWORD_DOTS]
select * from teams where id = 142; # 2312, 126
select * from team_settings;
select * from users where team_id = 142; # 21642
SELECT * FROM social_accounts WHERE sociable_id = 21642;
SELECT * FROM crm_profiles cp join users u ON u.id = cp.user_id WHERE team_id = 142;
select * from crm_profiles where id IN (93);
select * from invitations;
select * from team_features where team_id = 1;
SELECT * FROM crm_configurations WHERE id = 126;
select * from accounts where crm_configuration_id = 126 order by id desc;
select * from leads where crm_configuration_id = 126 order by id desc;
select * from contacts where crm_configuration_id = 126 order by id desc;
select * from opportunities where crm_configuration_id = 126 order by id desc;
select * from crm_profiles where crm_configuration_id = 126 order by id desc;
select * from crm_fields where crm_configuration_id = 126 # 11060
# and type IN ('picklist', 'status')
# and object_type = 'task'
order by id desc;
# 5731,5732,5733
select DISTINCT crm_field_id from crm_field_values where crm_field_id IN (11151,12239,12215,12185,12175,12165,12144,12137,12127,12109,12107,12105,12103,12092,12037,12005,12003,11987,11969,11958,11951,11942,11931,11924,11921,11917,11915,11901,11893,11883,11872,11870,11868,11866,11839,11833,11821,11793,11780,11777,11769,11757,11737,11735,11656,11645,11638,11629,11618,11611,11602,11591,11584,11581,11558,11544,11543,11534,11532,11529,11527,11503,11497,11493,11488,11470,11468,11457,11455,11397,11387,11372,11363,11348,11323,11318,11309,11301,11300,11292,11290,11286,11284,11256,11252,11242,11237,11233,11219,11176,11160) order by id desc;
select * from crm_layouts where crm_configuration_id = 126 order by id desc;
SELECT * FROM crm_layout_entities WHERE crm_layout_id in (300,299,298);
select * from stages where crm_configuration_id = 126 order by id desc;
select * from business_processes where crm_configuration_id = 126 order by id desc;
select * from business_process_stages where business_process_id IN (76,75,74,73);
select * from playbooks where team_id = 142;
select * from playbook_layouts where playbook_id IN (108);
SELECT * FROM playbook_categories WHERE playbook_id IN (108);
select * from teams where id = 130;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 2
and sa.provider = 'hubspot';
SELECT * FROM activities
WHERE crm_configuration_id = 110;
select * from teams;
select * from crm_configurations;
SELECT * FROM activities WHERE id = 628773;
SELECT * FROM crm_profiles WHERE user_id = 1460;
SELECT * FROM social_accounts WHERE sociable_id = 2291;
select * from teams;
select ru.*, pr.*, p.* from users u join role_user ru on ru.user_id = u.id
join permission_role pr on pr.role_id = ru.role_id
join permissions p on p.id = pr.permission_id
where team_id = 495 and p.name IN ('dial');
select * from teams where id = 145;
select * from crm_configurations where id = 129;
select * from social_accounts where sociable_id = 2317;
SELECT * FROM activities WHERE uuid_to_bin('8dbab184-a333-4268-ad57-fb41f8d53a9a') = uuid;
select * from teams where id = 1;
SELECT * FROM crm_layouts WHERE crm_configuration_id = 39;
SELECT * FROM crm_layout_entities WHERE crm_layout_id = 280;
SELECT * FROM crm_layout_entities WHERE id = 5507;
SELECT * FROM crm_fields WHERE crm_configuration_id = 39 and object_type IN ('event');
select * from teams;
select * from activities where crm_configuration_id = 14;
SELECT * FROM social_accounts where provider = 'copper';
select * from activities where id = 628467;
select * from participants where activity_id = 628467;
SELECT * FROM contacts WHERE id = 3969;
SELECT * FROM accounts WHERE id = 177;
SELECT * FROM activities WHERE uuid_to_bin('4eb54c77-cfa3-2bd4-84a7-9ed46a21c988') = uuid;
# [PASSWORD_DOTS] BH
select * from teams where id = 36;
SELECT * FROM crm_configurations WHERE id = 21;
select * from activities where crm_configuration_id = 21 and id = 607901;
select * from activities where crm_configuration_id = 21;
select * roles;
select * from permissions;
select * from permission_role where permission_id = 226;
select * from migrations order by id desc;
# mercury
# neptune
# earth
select * from teams;
select * from teams where id = 19;
select * from teams where id = 27;
select * from users where team_id = 27;
SELECT * FROM crm_configurations WHERE id = 42;
select * from social_accounts sa
join users u on sa.sociable_id = u.id
where u.team_id = 19
and sa.provider = 'pipedrive';
select * from activities where id = 631461;
SELECT * FROM crm_field_values WHERE crm_field_id = 180;
select * from teams where id = 2;
SELECT * FROM social_accounts WHERE sociable_id = 89;
SELECT * FROM activities WHERE uuid_to_bin('ba0c029a-bc14-4e17-8603-64174acebcbb') = uuid; # 634273
select * from activity_summary_logs where activity_id = 634273;
select * from sidekick_settings where team_id = 2;
select * from teams; # 2, 2
SELECT * FROM crm_configurations WHERE team_id = 2; # 2
select * from team_features where team_id = 2;
select * from features;
SELECT * FROM opportunities WHERE crm_configuration_id = 2 and crm_provider_id = '51317301383';
SELECT * FROM opportunities WHERE crm_configuration_id = 2 order by id desc;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from users where team_id = 1 and id IN (7160, 3248);
select * from migrations order by 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 = 1052 and sa.provider = 'hubspot';
select * from teams where id = 1;
select * from groups g JOIN playbooks p on g.playbook_id = p.id where g.team_id = 1;
select * from groups where id = 565;
select * from playbooks where team_id = 1;
select * from playbooks where id = 175;
select * from playbook_categories where playbook_id = 175;
select * from users where team_id = 1052;
select * from users where id = 7160;
select * from crm_profiles where user_id = 7160;
select * from features;
select
*
# id, uuid, type, provider, playbook_category_id, user_id, lead_id, contact_id, account_id, opportunity_id, stage_id,
# crm_configuration_id, crm_provider_id, transcription_id, status
from activities where crm_configuration_id = 1 and type = 'conference'
# and crm_provider_id IS NOT NULL
and provider != 'uploader' and actual_start_time IS NOT NULL
ORDER by id desc;
select * from activities where id = 54747783; # 00UO400000pCzojMAC
select p.id, p.activity_type, pc.id, pc.name
FROM playbooks p
join playbook_categories pc on p.id = pc.playbook_id
where p.team_id = 1 and p.activity_type = 'event';
SELECT * FROM crm_fields WHERE crm_configuration_id = 1 and object_type = 'event';
SELECT * FROM crm_field_values WHERE crm_field_id = 4;
select * from crm_layouts cl join playbook_layouts pl on cl.id = pl.layout_id
where crm_configuration_id = 1 and pl.playbook_id = 175;
select * from teams;
SELECT r.* FROM automated_reports r
join teams t on r.team_id = t.id
WHERE r.frequency = 'daily'
and r.status = 1
AND t.status = 'active'
AND (r.expires_at >= now() OR r.expires_at IS NULL);
select * from automated_report_results where report_id IN (18, 33);
select * from users where team_id = 1 and id = 1047;
SELECT * FROM social_accounts WHERE sociable_id = 1047;
select * from activity_searches where id = 10932;
select * from activity_search_filters where activity_search_id = 10932;
select * from automated_reports order by id desc;
select * from automated_report_results order by id desc;
select * from automated_reports where id IN (55);
select * from automated_report_results where id IN (81);
select * from users where id IN (10633, 13987, 11985);
select * from users where group_id IN (3710);
SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;
SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuid;
select * from teams;
select * from accounts where team_id = 1;
select * from automated_report_results where media_type = 'pdf' and status = 2;
SELECT * FROM automated_report_results WHERE uuid_to_bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid;
select * from teams where id = 1029;
select * from crm_configurations where provider = 'pipedrive';
SELECT
CONCAT(u.id, CASE WHEN u.id = t.owner_id THEN ' (owner)' ELSE '' END) AS user_id,
u.email,
sa.*,
t.owner_id FROM social_accounts sa
JOIN users u on u.id = sa.sociable_id
JOIN teams t on t.id = u.team_id
WHERE u.team_id = 1029 and sa.provider = 'pipedrive';
[
{
"user_id": "23460 (owner)",
"email": "[EMAIL]",
"id": 69,
"sociable_id": 23460,
"provider_user_id": "19555731",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:rYyABXmXsBhEdYU_dfmDH8GF-vzSseJXE5bds_zAyVdAwlTXOPdTl9i4PS4jVofLvpq7IRgvEt2BzGhR6cWiQXHHD0AtayQOkZm262ClFCsMYtKGfep0Jq1n0eiRIVqT9gAY7rWvhpEDF8oAlgnRGmqx-euIkpzE79sPXh4OjNx_yUIaanjyplGpBBJ_NiACd1sMlZmseyUyyU_gldqlCBAuK9hhATc9icgg7zuoc7nKBBrlg49tRtzEagDh6xbFBpzfCp7kE_7n4TLWfWHLPMzu-bktjwA969G9sFRmoH1GjPA0a2odDT4dk1_1ouBrB1NcTT2hQUqH-_RzDW2nWmeoVHA",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]b2bfc",
"expires": 1779091997,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "connected",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 08:23:28",
"updated_at": "2026-05-18 07:13:18",
"provider_user_token_encrypted": "eyJpdiI6Ik9oYzBwcTVteWN4ajBRaDdMb0FjWGc9PSIsInZhbHVlIjoiQUNMbjU5UHR2Q1RnbWRXMEU1TUx6UVpRU3gzdVc5WktmTE4rVlhXa3lRaGhyUUlZMVZRWEJuR0JaWWhZZXNPRlBuanhuYU5MVHZ5TG9NTVVjNjJSUUpZZ2VhbGYxbHg0UzJEdTVmQjNFZnJRZkMwYjd0N2RMZ05GRS9IR3c2K0NoVjBjYTA5UG12SkxHeDlDMGVNN3ptUWUzblFiTngyYzR1eUpHSEYrdEwvZm0yZklGYjBSNEtTR2ZGazhLM1hqT3lVbjFobDNPZ0d3anFlcjhKcXpERlZGOVN1YmFyNDIvM1BFRDFMYnp4WEI4TGVLM2xYcy9CL0RDOWlQNHI3N0NwWnJPMWRtZllmM2ZKeE9TV2NBeDZxL2M1YnlSVzd3ZW96T3F1QmtBYXBHYkUraGcvdCtRajlYZXBjVVBSdFlMUjVPVDVJbDdyenVoWjMrbVJvU3ZZR1dQZ3pqQ3F3aDF2U2xPZWZIN3BCWVFLNXpxQUtDb2pIK0xHc1E3SklSM3Q0VkNSbm9oK2pFK3hLaW54T1dWbEVneUp0RGhhdVBuOFI4MXROc3dZWnFnTUpiaDVMMnZ4QmlRM3k4QWFlMVFWUFYvdGhJQzZBYnhBQmhWa2ZKN1ZhSnhpaExxbmlTemgzUWw3aXJtWjlSMlhmd0lWMDNDN1N3My9Ua0hCL2xqY3RkVFhMSjFJMDRjOE5DWlgrZ3FMVXN6RWlwUE5GWERZdG1xVjVxOFlLRGs2VVJKS3FLeWRxQjYxdDh4Z2JJNXhlWEZ3dkQ4SGtybDNUcndzblFHeVJNRkYraFh2UDFIUTdMQ1BZa3dEU1dBbzk5K0dyT2RNVFBZZUJpRytSck5pYlI1YUZyMmhUNEZCdWxHYmJLREtzbUpjVkhvV0RoejJpbm1SWHlNaXE5M0RhcS94UW9EdFoweWF3bVFVY0dTZWFPSXBmOCtDYndia215cmtyZU1oT0Exam1CV2tPblNhYjY4clVEeUs3anVHUmNHeS9YLzRha1VhbGl3N3lwaDlzZnRhQUZta2s4eFllNHgzRklSRmNyazJ4dlBDMnByNCtBRjNaVjJCTT0iLCJtYWMiOiJkYTQxZDY1OTY2ZTljMTgyZWRhNGEzMGZjZDc2MjBjN2NlNzU2YTViNGQxNWE1NTI2ZmI1MWQyYjQ2ODYxZmEwIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6Imt2bGxlSmxUK05GMjF0dEtPaTMrUlE9PSIsInZhbHVlIjoiUXZHTElZRXkreHFxUU02SnZ4eVBacG9WWTRlVkd0USszV3JyVFlpU2ZaY25GSWo2WFcrRzNlbFRlUXRQczNwSXRCcEdvZEpveG9jMzBDSTgwdnZLQnc9PSIsIm1hYyI6ImQxYWI0NzU5Nzg5MDI4YWVhZmQ4Mjg1YzhkZDQzMjRkYWYwYTdhZTY5MDMxMjc0OWNiYjY0Nzc3NDQ0MTEyY2EiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300786192D9D96DD60D3D1EBC9DFAEE5F0C45EE80165CF3F3D2B3B627026AA7CFC7CA0128DD463535D32EE491ADBADF8B07596B0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040C7FB1319048ECB2EA3F23B995020110802B52D22F5EAD341AB238FBBCB6093156E443876A664BA5555D722565C2B2D04422C868CD7350555E3CC74221",
"sociable_type": "user",
"owner_id": 23460
},
{
"user_id": "23463",
"email": "[EMAIL]",
"id": 72,
"sociable_id": 23463,
"provider_user_id": "23270841",
"provider_user_token": "v1u:AQIBAHj-LzTNK2yuuuaLqifzhWb9crUNKTpk4FlQ9rjnXqp_6AEQhDhDQVa1nvWCHEvnpvSEAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMnG8KNcZLIjEnlRPxAgEQgDsGPIcKjsMU7Qel36BtM5FCQa56mYUy24_AAoqd12yjVFkq6egLqS0inp-5G4JE7frJURMV8VTw_fY14g:txqCuWLeVhgwiaFqXIvQWWrtrnFIy_4lT3VCr-sRB4g6_2lK8KcQ_6ka_qFmZhr-IeIAKmAImx6H1iIKx4Ab7XZ5MnKIh03GKbHjI0n0rGT9UYkeH21jKOxJvKaSX_TyLbxFPR6irPQyvqcpBClXI52gVJH01KzZy_dMTHFXhhDLOIhEpSrQXHG7Qo8q7OuBeSPZrU1ALi9kmAm4GTpzGTbzfl-hUt9IAfPunJOCyv3mf2Tl-MT8EyQgOFPrsP3yz9UlSyVhb40zO_bCnUrqNxjwgm_E6vgpVrwULTQbHe-43Dq-TRetjceUzT88GBgVJ0UdxXP5BRBVXcL5ir8-9ZTMaNU",
"provider_refresh_token": "5034113:[TELEGRAM_TOKEN]78ad1",
"expires": 1753837219,
"refresh_token_expires": null,
"provider": "pipedrive",
"state": "full-refresh",
"auth_scope": "base,deals:full,activities:full,contacts:full,search:read",
"retry_after": null,
"created_at": "2025-04-16 10:41:12",
"updated_at": "2025-07-30 01:00:17",
"provider_user_token_encrypted": "eyJpdiI6InVEVEl2SzIxMjd1bkNDWG9lY3YvQ0E9PSIsInZhbHVlIjoiRlJLbDZ3ZHo2dHMxUWQwdGU2YUZjV3lPWHlxQTJ0eWh4S0RTMjlSaThVcktoaWhXcTd2UXl4Mjg4bW5UUnZCZEQ5NXpuQTVKOURiMDNIa3l3K0lSWCt5azRBOEdHbitWQXhxeEpMVUZ1dnF2NVl1TTZLelZOaGNvRlBLeGpIWlpoRGloUEprd2xoNUFPcTlLcUd3WVlUU2svR1NOeXBYQ2NnMWhnK1V2aytOeVVMNzJGdVZXMU1JS3BSaGNCcmxkVjEwQ01mQXNBdWNhS1lMZWZobnZwcHBkN1R4bUVDRUNYdnNtSVJkdG5MdkN3djJBT0hMRDl1MHFGbnl4WU13ejBkUWsrdUljWkZhcTJlN0JDSGdTVzlPY0FGMUJlZi9WRGpkMUk5R20wblYwSk9VR2FuaHpLTzJNeitMbnF1V1NEMUUxRmYzaDRGZDMyaXd3Z0FjQno4SzVoYjUyTmV3UXNpRlF4TGZKNVl3dUFqdGhKVWJjRVlUUXRGalBpaXJvSGJmbS8rd25aQ2Zvc05saHRDRjlHV1VEUFFiRU5xbWRVNkxFSXV0RUZyaUlYNWMwMmhnZ0Y1VUQ4eEFkY2QyWXpnR0NidkVJSWdjVGljUjA3NDdpZW9WUHhtSlpGSGdNU2hRUTA5ZW03RGpiRFdrdytkOHJXSUxlazZNaG9iaUg2NFZYdEc3YklMeFZvblBzWmVRSDcvN2M4WUNtL3h4S2IrUW00cXhialBia3BJcW5XallBNlV5WWdhcE1ZVFBBM3RSSUVBamYvOGZEQWM5a2FJMGwyWkRSU3dlTEtPemZlQ3RXRGNDcEdYRHdMNTlTQVg2SUdUN0hVaXdZT1dUOUlrVzkrZHFBemhwWXg1cm4rSy9UOHUzcnNSM2dISlhBRTEyVUNyTkZYaFJYUlN1a2RKVHhhM2dHckR3a1JGaVZ2Wk9BVnhTclVpSEhwWTVpQTlJbXVkOUxSTGpRbDk0a1VtbE9QMVAvN3VlVEhJUHd2elowd0laNVIzZ3M3N0ZOK0NDakIwQ2FicGxoMDBhTXI0VUppUmFOZHdlWUdGV21NNFQ4RU1nY0dnWT0iLCJtYWMiOiI0ZTU4ZmJkNTdkYmY0NGE4NTJjZjlhNDExNzE2YjhlOWM2NTA5OGY2MDA4OTcyZDVlOTljY2JjZDhmMjBhMDUyIiwidGFnIjoiIn0=",
"provider_refresh_token_encrypted": "eyJpdiI6IkJGMkdRVHRKM2VTcitKNGcvQWJtUGc9PSIsInZhbHVlIjoicmFyRkxPZ1Rybm1ORXlEVjJ2TXFGTzJtM3hWaFhnUVVHN2ZlR1lRM0I5d3ozbnZTcU5EdzJqRkI2elhyNWhlenRTUXV3bjk0N1JXeklDMVAyUzBKcHc9PSIsIm1hYyI6ImJhODVjMGQyZDE3Y2ExNjc2OWVjYWJiNmFjYWVkODIyMTMyNWVhYTExMTgwYTEyMTU0MzUzZGE1YjQ5YzQ5ZjEiLCJ0YWciOiIifQ==",
"encryption_key": "0x01020300788C37CDF66ABE9301A68D5D4866AC0C197E04EEE4D904F20A59991322EBAE252301BEF4B24FF01359E934E5654617E4EEAC0000006E306C06092A864886F70D010706A05F305D020100305806092A864886F70D010701301E060960864801650304012E3011040CEB00EF45BDEA999A5558889E020110802B925F372F7BEFAF0B45E48686113D1DA430ECFCC07B1F61BA6828CC44235278EDB05C486E8068D0BE737D91",
"sociable_type": "user",
"owner_id": 23460
}
]
Project
Project
New File or DirectoryâŚ
Expand Selected
Collapse All
Options
Hide...
|
53504
|
NULL
|
NULL
|
NULL
|
|
53510
|
1874
|
19
|
2026-05-18T12:13:14.523145+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106394523_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:...
|
[{"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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\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_jupiter","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}]...
|
6075376915322808407
|
5527256463689486230
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}
Execute
Explain Plan
Browse Query History
View Parameters
Open Query Execution SettingsâŚ
In-Editor Results
Tx: Auto
Cancel Running Statements
Playground
jiminny_jupiter
Sync Changes
Hide This Notification
Code changed:...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53511
|
1874
|
20
|
2026-05-18T12:13:17.556298+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106397556_m1.jpg...
|
PhpStorm
|
faVsco.js â ScimProvisioning.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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}...
|
[{"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},{"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\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","depth":4,"on_screen":true,"value":"<?php\n\ndeclare(strict_types=1);\n\nnamespace Jiminny\\Component\\SCIM;\n\nuse Exception;\nuse Illuminate\\Contracts\\Events\\Dispatcher;\nuse Illuminate\\Database\\Eloquent\\Builder;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Component\\Acl\\RoleChangeContext;\nuse Jiminny\\Component\\Acl\\RoleChangeLogger;\nuse Jiminny\\Component\\Acl\\RoleChangeType;\nuse Jiminny\\Component\\SCIM\\Builders\\GroupFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Builders\\UsersFilterQueryBuilder;\nuse Jiminny\\Component\\SCIM\\Mutators\\GroupPatchOperation;\nuse Jiminny\\Component\\SCIM\\Mutators\\UserPatchOperation;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreGroupRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\CoreUserRequest;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetGroupByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\GetUserByQuery;\nuse Jiminny\\DTO\\SCIM\\AAD\\Request\\PatchGroup;\nuse Jiminny\\Events\\Users\\UserCreated;\nuse Jiminny\\Models\\Group;\nuse Jiminny\\Models\\JobTitle;\nuse Jiminny\\Models\\Role;\nuse Jiminny\\Models\\Team;\nuse Jiminny\\Models\\User;\nuse Jiminny\\Services\\UserService;\nuse Jiminny\\Contracts\\Acl\\RoleRepositoryInterface;\nuse Illuminate\\Support\\Facades\\Validator;\nuse Jiminny\\Rules\\DependentRolesRule;\nuse Jiminny\\Rules\\ListenerRoleCannotHaveAdminOrManagerPermissionRule;\nuse Jiminny\\Rules\\ListenerRoleRequiresListenerFeatureRule;\nuse Jiminny\\Actions\\UpdateUserRolesAction;\nuse Jiminny\\DTO\\Roles\\UserRolesSyncDTO;\nuse Sentry;\n\nclass ScimProvisioning\n{\n public function __construct(\n private readonly Dispatcher $eventDispatcher,\n private readonly UserService $userService,\n private readonly RoleChangeLogger $roleChangeLogger,\n private readonly RoleRepositoryInterface $roleRepository,\n private readonly UpdateUserRolesAction $updateUserRolesAction,\n ) {\n }\n\n public function validateUserIdInput($id, Team $team): bool\n {\n if (! User::isUuid4($id)) {\n return false;\n }\n $user = $this->getUserById($id);\n\n return $user instanceof User && $team->isSame($user->getTeam());\n }\n\n public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User\n {\n $actions = [];\n if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_FIRST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getFirstName(),\n );\n }\n if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_LAST_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getLastName(),\n );\n }\n if ((! $user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [true, 'True', 1],\n true,\n )) ||\n ($user->isStatusActive() && in_array(\n array_get(\n $dto->getRawRequest(),\n Constants::USER_PATCH_ATTR_ACTIVE,\n ),\n [false, 'False', 0],\n true,\n ))\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_ACTIVE,\n Constants::META_OPERATIONS_REPLACE,\n $user->getStatus() === 1 ? 0 : 1,\n );\n }\n if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||\n (! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())\n ) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_TITLE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getTitle(),\n );\n }\n if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailPrimaryWork(),\n );\n }\n if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getEmailOther(),\n );\n }\n if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getPrimaryPhoneNumber() ?? '',\n );\n }\n if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {\n $actions[] = $this->returnAction(\n Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getSecondaryPhoneNumber() ?? '',\n );\n }\n // no username update support. We rely on email=username in general\n\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n /** @return array{path: string, op: string, value: mixed} */\n private function returnAction(string $path, string $op, mixed $value): array\n {\n return [\n Constants::META_PATH => $path,\n Constants::META_OP => $op,\n Constants::META_VALUE => $value,\n ];\n }\n\n public function getUserById(string $id): ?User\n {\n return User::uuid($id, false)->first();\n }\n\n public function getGroupById(string $id): ?Group\n {\n return Group::uuid($id, false)->first();\n }\n\n public function validateGroupIdInput(string $id, Team $team): bool\n {\n if (! Group::isUuid4($id)) {\n return false;\n }\n\n try {\n /** @var Group|null $group */\n $group = Group::uuid($id);\n } catch (Exception) {\n return false;\n }\n\n return $group instanceof Group && $team->isSame($group->getTeam());\n }\n\n public function patchUserOperation(array $actions, User $user): User\n {\n /**\n * Supported operations\n * on emails, phones, name, title, status except remove primaryEmail\n */\n foreach ($actions as $action) {\n $user = (new UserPatchOperation($user, $action))->doUpdate();\n }\n\n return $user;\n }\n\n public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder\n {\n $query = Group::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new GroupFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool\n {\n /**\n * Supported operations\n * - replace group name\n * - add user member of the group\n */\n foreach ($dto->getActions() as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return true;\n }\n\n public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder\n {\n $query = User::query()\n ->where('team_id', $team->getId());\n\n foreach ($dto->getFilters() as $filter) {\n (new UsersFilterQueryBuilder($filter))->addToQuery($query);\n }\n\n return $query;\n }\n\n public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User\n {\n $phone = $dto->getPrimaryPhoneNumber();\n $secondaryPhone = $dto->getSecondaryPhoneNumber();\n\n if (! $this->isValidPhone($phone, $team->country_code)) {\n $phone = null;\n }\n\n if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {\n $secondaryPhone = null;\n }\n\n $isActive = $dto->getActive();\n\n $userUpdateData = [\n 'name' => $dto->getName(),\n 'secondary_email' => $dto->getEmailOther(),\n 'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,\n 'language' => $team->default_language,\n 'timezone' => $team->default_timezone,\n 'country_code' => $team->country_code,\n 'conference_slug' => $this->userService->generateSlug($dto->getName()),\n ];\n\n // Do not change phone if it is not provided\n if ($phone !== null) {\n $userUpdateData['phone'] = $phone;\n }\n\n // Do not change secondary phone if it is not provided\n if ($secondaryPhone !== null) {\n $userUpdateData['secondary_phone'] = $secondaryPhone;\n }\n\n try {\n /** @var User $newUser */\n $newUser = $team\n ->users()\n ->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])\n ->updateOrCreate(\n ['email' => $dto->getEmailPrimaryWork()],\n $userUpdateData,\n );\n\n $this->assignRolesFromScim($newUser, $dto, $team);\n\n if (! empty($dto->getTitle())) {\n $jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();\n if ($jobTitle instanceof JobTitle) {\n $newUser->update(['job_title_id' => $jobTitle->getId()]);\n } else {\n /** @var JobTitle $newJobTitle */\n $newJobTitle = $team->jobs()->create([\n 'name' => $dto->getTitle(),\n 'is_selectable' => 0,\n ]);\n $newUser->update(['job_title_id' => $newJobTitle->getId()]);\n }\n }\n\n if ($newUser->wasRecentlyCreated) {\n $this->eventDispatcher->dispatch(new UserCreated($newUser));\n }\n\n return $newUser;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n private function isValidPhone(?string $number, string $countryCode): bool\n {\n if ($number === null) {\n return true;\n }\n\n $validator = Validator::make(\n ['phone' => $number],\n ['phone' => ['phone:INTERNATIONAL,' . $countryCode]]\n );\n\n return ! $validator->fails();\n }\n\n private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void\n {\n $requestedRoles = $dto->getRoles();\n\n if (empty($requestedRoles)) {\n if (! $user->roles()->exists()) {\n $user->addRole(User::ROLE_ANALYST);\n /** @var Role $role */\n $role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();\n\n $this->roleChangeLogger->log(\n activeUser: null,\n affected: $user,\n role: $role,\n type: $user->wasRecentlyCreated\n ? RoleChangeType::CREATE_USER\n : RoleChangeType::ADD_ROLE,\n context: RoleChangeContext::SCIM,\n );\n }\n\n return;\n }\n\n $visibleRoles = $this->roleRepository->findAllByTeam($team->getId());\n\n $roleIds = [];\n foreach ($requestedRoles as $roleName) {\n $role = $visibleRoles->firstWhere('name', $roleName);\n\n if ($role === null) {\n continue;\n }\n\n $roleIds[] = $role->getId();\n }\n\n if (empty($roleIds)) {\n return;\n }\n\n $validator = Validator::make(\n ['roles' => $roleIds],\n [\n 'roles' => [\n 'required',\n 'array',\n 'min:1',\n new DependentRolesRule($visibleRoles),\n new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),\n ],\n 'roles.*' => [\n 'required',\n 'distinct',\n 'in:' . $visibleRoles->pluck('id')->implode(','),\n new ListenerRoleRequiresListenerFeatureRule($team),\n ],\n ]\n );\n\n if ($validator->fails()) {\n return;\n }\n\n $roles = $visibleRoles->whereIn('id', $roleIds);\n\n $dto = new UserRolesSyncDTO(\n user: $user,\n activeUser: null,\n roles: $roles,\n );\n\n $this->updateUserRolesAction->execute($dto);\n }\n\n public function deleteGroup($group): bool\n {\n $users = $group->members()->get();\n\n foreach ($users as $user) {\n $user->update(['group_id' => null]);\n }\n\n return $group->delete();\n }\n\n public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group\n {\n try {\n /** @var Group|null $existingGroup */\n $existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();\n\n if ($existingGroup) {\n if ($existingGroup->getAttribute('deleted_at')) {\n $existingGroup->restore();\n }\n\n return $existingGroup;\n }\n\n /** @var Group $newGroup */\n $newGroup = $team->groups()->updateOrCreate(\n ['name' => $dto->getDisplayName()],\n [\n 'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),\n 'user_id' => $team->getOwner()->getId(),\n 'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),\n 'default_timezone' => $team->getDefaultTimezone(),\n 'default_language' => $team->getDefaultLanguage(),\n 'country_code' => $team->getCountryCode(),\n 'playbook_id' => $team->getDefaultPlaybookId(),\n ],\n );\n\n return $newGroup;\n } catch (Exception $exception) {\n Sentry::captureException($exception);\n\n return null;\n }\n }\n\n public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group\n {\n $actions = [];\n\n if ($group->getName() !== $dto->getDisplayName()) {\n $actions[] = $this->returnAction(\n Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,\n Constants::META_OPERATIONS_REPLACE,\n $dto->getDisplayName(),\n );\n }\n\n foreach ($actions as $action) {\n $group = (new GroupPatchOperation($group, $action))->doUpdate();\n }\n\n return $group;\n }\n}","role_description":"text entry area","is_enabled":true,"is_focused":true,"is_selected":false,"is_expanded":false}]...
|
775695417232670985
|
5527291647994408855
|
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
<?php
declare(strict_types=1);
namespace Jiminny\Component\SCIM;
use Exception;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Validator;
use Jiminny\Component\Acl\RoleChangeContext;
use Jiminny\Component\Acl\RoleChangeLogger;
use Jiminny\Component\Acl\RoleChangeType;
use Jiminny\Component\SCIM\Builders\GroupFilterQueryBuilder;
use Jiminny\Component\SCIM\Builders\UsersFilterQueryBuilder;
use Jiminny\Component\SCIM\Mutators\GroupPatchOperation;
use Jiminny\Component\SCIM\Mutators\UserPatchOperation;
use Jiminny\DTO\SCIM\AAD\Request\CoreGroupRequest;
use Jiminny\DTO\SCIM\AAD\Request\CoreUserRequest;
use Jiminny\DTO\SCIM\AAD\Request\GetGroupByQuery;
use Jiminny\DTO\SCIM\AAD\Request\GetUserByQuery;
use Jiminny\DTO\SCIM\AAD\Request\PatchGroup;
use Jiminny\Events\Users\UserCreated;
use Jiminny\Models\Group;
use Jiminny\Models\JobTitle;
use Jiminny\Models\Role;
use Jiminny\Models\Team;
use Jiminny\Models\User;
use Jiminny\Services\UserService;
use Jiminny\Contracts\Acl\RoleRepositoryInterface;
use Illuminate\Support\Facades\Validator;
use Jiminny\Rules\DependentRolesRule;
use Jiminny\Rules\ListenerRoleCannotHaveAdminOrManagerPermissionRule;
use Jiminny\Rules\ListenerRoleRequiresListenerFeatureRule;
use Jiminny\Actions\UpdateUserRolesAction;
use Jiminny\DTO\Roles\UserRolesSyncDTO;
use Sentry;
class ScimProvisioning
{
public function __construct(
private readonly Dispatcher $eventDispatcher,
private readonly UserService $userService,
private readonly RoleChangeLogger $roleChangeLogger,
private readonly RoleRepositoryInterface $roleRepository,
private readonly UpdateUserRolesAction $updateUserRolesAction,
) {
}
public function validateUserIdInput($id, Team $team): bool
{
if (! User::isUuid4($id)) {
return false;
}
$user = $this->getUserById($id);
return $user instanceof User && $team->isSame($user->getTeam());
}
public function updateUserAttributesIfChanged(User $user, CoreUserRequest $dto, Team $team): User
{
$actions = [];
if (! str_starts_with($user->getName(), $dto->getFirstName() . ' ')) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_FIRST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getFirstName(),
);
}
if (! str_contains($user->getName(), ' ' . $dto->getLastName())) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_LAST_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getLastName(),
);
}
if ((! $user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[true, 'True', 1],
true,
)) ||
($user->isStatusActive() && in_array(
array_get(
$dto->getRawRequest(),
Constants::USER_PATCH_ATTR_ACTIVE,
),
[false, 'False', 0],
true,
))
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_ACTIVE,
Constants::META_OPERATIONS_REPLACE,
$user->getStatus() === 1 ? 0 : 1,
);
}
if ((! $user->job()->exists() && ! in_array($dto->getTitle(), ['', null])) ||
(! in_array($dto->getTitle(), ['', null]) && $user->getJobTitle()->name !== $dto->getTitle())
) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_TITLE,
Constants::META_OPERATIONS_REPLACE,
$dto->getTitle(),
);
}
if ($user->getEmailAddress() !== $dto->getEmailPrimaryWork()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PRIMARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailPrimaryWork(),
);
}
if ($user->getSecondaryEmailAddress() !== $dto->getEmailOther()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_SECONDARY_EMAIL,
Constants::META_OPERATIONS_REPLACE,
$dto->getEmailOther(),
);
}
if ($user->getAttribute('phone') !== $dto->getPrimaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER,
Constants::META_OPERATIONS_REPLACE,
$dto->getPrimaryPhoneNumber() ?? '',
);
}
if ($user->getAttribute('secondary_phone') !== $dto->getSecondaryPhoneNumber()) {
$actions[] = $this->returnAction(
Constants::USER_PATCH_ATTR_PHONE_NUMBER_MOBILE,
Constants::META_OPERATIONS_REPLACE,
$dto->getSecondaryPhoneNumber() ?? '',
);
}
// no username update support. We rely on email=username in general
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
/** @return array{path: string, op: string, value: mixed} */
private function returnAction(string $path, string $op, mixed $value): array
{
return [
Constants::META_PATH => $path,
Constants::META_OP => $op,
Constants::META_VALUE => $value,
];
}
public function getUserById(string $id): ?User
{
return User::uuid($id, false)->first();
}
public function getGroupById(string $id): ?Group
{
return Group::uuid($id, false)->first();
}
public function validateGroupIdInput(string $id, Team $team): bool
{
if (! Group::isUuid4($id)) {
return false;
}
try {
/** @var Group|null $group */
$group = Group::uuid($id);
} catch (Exception) {
return false;
}
return $group instanceof Group && $team->isSame($group->getTeam());
}
public function patchUserOperation(array $actions, User $user): User
{
/**
* Supported operations
* on emails, phones, name, title, status except remove primaryEmail
*/
foreach ($actions as $action) {
$user = (new UserPatchOperation($user, $action))->doUpdate();
}
return $user;
}
public function translateQueryStringsToGroupModelQuery(GetGroupByQuery $dto, Team $team): Builder
{
$query = Group::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new GroupFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function patchGroupOperation(PatchGroup $dto, Team $team, Group $group): bool
{
/**
* Supported operations
* - replace group name
* - add user member of the group
*/
foreach ($dto->getActions() as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return true;
}
public function translateQueryStringsToUserModelQuery(GetUserByQuery $dto, Team $team): Builder
{
$query = User::query()
->where('team_id', $team->getId());
foreach ($dto->getFilters() as $filter) {
(new UsersFilterQueryBuilder($filter))->addToQuery($query);
}
return $query;
}
public function createOrUpdateNewUser(CoreUserRequest $dto, Team $team): ?User
{
$phone = $dto->getPrimaryPhoneNumber();
$secondaryPhone = $dto->getSecondaryPhoneNumber();
if (! $this->isValidPhone($phone, $team->country_code)) {
$phone = null;
}
if (! $this->isValidPhone($secondaryPhone, $team->country_code)) {
$secondaryPhone = null;
}
$isActive = $dto->getActive();
$userUpdateData = [
'name' => $dto->getName(),
'secondary_email' => $dto->getEmailOther(),
'status' => $isActive ? User::STATUS_ACTIVE : User::STATUS_DEACTIVATED,
'language' => $team->default_language,
'timezone' => $team->default_timezone,
'country_code' => $team->country_code,
'conference_slug' => $this->userService->generateSlug($dto->getName()),
];
// Do not change phone if it is not provided
if ($phone !== null) {
$userUpdateData['phone'] = $phone;
}
// Do not change secondary phone if it is not provided
if ($secondaryPhone !== null) {
$userUpdateData['secondary_phone'] = $secondaryPhone;
}
try {
/** @var User $newUser */
$newUser = $team
->users()
->whereIn('users.status', [User::STATUS_ACTIVE, User::STATUS_DEACTIVATED])
->updateOrCreate(
['email' => $dto->getEmailPrimaryWork()],
$userUpdateData,
);
$this->assignRolesFromScim($newUser, $dto, $team);
if (! empty($dto->getTitle())) {
$jobTitle = $team->jobs()->where('name', $dto->getTitle())->first();
if ($jobTitle instanceof JobTitle) {
$newUser->update(['job_title_id' => $jobTitle->getId()]);
} else {
/** @var JobTitle $newJobTitle */
$newJobTitle = $team->jobs()->create([
'name' => $dto->getTitle(),
'is_selectable' => 0,
]);
$newUser->update(['job_title_id' => $newJobTitle->getId()]);
}
}
if ($newUser->wasRecentlyCreated) {
$this->eventDispatcher->dispatch(new UserCreated($newUser));
}
return $newUser;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
private function isValidPhone(?string $number, string $countryCode): bool
{
if ($number === null) {
return true;
}
$validator = Validator::make(
['phone' => $number],
['phone' => ['phone:INTERNATIONAL,' . $countryCode]]
);
return ! $validator->fails();
}
private function assignRolesFromScim(User $user, CoreUserRequest $dto, Team $team): void
{
$requestedRoles = $dto->getRoles();
if (empty($requestedRoles)) {
if (! $user->roles()->exists()) {
$user->addRole(User::ROLE_ANALYST);
/** @var Role $role */
$role = Role::query()->where(['name' => User::ROLE_ANALYST])->firstOrFail();
$this->roleChangeLogger->log(
activeUser: null,
affected: $user,
role: $role,
type: $user->wasRecentlyCreated
? RoleChangeType::CREATE_USER
: RoleChangeType::ADD_ROLE,
context: RoleChangeContext::SCIM,
);
}
return;
}
$visibleRoles = $this->roleRepository->findAllByTeam($team->getId());
$roleIds = [];
foreach ($requestedRoles as $roleName) {
$role = $visibleRoles->firstWhere('name', $roleName);
if ($role === null) {
continue;
}
$roleIds[] = $role->getId();
}
if (empty($roleIds)) {
return;
}
$validator = Validator::make(
['roles' => $roleIds],
[
'roles' => [
'required',
'array',
'min:1',
new DependentRolesRule($visibleRoles),
new ListenerRoleCannotHaveAdminOrManagerPermissionRule($visibleRoles),
],
'roles.*' => [
'required',
'distinct',
'in:' . $visibleRoles->pluck('id')->implode(','),
new ListenerRoleRequiresListenerFeatureRule($team),
],
]
);
if ($validator->fails()) {
return;
}
$roles = $visibleRoles->whereIn('id', $roleIds);
$dto = new UserRolesSyncDTO(
user: $user,
activeUser: null,
roles: $roles,
);
$this->updateUserRolesAction->execute($dto);
}
public function deleteGroup($group): bool
{
$users = $group->members()->get();
foreach ($users as $user) {
$user->update(['group_id' => null]);
}
return $group->delete();
}
public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group
{
try {
/** @var Group|null $existingGroup */
$existingGroup = $team->groups()->withTrashed()->where('name', $dto->getDisplayName())->first();
if ($existingGroup) {
if ($existingGroup->getAttribute('deleted_at')) {
$existingGroup->restore();
}
return $existingGroup;
}
/** @var Group $newGroup */
$newGroup = $team->groups()->updateOrCreate(
['name' => $dto->getDisplayName()],
[
'slug' => str_replace(' ', '-', strtolower($dto->getDisplayName())),
'user_id' => $team->getOwner()->getId(),
'transcription_model_locale_id' => $team->getTranscriptionModelLocaleId(),
'default_timezone' => $team->getDefaultTimezone(),
'default_language' => $team->getDefaultLanguage(),
'country_code' => $team->getCountryCode(),
'playbook_id' => $team->getDefaultPlaybookId(),
],
);
return $newGroup;
} catch (Exception $exception) {
Sentry::captureException($exception);
return null;
}
}
public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Group
{
$actions = [];
if ($group->getName() !== $dto->getDisplayName()) {
$actions[] = $this->returnAction(
Constants::GROUP_PATCH_ATTRIBUTE_DISPLAY_NAME,
Constants::META_OPERATIONS_REPLACE,
$dto->getDisplayName(),
);
}
foreach ($actions as $action) {
$group = (new GroupPatchOperation($group, $action))->doUpdate();
}
return $group;
}
}...
|
53510
|
NULL
|
NULL
|
NULL
|
|
53512
|
1875
|
5
|
2026-05-18T12:13:19.475576+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106399475_m2.jpg...
|
Firefox
|
[JY-20879] Enable users to use their new activity [JY-20879] Enable users to use their new activity types - Jira â Work...
|
1
|
jiminny.atlassian.net/browse/JY-20879
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
PhpStormVIewINavigarecodeLaravelRefactorJOOISWindo PhpStormVIewINavigarecodeLaravelRefactorJOOISWindowFV faVsco.js?9 master k. vProledeyC ActivityController.ongC BaseService.onpŠ SoftPhoneManager.phpg constants.ong(C) CoreUserRequest.onpseimFrovistoning.onpxŠ CoreUser.php⢠Scimintertace.ongD SeederW sentryW senlalizerSettingsSidekickW Slackw Transcriptionl TranscriotionSummarvaaiwillio⢠M Conference⢠ConferenceHandlerv ConferenceManadeC) SoftPhoneManader.ohoŠ ConferenceCallbackHandler.phpŠ ConferenceManager.phpIMnTOTM Event0 ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onpŠ TwilioRepository.php0 Uploader0 UrlGeneratora Utility0 Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsD Activities>M AnalvticcCalendarsv MCrmM Huhsnotclass Sc1mProv1s10n1ngprivate function assignRolesFromScim(Usen Susen, ConeUsenRequest Sdto, Tean Steam): void['roles' => SroleIdsl."roles' =>'array'min: 1'new DependentRolesPule(SvisibleRoles)inew ListenerRoleCannotHaveAdmin0rManagerPermissionRule(SvisibleRoles),'roles.*' => [anstinet""an.⢠SvisibleRoles->pluck( value: 'id')->implode( value: ',').now lictononPoloPonuinocl ictonenSostunePule/ctoam)lif (Svalidator->fails0) {return?Sroles = SvisibleRoles->whereIn( kev: 'id'. Srolelds):Sdto = new UserRolesSvncdT0dactivelser: nulu.noles: Scoles,Sthis->undatellserRol.esAction->executeSdto):public function deleteGroup(Sgroup): boolf...}public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): GroD IntegrationApp⢠M TraitsC) Addl avoutEntities.nhnŠ AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountle RullbornCommand Ahctraat nhn(e) RullbornDinaCommand nhn=laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]# console [euyA console [STAGING] X554555556557558BLTS'_563566-567568569570v Tx: AutovGo jiminny_jupiterwhere crm_configuration_id = 1 and pl.playbook_id = 175;019 A19 V17 ^ Vselect * from teamsSELECT r.* FROM automated_reports rjoin teams t on r.team id = t.idhckE r.trequency = "dallyAND t.status = 'active'AND (r.expires.at >= now() OR r.expires.at IS NULL);1 automated_report_results where report 1d IN (18, 339select * from users where team_id = 1 and id = 1047;SELE * FROMIsochal accounts WHERE soctable 10 = 1047select * from activity_searches where id = 10932â˘select * from activity_search_filters where activity_search_id = 10932;select * fromstomated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_reports where id IN (55);select * from automated_report_results where id IN (81);select * from users where id IN (10633, 13987, 11985);select * from users where group_id IN (3710);SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuidselect * from teams;select * from accounts where team_id = 1:select * trom automated report results where media type = "pdt' and status = 2SFLECT * FROM automated report results WHERE uuid_ to_ bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid)select * from teams where id = 1029;select * fromcrm_configurations where provider = 'pipedrive':SELECTCONCAT(u,id. CASE WHEN u.id = t.owner id THEN ⢠(owner)' ELSE â˘â˘ END) AS user idisa.*t.owner id FROM social accounts saJJOuN users u on u.id= sa.sociable idi1.n<->1: on +.id = u.tean idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idl. "23460 ownen)""idi. kosuppont Dally ⢠4m len100% 1⢠Mon 18 May 15:13:19AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token FalliSClM Role Manageme+0 ..inp on LineWARN Metadata found iin doc-comment for method9/ 10 tacke doneWrite unit tests for SCIM role management10) Contact Mario to vodate customer10 / 10 tasks doneselm role managementtor leamtallor has been successtully implemented. Here's what was completed:Implementation Summary:1. CoreUserRequest DTO - Added role parsina from SCIM requests2. SCIM Constants - Added META ROLES and USER_PATCH_ATTR_ ROLES constants3. RoleAttr Mutator - Created mutator for handlina role assianments via SCIM PATCH operations4. ScimProvisioning - Updated to handle roles during user creation with proper validation5. ListenerRoleCannotHaveAdminOrManagerPermissionRule - Created validation rule to prevent listener role fromhaving admin/manager permissions6. CoreUser Response - Updated to include roles in SClM responses7. Unit Tests - Created comprehensive tests for the validation ruleKey Features:⢠Customers can now assign roles via SCIM (recorder, recorder & voice, analyst, listener, admin, manager)⢠Validation ensures listener role is onlv assianable if the LISTENER ROLE feature flaa is enabled⢠Listener role cannot be combined with admin or manager permissions⢠Uses existing UpdateUserRolesAction for role syncing and logging⢠Follows platform validation rules (DependentRolesRule, ListenerRoleRequiresListenerFeatureRule)Next Step: Please contact Mario to update the customer that SCIM role management is now available for Teamtailorintearationapp/Component/SClM/ Constants.php +3app/Component/SCIM/ ÂŽ ScimProvisioning.php +85-15nse/ CoreUser.php +21ann/Comnonent/SCIM/Mutatore/Attributes/Ueer/M PoleAttr.nhn +17-ites/User/ áş RoleAttrTest.nhn +224* Reiect alliiAccent alliAsk anvthina 884-L)ÂŤ Code SWF-1.6WN Windsurf Toams 284-57UTF.8io 4 spaces...
|
NULL
|
-8480949651831783523
|
NULL
|
idle
|
ocr
|
NULL
|
PhpStormVIewINavigarecodeLaravelRefactorJOOISWindo PhpStormVIewINavigarecodeLaravelRefactorJOOISWindowFV faVsco.js?9 master k. vProledeyC ActivityController.ongC BaseService.onpŠ SoftPhoneManager.phpg constants.ong(C) CoreUserRequest.onpseimFrovistoning.onpxŠ CoreUser.php⢠Scimintertace.ongD SeederW sentryW senlalizerSettingsSidekickW Slackw Transcriptionl TranscriotionSummarvaaiwillio⢠M Conference⢠ConferenceHandlerv ConferenceManadeC) SoftPhoneManader.ohoŠ ConferenceCallbackHandler.phpŠ ConferenceManager.phpIMnTOTM Event0 ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onpŠ TwilioRepository.php0 Uploader0 UrlGeneratora Utility0 Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsD Activities>M AnalvticcCalendarsv MCrmM Huhsnotclass Sc1mProv1s10n1ngprivate function assignRolesFromScim(Usen Susen, ConeUsenRequest Sdto, Tean Steam): void['roles' => SroleIdsl."roles' =>'array'min: 1'new DependentRolesPule(SvisibleRoles)inew ListenerRoleCannotHaveAdmin0rManagerPermissionRule(SvisibleRoles),'roles.*' => [anstinet""an.⢠SvisibleRoles->pluck( value: 'id')->implode( value: ',').now lictononPoloPonuinocl ictonenSostunePule/ctoam)lif (Svalidator->fails0) {return?Sroles = SvisibleRoles->whereIn( kev: 'id'. Srolelds):Sdto = new UserRolesSvncdT0dactivelser: nulu.noles: Scoles,Sthis->undatellserRol.esAction->executeSdto):public function deleteGroup(Sgroup): boolf...}public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): GroD IntegrationApp⢠M TraitsC) Addl avoutEntities.nhnŠ AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountle RullbornCommand Ahctraat nhn(e) RullbornDinaCommand nhn=laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]# console [euyA console [STAGING] X554555556557558BLTS'_563566-567568569570v Tx: AutovGo jiminny_jupiterwhere crm_configuration_id = 1 and pl.playbook_id = 175;019 A19 V17 ^ Vselect * from teamsSELECT r.* FROM automated_reports rjoin teams t on r.team id = t.idhckE r.trequency = "dallyAND t.status = 'active'AND (r.expires.at >= now() OR r.expires.at IS NULL);1 automated_report_results where report 1d IN (18, 339select * from users where team_id = 1 and id = 1047;SELE * FROMIsochal accounts WHERE soctable 10 = 1047select * from activity_searches where id = 10932â˘select * from activity_search_filters where activity_search_id = 10932;select * fromstomated_reports order by id desc;select * from automated_report_results order by id desc;select * from automated_reports where id IN (55);select * from automated_report_results where id IN (81);select * from users where id IN (10633, 13987, 11985);select * from users where group_id IN (3710);SELECT * FROM automated_reports WHERE uuid_to_bin('18a06a75-afd2-476f-aadc-14d4057bdda2') = uuid;SELECT * FROM automated_report_results WHERE uuid_to_bin('582d4b50-8cd3-42a9-9819-d676ff8f3b43') = uuidselect * from teams;select * from accounts where team_id = 1:select * trom automated report results where media type = "pdt' and status = 2SFLECT * FROM automated report results WHERE uuid_ to_ bin('82e74956-6144-4cd1-a3d3-af985c3070a4') = uuid)select * from teams where id = 1029;select * fromcrm_configurations where provider = 'pipedrive':SELECTCONCAT(u,id. CASE WHEN u.id = t.owner id THEN ⢠(owner)' ELSE â˘â˘ END) AS user idisa.*t.owner id FROM social accounts saJJOuN users u on u.id= sa.sociable idi1.n<->1: on +.id = u.tean idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idl. "23460 ownen)""idi. kosuppont Dally ⢠4m len100% 1⢠Mon 18 May 15:13:19AskJiminnyReportActivityServiceTest vCascadeImplement Trial OwneFixing Redis Rate LimSalestorce Token FalliSClM Role Manageme+0 ..inp on LineWARN Metadata found iin doc-comment for method9/ 10 tacke doneWrite unit tests for SCIM role management10) Contact Mario to vodate customer10 / 10 tasks doneselm role managementtor leamtallor has been successtully implemented. Here's what was completed:Implementation Summary:1. CoreUserRequest DTO - Added role parsina from SCIM requests2. SCIM Constants - Added META ROLES and USER_PATCH_ATTR_ ROLES constants3. RoleAttr Mutator - Created mutator for handlina role assianments via SCIM PATCH operations4. ScimProvisioning - Updated to handle roles during user creation with proper validation5. ListenerRoleCannotHaveAdminOrManagerPermissionRule - Created validation rule to prevent listener role fromhaving admin/manager permissions6. CoreUser Response - Updated to include roles in SClM responses7. Unit Tests - Created comprehensive tests for the validation ruleKey Features:⢠Customers can now assign roles via SCIM (recorder, recorder & voice, analyst, listener, admin, manager)⢠Validation ensures listener role is onlv assianable if the LISTENER ROLE feature flaa is enabled⢠Listener role cannot be combined with admin or manager permissions⢠Uses existing UpdateUserRolesAction for role syncing and logging⢠Follows platform validation rules (DependentRolesRule, ListenerRoleRequiresListenerFeatureRule)Next Step: Please contact Mario to update the customer that SCIM role management is now available for Teamtailorintearationapp/Component/SClM/ Constants.php +3app/Component/SCIM/ ÂŽ ScimProvisioning.php +85-15nse/ CoreUser.php +21ann/Comnonent/SCIM/Mutatore/Attributes/Ueer/M PoleAttr.nhn +17-ites/User/ áş RoleAttrTest.nhn +224* Reiect alliiAccent alliAsk anvthina 884-L)ÂŤ Code SWF-1.6WN Windsurf Toams 284-57UTF.8io 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53513
|
1874
|
21
|
2026-05-18T12:13:20.587513+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106400587_m1.jpg...
|
Firefox
|
[JY-20879] Enable users to use their new activity [JY-20879] Enable users to use their new activity types - Jira â Work...
|
1
|
jiminny.atlassian.net/browse/JY-20879
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
+FirefoxFileEditViewHistoryBookmarksProfilesToolsW +FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 2m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)enhomeEditViewTabâ˘$18F Prok⢠Cos: | @ app.c | Allov | O PipeK tuY-7 (Y-a [Y-8⢠Mon 18 May 15:13A UY-⢠JminnyD Projects |E3 SSH⢠Home| Salesforce O 8 [ Ee Datadog * Claude3 CircleciA Sentry0 Tasks7 Insights & CoachinâŚ0 DevDD Al Bookmarka8 JMINNYSearch+ CreateAsk Rovo* For you⢠Recent |# Starred8. AppsQ SpacesStarred§ Service-DeskJiminny (Old)spaces/Jmicay ONew) / $ JY-18309 / [] JY-20771Call Scoring filter for Exec reportsâ˘1|Backdog~** Improve Story⢠Details |⢠Description |Now that we have the call scoring feature, customers are asking for their report to be done only on calls with certain scores (either high or low).|⢠Include the call scoring fiter in the Exec Reports seftion in Kiosk⢠use the same dropdown structure that we have in OD⢠put it before Recipients⢠ensure the scores filter applied for the report when fetching the calls for sanalisysAssignee& UnassignedAssign to meReporter2 Galya DimitrovaJiminny (New)I CD Platform TeamSubtasksIID Enterprise Stability L..Quick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismiss(ID SE Kanban= More spaces= FiltersDashboardsOperationsLinked work itemsActivityWork logDevelopmentQ Open with VS Code!J Create branch, Create commit |Confluence1: TeamsAooacomieWho is working on this.Status update...ComponentsPlatform% Customise sidebarPro tip: press M to colSub-ProductAdd optionsLabelsStory point est3:13 PM [Platform] Refinement ÂŽ100% C8⢠Mon 18 May 15:13:205Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
-6865319801732203182
|
NULL
|
visual_change
|
ocr
|
NULL
|
+FirefoxFileEditViewHistoryBookmarksProfilesToolsW +FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 2m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)enhomeEditViewTabâ˘$18F Prok⢠Cos: | @ app.c | Allov | O PipeK tuY-7 (Y-a [Y-8⢠Mon 18 May 15:13A UY-⢠JminnyD Projects |E3 SSH⢠Home| Salesforce O 8 [ Ee Datadog * Claude3 CircleciA Sentry0 Tasks7 Insights & CoachinâŚ0 DevDD Al Bookmarka8 JMINNYSearch+ CreateAsk Rovo* For you⢠Recent |# Starred8. AppsQ SpacesStarred§ Service-DeskJiminny (Old)spaces/Jmicay ONew) / $ JY-18309 / [] JY-20771Call Scoring filter for Exec reportsâ˘1|Backdog~** Improve Story⢠Details |⢠Description |Now that we have the call scoring feature, customers are asking for their report to be done only on calls with certain scores (either high or low).|⢠Include the call scoring fiter in the Exec Reports seftion in Kiosk⢠use the same dropdown structure that we have in OD⢠put it before Recipients⢠ensure the scores filter applied for the report when fetching the calls for sanalisysAssignee& UnassignedAssign to meReporter2 Galya DimitrovaJiminny (New)I CD Platform TeamSubtasksIID Enterprise Stability L..Quick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismiss(ID SE Kanban= More spaces= FiltersDashboardsOperationsLinked work itemsActivityWork logDevelopmentQ Open with VS Code!J Create branch, Create commit |Confluence1: TeamsAooacomieWho is working on this.Status update...ComponentsPlatform% Customise sidebarPro tip: press M to colSub-ProductAdd optionsLabelsStory point est3:13 PM [Platform] Refinement ÂŽ100% C8⢠Mon 18 May 15:13:205Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53514
|
1875
|
6
|
2026-05-18T12:13:22.103670+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106402103_m2.jpg...
|
Firefox
|
[JY-20879] Enable users to use their new activity [JY-20879] Enable users to use their new activity types - Jira â Work...
|
1
|
jiminny.atlassian.net/browse/JY-20879
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
Service-Desk - Queues - Platform team - Service space - Jira
Usage | Windsurf
Usage | Windsurf
Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app
Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app
Pipelines - jiminny/app
Pipelines - jiminny/app
[SRD-6848] Sidekick SMS issue - Jira
[SRD-6848] Sidekick SMS issue - Jira
CloudWatch | us-east-2
CloudWatch | us-east-2
CloudWatch | us-east-2
CloudWatch | us-east-2
Jiminny
Jiminny
Jiminny\Exceptions\SocialAccountTokenInvalidException: Your Salesforce account has become disconnected. Please login to Jiminny to reconnect. â jiminny â app
Jiminny\Exceptions\SocialAccountTokenInvalidException: Your Salesforce account has become disconnected. Please login to Jiminny to reconnect. â jiminny â app
Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app
Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app
[SRD-6862] âUser does not have any of the necessary access rightsâ when trying to see another teamâs performance scored with the AI ACS in team insights. - Jira
[SRD-6862] âUser does not have any of the necessary access rightsâ when trying to see another teamâs performance scored with the AI ACS in team insights. - Jira
New Tab
New Tab
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20771] Call Scoring filter for Exec reports - Jira
[JY-20771] Call Scoring filter for Exec reports - Jira...
|
[{"role":"AXRadioButton","text [{"role":"AXRadioButton","text":"Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira","depth":4,"bounds":{"left":0.0,"top":0.0518755,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.06304868,"width":0.10106383,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Service-Desk - Queues - Platform team - Service space - Jira","depth":4,"bounds":{"left":0.0,"top":0.08459697,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Service-Desk - Queues - Platform team - Service space - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.09577015,"width":0.10721409,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Usage | Windsurf","depth":4,"bounds":{"left":0.0,"top":0.11731844,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Usage | Windsurf","depth":5,"bounds":{"left":0.013297873,"top":0.12849163,"width":0.029920213,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.15003991,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.16121309,"width":0.1796875,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Pipelines - jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.18276137,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Pipelines - jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.19393456,"width":0.039228722,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6848] Sidekick SMS issue - Jira","depth":4,"bounds":{"left":0.0,"top":0.21548285,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6848] Sidekick SMS issue - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.22665602,"width":0.06632314,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"bounds":{"left":0.0,"top":0.2482043,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"bounds":{"left":0.013297873,"top":0.25937748,"width":0.041223403,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"CloudWatch | us-east-2","depth":4,"bounds":{"left":0.0,"top":0.28092578,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"CloudWatch | us-east-2","depth":5,"bounds":{"left":0.013297873,"top":0.29209897,"width":0.041223403,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Jiminny","depth":4,"bounds":{"left":0.0,"top":0.31364724,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Jiminny","depth":5,"bounds":{"left":0.013297873,"top":0.32482043,"width":0.013131649,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Jiminny\\Exceptions\\SocialAccountTokenInvalidException: Your Salesforce account has become disconnected. Please login to Jiminny to reconnect. â jiminny â app","depth":4,"bounds":{"left":0.0,"top":0.3463687,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Jiminny\\Exceptions\\SocialAccountTokenInvalidException: Your Salesforce account has become disconnected. Please login to Jiminny to reconnect. â jiminny â app","depth":5,"bounds":{"left":0.013297873,"top":0.3575419,"width":0.2847407,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app","depth":4,"bounds":{"left":0.0,"top":0.3790902,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app","depth":5,"bounds":{"left":0.013297873,"top":0.39026338,"width":0.1796875,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[SRD-6862] âUser does not have any of the necessary access rightsâ when trying to see another teamâs performance scored with the AI ACS in team insights. - Jira","depth":4,"bounds":{"left":0.0,"top":0.41181165,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[SRD-6862] âUser does not have any of the necessary access rightsâ when trying to see another teamâs performance scored with the AI ACS in team insights. - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.42298484,"width":0.2835771,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"New Tab","depth":4,"bounds":{"left":0.0,"top":0.4445331,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"New Tab","depth":5,"bounds":{"left":0.013297873,"top":0.4557063,"width":0.014960106,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira","depth":4,"bounds":{"left":0.0,"top":0.4772546,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.4884278,"width":0.15259309,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXRadioButton","text":"[JY-20771] Call Scoring filter for Exec reports - Jira","depth":4,"bounds":{"left":0.0,"top":0.509976,"width":0.07962101,"height":0.032721467},"on_screen":true,"help_text":"","role_description":"tab","subrole":"AXTabButton","is_enabled":true,"is_focused":false,"is_selected":false},{"role":"AXStaticText","text":"[JY-20771] Call Scoring filter for Exec reports - Jira","depth":5,"bounds":{"left":0.013297873,"top":0.5211492,"width":0.08909574,"height":0.010774142},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
-460666390169451348
|
-3384569468428692021
|
visual_change
|
accessibility
|
NULL
|
Platform Sprint 4 Q2 - Platform Team - Scrum Board Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Platform Sprint 4 Q2 - Platform Team - Scrum Board - Jira
Service-Desk - Queues - Platform team - Service space - Jira
Service-Desk - Queues - Platform team - Service space - Jira
Usage | Windsurf
Usage | Windsurf
Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app
Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app
Pipelines - jiminny/app
Pipelines - jiminny/app
[SRD-6848] Sidekick SMS issue - Jira
[SRD-6848] Sidekick SMS issue - Jira
CloudWatch | us-east-2
CloudWatch | us-east-2
CloudWatch | us-east-2
CloudWatch | us-east-2
Jiminny
Jiminny
Jiminny\Exceptions\SocialAccountTokenInvalidException: Your Salesforce account has become disconnected. Please login to Jiminny to reconnect. â jiminny â app
Jiminny\Exceptions\SocialAccountTokenInvalidException: Your Salesforce account has become disconnected. Please login to Jiminny to reconnect. â jiminny â app
Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app
Allow owner's role to be selected when setting up a trial by LakyLak ¡ Pull Request #12092 ¡ jiminny/app
[SRD-6862] âUser does not have any of the necessary access rightsâ when trying to see another teamâs performance scored with the AI ACS in team insights. - Jira
[SRD-6862] âUser does not have any of the necessary access rightsâ when trying to see another teamâs performance scored with the AI ACS in team insights. - Jira
New Tab
New Tab
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20912] Fallback mechanism for users with active SF tokens for CRM Matching - Jira
[JY-20771] Call Scoring filter for Exec reports - Jira
[JY-20771] Call Scoring filter for Exec reports - Jira...
|
53512
|
NULL
|
NULL
|
NULL
|
|
53515
|
1874
|
22
|
2026-05-18T12:13:23.063549+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106403063_m1.jpg...
|
Firefox
|
Meet - [Platform] Refinement đ â Work
|
1
|
meet.google.com/cxs-eips-npt?authuser=lukas.kovali meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com...
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
FirefoxFileEditViewHistoryBookmarksProfilesToolsWi FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 2m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+18Nikolay Yankov (Presenting)einhomeEditViewtonetM InboF Projt⢠Cos: | @ app.c | Allov | O Pipe⢠Jminny8 JMINNY* For you⢠Recent |# Starred8. AppsQ SpacesStarred§ Service-DeskJiminny (Old)Jiminny (New)I CD Platform TeamIID Enterprise Stability L..(ID SE Kanban= More spaces= FiltersDashboardsOperationsConfluence1: Teams% Customise sidebarD Projects |E3 SSH⢠Home| Salesforce O 8 [ Ee Datadog * Claude3 CircleciA SentrySearchspaces/Jmicay ONew) / $ JY-18309 / [] JY-20771Call Scoring filter for Exec reports⢠Description |O Ask Rovoie call scoring feature, customers are asking for their report to be done only on calls with certain scores (either high or low).|⢠Include the call scoring fiter in the Exec Reports section in Kiosk⢠use the same dropdown structufe that we have in OD⢠put it before Recipients⢠ensure the scores filter applied for the report when fetching the calls for sanalisys|SubtasksLinked work itemsActivityWork logAooacomieWho is working on this.Status update...Pro tip: press M to colT[JY-Z Y-7 (Y-a [Y-8⢠Mon 18 May 15:13A UY-0 Tasks7 Insights & CoachinâŚ0 DevDJ Al Bookmarksl+ CreateAsk Rovoâ˘1|Backdog~** Improve Story⢠Details |Assignee& UnassignedAssign to meReporter2 Galya DimitrovaQuick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismissDevelopmentQ Open with VS Code!J Create branch, Create commit |ComponentsPlatformSub-ProductAdd optionsLabelsStory point est3:13 PM [Platform] Refinement ÂŽ100% C8⢠Mon 18 May 15:13:225Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
3563925094830506665
|
NULL
|
click
|
ocr
|
NULL
|
FirefoxFileEditViewHistoryBookmarksProfilesToolsWi FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 2m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+18Nikolay Yankov (Presenting)einhomeEditViewtonetM InboF Projt⢠Cos: | @ app.c | Allov | O Pipe⢠Jminny8 JMINNY* For you⢠Recent |# Starred8. AppsQ SpacesStarred§ Service-DeskJiminny (Old)Jiminny (New)I CD Platform TeamIID Enterprise Stability L..(ID SE Kanban= More spaces= FiltersDashboardsOperationsConfluence1: Teams% Customise sidebarD Projects |E3 SSH⢠Home| Salesforce O 8 [ Ee Datadog * Claude3 CircleciA SentrySearchspaces/Jmicay ONew) / $ JY-18309 / [] JY-20771Call Scoring filter for Exec reports⢠Description |O Ask Rovoie call scoring feature, customers are asking for their report to be done only on calls with certain scores (either high or low).|⢠Include the call scoring fiter in the Exec Reports section in Kiosk⢠use the same dropdown structufe that we have in OD⢠put it before Recipients⢠ensure the scores filter applied for the report when fetching the calls for sanalisys|SubtasksLinked work itemsActivityWork logAooacomieWho is working on this.Status update...Pro tip: press M to colT[JY-Z Y-7 (Y-a [Y-8⢠Mon 18 May 15:13A UY-0 Tasks7 Insights & CoachinâŚ0 DevDJ Al Bookmarksl+ CreateAsk Rovoâ˘1|Backdog~** Improve Story⢠Details |Assignee& UnassignedAssign to meReporter2 Galya DimitrovaQuick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismissDevelopmentQ Open with VS Code!J Create branch, Create commit |ComponentsPlatformSub-ProductAdd optionsLabelsStory point est3:13 PM [Platform] Refinement ÂŽ100% C8⢠Mon 18 May 15:13:225Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
53513
|
NULL
|
NULL
|
NULL
|