|
53516
|
1875
|
7
|
2026-05-18T12:13:23.099517+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106403099_m2.jpg...
|
iTerm2
|
NULL
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
FirefoxEditVIewMistorToolsPlatform Sprint 4 Q2 - P FirefoxEditVIewMistorToolsPlatform Sprint 4 Q2 - Platform TeService-Desk - Queues - Platfornw Usage | WindsurfAllow owner's role to be selected© Pipelines - jiminny/appN1 (SRD-6848] Sidekick SMS issue -CloudWatch I us-east-2CloudWatch | us-east-28 Jiminnys) Jiminny\Exceptions|SocialAccountAllow owner's role to be selectedY [SRD-6862] 'User does not have a* New Tab(JY-209121 Fallback mechanism fcS MIY-207711 Call Scorina filter for &(UY-20878] SCIM > Allow customel[JY-20879] Enable users to us: XProject Phoenix - Figma(UY-20847] Users can filter Scores(JY-20534] Al Call Scoring quicka— New TabbookmarksProtllesWindowmelpny.aulasslan.net/orowse/Jt-40o/O JIMINNY@ For you(• Recent# Starred8$ Apps• Spaces+ ...Jiminny (New)IWD Platform Team+ **IID Capture TeamWD Enterprise Stability I…..IN Processing TeamMl SE KanbanC Service-Desk= More spaces— FiltersCB DashboardsC÷ Operations2 Confluence:: Teams"= Customise sidebarIQ SearchSpaces / E Jiminny (New) / L Add parent / [ JY-20879Enable users to use their new activity types+ CreateB < 40 0 1 Support Daily -2mleft A 100% C/3 & • Mon 18 May 15:13:22ASK ROVO A® Lộ 0Backlog * Improve Storyv DescriptionCurrently when customers create new activity types in their CRM, we ask them to create a new Playbook in order to fetch them. However now with the activity typeautomations that we have - this means they need to copy all of their prompts again. Which takes a huge amount of time.For SF and Hubspot:• when a new activity tvpe is created in the CRM and fetched in Jiminny - add it to all the plavbooks with disabled stateFor SF, Hubspot, Copper, Bullhorn and Pipedrive:• if a customer manually creates an activity type in Jiminny - show them a warning message on the top saying "If you want this activity type to sync to your CRM oneach call - make sure to have it in your CRM with the exact same name" - use this https://www.figma.com/design/XcUety9mx5Fiz8KosLAUn/Project-Phoenix?node-id=7483-260018&t=uJOZVbpzYIpC5PAy-1 Connect your Figma account• the message should stay only while they are adding the activity type - it they leave or retresh the page it should disappear. Use the into message that we naveSubtasksAdd subtaskLinked work itemsAdd linked work itemActiVItVcommentsHistory Work loaAdd a comment...Who is working on this...? Status update... (Thanks.Pro tio: oress Mlto commentPrioritySprintDaysNeed QACanny Links& UnassignedAssign to meGalya Dimitrova[ Open with VS Code33 Create branch/ Create commitPlatformAdd optionsNoneNoneNoneNone= MediumNonePlatform Sprint 5 Q2NoneAdd optionOpen Canny Linkstimate, Time trackingreos...
|
NULL
|
-120241311565609606
|
NULL
|
click
|
ocr
|
NULL
|
FirefoxEditVIewMistorToolsPlatform Sprint 4 Q2 - P FirefoxEditVIewMistorToolsPlatform Sprint 4 Q2 - Platform TeService-Desk - Queues - Platfornw Usage | WindsurfAllow owner's role to be selected© Pipelines - jiminny/appN1 (SRD-6848] Sidekick SMS issue -CloudWatch I us-east-2CloudWatch | us-east-28 Jiminnys) Jiminny\Exceptions|SocialAccountAllow owner's role to be selectedY [SRD-6862] 'User does not have a* New Tab(JY-209121 Fallback mechanism fcS MIY-207711 Call Scorina filter for &(UY-20878] SCIM > Allow customel[JY-20879] Enable users to us: XProject Phoenix - Figma(UY-20847] Users can filter Scores(JY-20534] Al Call Scoring quicka— New TabbookmarksProtllesWindowmelpny.aulasslan.net/orowse/Jt-40o/O JIMINNY@ For you(• Recent# Starred8$ Apps• Spaces+ ...Jiminny (New)IWD Platform Team+ **IID Capture TeamWD Enterprise Stability I…..IN Processing TeamMl SE KanbanC Service-Desk= More spaces— FiltersCB DashboardsC÷ Operations2 Confluence:: Teams"= Customise sidebarIQ SearchSpaces / E Jiminny (New) / L Add parent / [ JY-20879Enable users to use their new activity types+ CreateB < 40 0 1 Support Daily -2mleft A 100% C/3 & • Mon 18 May 15:13:22ASK ROVO A® Lộ 0Backlog * Improve Storyv DescriptionCurrently when customers create new activity types in their CRM, we ask them to create a new Playbook in order to fetch them. However now with the activity typeautomations that we have - this means they need to copy all of their prompts again. Which takes a huge amount of time.For SF and Hubspot:• when a new activity tvpe is created in the CRM and fetched in Jiminny - add it to all the plavbooks with disabled stateFor SF, Hubspot, Copper, Bullhorn and Pipedrive:• if a customer manually creates an activity type in Jiminny - show them a warning message on the top saying "If you want this activity type to sync to your CRM oneach call - make sure to have it in your CRM with the exact same name" - use this https://www.figma.com/design/XcUety9mx5Fiz8KosLAUn/Project-Phoenix?node-id=7483-260018&t=uJOZVbpzYIpC5PAy-1 Connect your Figma account• the message should stay only while they are adding the activity type - it they leave or retresh the page it should disappear. Use the into message that we naveSubtasksAdd subtaskLinked work itemsAdd linked work itemActiVItVcommentsHistory Work loaAdd a comment...Who is working on this...? Status update... (Thanks.Pro tio: oress Mlto commentPrioritySprintDaysNeed QACanny Links& UnassignedAssign to meGalya Dimitrova[ Open with VS Code33 Create branch/ Create commitPlatformAdd optionsNoneNoneNoneNone= MediumNonePlatform Sprint 5 Q2NoneAdd optionOpen Canny Linkstimate, Time trackingreos...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53517
|
1874
|
23
|
2026-05-18T12:13:24.277420+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106404277_m1.jpg...
|
iTerm2
|
NULL
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
+FirefoxFileEditViewHistoryBookmarksProfilesToolsW +FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelp→meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.ccNikolay Yankov (Presenting)ehomdFleEdtViewHistoryProfiles@ For you© Recent*StarrediSpaces/Meminay INew) / 0 JY-18309 / [J JY-20771Call Scoring filter for Exec reports8, AppsQ SpacesStarredY) Servico-DeskJiminny (Ola)Description(1 Ask Rovoie call scoring feature, customers are asking for their report to be done onty 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 wefnave in OD• put it before RecipientsJiminny (New)• ensure the scores filter applied for the report when fetching the calls for aanalisys|1 (D Piatform TeamSubtasksIID Enterprise Stabilty L..111 Procossina Tearni(I) SE Kanban— More soacesiLinked work items= Filters(B DashboardsOperationsActivityHistoryWork 10gConfiuencenowecomiaieroamswho is work.ngon tiomadstasus upoate.18M InboF ProjC Schi• Con E app. | C Alov O Pioe• Jmhttps:/fiminny.atlassian.net/browse(JY-20721Sminy0 ProjectsE3 SSH• Homo|Salesfore T O 8 1 Datadog © @ M Claude3 CircieciSentry0 TasksSearch+ Create$; Customise sidebarPro tio: press M to commen# Support Daily - 2 m left• All-in-One, Capture AreaC: Capture Previous AreaCapture FullscreenCapture Windowj Scrolling CaptureSelf-TimerAa Capture Text (OCR)• Record ScreenHide Desktop IconsOpen...Pin to the Screen...D Capture History...About CleanShot...Check for Updates...Settings...Quit• Open with VS Code!J Create branch1 Create commft |Components|PlattormSub-Product|Add optionsLabels|Story point est₴5+&4+₴3TKTOTR88,3:13 PM| [Platform] Refinement ®100% <478• Mon 18 May 15:13:245Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
-1509732091730622260
|
NULL
|
visual_change
|
ocr
|
NULL
|
+FirefoxFileEditViewHistoryBookmarksProfilesToolsW +FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelp→meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.ccNikolay Yankov (Presenting)ehomdFleEdtViewHistoryProfiles@ For you© Recent*StarrediSpaces/Meminay INew) / 0 JY-18309 / [J JY-20771Call Scoring filter for Exec reports8, AppsQ SpacesStarredY) Servico-DeskJiminny (Ola)Description(1 Ask Rovoie call scoring feature, customers are asking for their report to be done onty 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 wefnave in OD• put it before RecipientsJiminny (New)• ensure the scores filter applied for the report when fetching the calls for aanalisys|1 (D Piatform TeamSubtasksIID Enterprise Stabilty L..111 Procossina Tearni(I) SE Kanban— More soacesiLinked work items= Filters(B DashboardsOperationsActivityHistoryWork 10gConfiuencenowecomiaieroamswho is work.ngon tiomadstasus upoate.18M InboF ProjC Schi• Con E app. | C Alov O Pioe• Jmhttps:/fiminny.atlassian.net/browse(JY-20721Sminy0 ProjectsE3 SSH• Homo|Salesfore T O 8 1 Datadog © @ M Claude3 CircieciSentry0 TasksSearch+ Create$; Customise sidebarPro tio: press M to commen# Support Daily - 2 m left• All-in-One, Capture AreaC: Capture Previous AreaCapture FullscreenCapture Windowj Scrolling CaptureSelf-TimerAa Capture Text (OCR)• Record ScreenHide Desktop IconsOpen...Pin to the Screen...D Capture History...About CleanShot...Check for Updates...Settings...Quit• Open with VS Code!J Create branch1 Create commft |Components|PlattormSub-Product|Add optionsLabels|Story point est₴5+&4+₴3TKTOTR88,3:13 PM| [Platform] Refinement ®100% <478• Mon 18 May 15:13:245Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53518
|
1875
|
8
|
2026-05-18T12:13:25.131641+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106405131_m2.jpg...
|
iTerm2
|
NULL
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
rirero••• lPlatform Sprint 4 Q2 - Platform TeServi rirero••• lPlatform Sprint 4 Q2 - Platform TeService-Desk - Queues - Platfornw Usage | WindsurfAllow owner's role to be selectedPipelines - jiminny/appN1 (SRD-6848] Sidekick SMS issue -CloudWatch I us-east-2CloudWatch | us-east-28 Jiminnys) Jiminny\Exceptions|SocialAccountAllow owner's role to be selectedY [SRD-6862] 'User does not have a* New Tab(JY-209121 Fallback mechanism fcS MIY-207711 Call Scorina filter for &(UY-20878] SCIM > Allow customel[JY-20879] Enable users to us: XProject Phoenix - Figma(UY-20847] Users can filter Scores(JY-20534] Al Call Scoring quicka— New TabPronllesy.dulassian.neuorowselJt-40o/sO JIMINNY@ For you(• Recent|# Starred8$ Apps• Spaces+ ...Jiminny (New)+ **IWD Platform TeamIID Capture TeamWD Enterprise Stability I…..IN Processing TeamMl SE KanbanC Service-Desk= More spaces— FiltersCB DashboardsC÷ Operations2 Confluence:: Teams"= Customise sidebarIQ SearchSpaces / E Jiminny (New) / L Add parent / [ JY-20879Enable users to use their new activity types+ Create<40 1 Support Daily -2mleft A 100%C42 & • Mon 18 May 15:13:25DAsK RoVoD® @o= ..Backlog * Improve Story~ DescriptionCurrently when customers create new activity types in their CRM, we ask them to create a new Playbook in order to fetch them. However now with the activity typeautomations that we have - this means they need to copy all of their prompts again. Which takes a huge amount of time.For SF and Hubspot:• when a new activity type is created in the CRM and fetched in Jiminny - add it to all the playbooks with disabled stateFor SF, Hubspot, Copper, Bullhorn and Pipedrive:• if a customer manually creates an activity type in Jiminny - show them a warning message on the top saying "If you want this activity type to sync to your CRM oneach call - make sure to have it in your CRM with the exact same name" - use this https://www.figma.com/design/XcUe1y9mx5Fiz8KosLAUn/Project-Phoenix?node-id=7483-260018&t=uJOZVbpzYIpC5PAy-1 [Connect your Figma account• the message should stay only while they are adding the activity type - if they leave or refresh the page it should disappear. Use the info message that we haveSubtasksAdd subtaskLinked work itemsAdd linked work itemACtIVItVHistory Work loaAdd a comment...Who is working on this...? Status update... (Thanks.Pro tio: oress Mlto commentPrioritySprintDaysNeed QACanny Links& UnassignedAssign to meGalya Dimitrova[ Open with VS Code33 Create branch/ Create commitPlatformAdd optionsNoneNoneNoneNone= MediumNonePlatform Sprint 5 Q2NoneAdd optionOpen Canny Linkstimate, Time trackingreos...
|
NULL
|
8226488970595675715
|
NULL
|
click
|
ocr
|
NULL
|
rirero••• lPlatform Sprint 4 Q2 - Platform TeServi rirero••• lPlatform Sprint 4 Q2 - Platform TeService-Desk - Queues - Platfornw Usage | WindsurfAllow owner's role to be selectedPipelines - jiminny/appN1 (SRD-6848] Sidekick SMS issue -CloudWatch I us-east-2CloudWatch | us-east-28 Jiminnys) Jiminny\Exceptions|SocialAccountAllow owner's role to be selectedY [SRD-6862] 'User does not have a* New Tab(JY-209121 Fallback mechanism fcS MIY-207711 Call Scorina filter for &(UY-20878] SCIM > Allow customel[JY-20879] Enable users to us: XProject Phoenix - Figma(UY-20847] Users can filter Scores(JY-20534] Al Call Scoring quicka— New TabPronllesy.dulassian.neuorowselJt-40o/sO JIMINNY@ For you(• Recent|# Starred8$ Apps• Spaces+ ...Jiminny (New)+ **IWD Platform TeamIID Capture TeamWD Enterprise Stability I…..IN Processing TeamMl SE KanbanC Service-Desk= More spaces— FiltersCB DashboardsC÷ Operations2 Confluence:: Teams"= Customise sidebarIQ SearchSpaces / E Jiminny (New) / L Add parent / [ JY-20879Enable users to use their new activity types+ Create<40 1 Support Daily -2mleft A 100%C42 & • Mon 18 May 15:13:25DAsK RoVoD® @o= ..Backlog * Improve Story~ DescriptionCurrently when customers create new activity types in their CRM, we ask them to create a new Playbook in order to fetch them. However now with the activity typeautomations that we have - this means they need to copy all of their prompts again. Which takes a huge amount of time.For SF and Hubspot:• when a new activity type is created in the CRM and fetched in Jiminny - add it to all the playbooks with disabled stateFor SF, Hubspot, Copper, Bullhorn and Pipedrive:• if a customer manually creates an activity type in Jiminny - show them a warning message on the top saying "If you want this activity type to sync to your CRM oneach call - make sure to have it in your CRM with the exact same name" - use this https://www.figma.com/design/XcUe1y9mx5Fiz8KosLAUn/Project-Phoenix?node-id=7483-260018&t=uJOZVbpzYIpC5PAy-1 [Connect your Figma account• the message should stay only while they are adding the activity type - if they leave or refresh the page it should disappear. Use the info message that we haveSubtasksAdd subtaskLinked work itemsAdd linked work itemACtIVItVHistory Work loaAdd a comment...Who is working on this...? Status update... (Thanks.Pro tio: oress Mlto commentPrioritySprintDaysNeed QACanny Links& UnassignedAssign to meGalya Dimitrova[ Open with VS Code33 Create branch/ Create commitPlatformAdd optionsNoneNoneNoneNone= MediumNonePlatform Sprint 5 Q2NoneAdd optionOpen Canny Linkstimate, Time trackingreos...
|
53516
|
NULL
|
NULL
|
NULL
|
|
53519
|
1874
|
24
|
2026-05-18T12:13:26.364647+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106406364_m1.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Drag to record a part of the screen. Press ⌥W to s Drag to record a part of the screen. Press ⌥W to select a window....
|
[{"role":"AXStaticText","text& [{"role":"AXStaticText","text":"Drag to record a part of the screen. Press ⌥W to select a window.","depth":1,"bounds":{"left":0.2986111,"top":0.48555556,"width":0.403125,"height":0.026666667},"on_screen":true,"role_description":"text"}]...
|
7027923345767264602
|
-7551080705130679904
|
click
|
hybrid
|
NULL
|
Drag to record a part of the screen. Press ⌥W to s Drag to record a part of the screen. Press ⌥W to select a window.
+FirefoxFileEditViewHistoryBookmarksProfilesTools WindowHelp# Support Daily - 2 m left→meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)FleEdtHistoryM InboF ProkSohml• Con: app. | C Alov Pipe0 Jm• sim7 UY-a UY-7 шY-a [Y-8Men 18 May 15:13a UY-https:/fiminny.atlassian.net/browse/JY-20771• JminnyC Projects |E3 SSH• Home|Salesforce O 88 [l El Dutadog M Claude O CircleciA Sentry0J Tasks|7 Insights & Coachin. DevDJ Al BookomarkaSearch+ CreateAsk Rovo® For youRecent#7 Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Meminay INew) / 0 JY-18309 / [J JY-20771Call Scoring filter for Exec reports•1|Backdog~** Improve Story• DetailsDescriptionQ 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 can scoring tawer tn te cxoc koports sucdon in wosk• use the same dropdown structure that we rjave in OD• put it before Recipients• ensure the scores filter applied for the report when fetching the calls for aalAssignee& UnassignedAssign to meReporter& Galya DimitrovaJiminny (New)I CD Platform Team•$SubtasksIID Enterprise Stability L..(I SE Kanban|— More soacesiLinked work itemsP Quick start developmentLink this work item to your code byincluding keys when creating abranch, commit. or pull requestbelow. Learn moreDismiss= Filters(B DashboardsOperationsActivityWork 10gDevelopment[ Open with VS Code!J Create branch1 Create commit|Confiuencea Teams |Aooecommierwho is working on thomatstasus upoate.ComponentsPlatform18$; Customise sidebarPro tio: press M to commenSub-ProductAdd optionsLabelsQ3:13 PM [Platform] Refinement ®100% <*8• Mon 18 May 15:13:26=5Nikolay YankolAneliya AngelovaNikolay IvanovLukas Kovalik...
|
53517
|
NULL
|
NULL
|
NULL
|
|
53520
|
1875
|
9
|
2026-05-18T12:13:27.776123+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106407776_m2.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Platform Sprint 4 Q2 - Platform TeService-Desk - Q Platform Sprint 4 Q2 - Platform TeService-Desk - Queues - PlatforniW Usage | WindsurAllow owl© Pipelines - jiminny/app1N1 (SRD-6848) Sidekick SMS issue -CloudWatch I us-east-2fa CloudWatch | us-east-28 Jiminny) Jiminny|Exceptions|SocialAccount• Allow owner's role to be selected !Y (SRD-6862] 'User does not have a* New Tab1 (JY-209121 Fallback mechanism fc÷7 fuY-207711 Call Scoring filter for E(UY-20878] SCIM > Allow custome[JY-20879] Enable users to us: XProject Phoenix - Fig$ (JY-20847] Users can filter Scores(JY-20534] Al Call Scoring quick a— New TabO JIMINNY@ For you@ Recent# Starred0+ AppsQ SpacesJiminny (New)ulu Planorm leamIID Capture TeamI Enterprise Stability I...I Processing TeamIN SE Kanban( Service-Desk= More spaces— FiltersH DashboardsC: Operations2 Confluence88 TeamsU= Customise sidebarsupoont Dally • Zm let0% |52Ask RovoQ SearchSpaces / E Jiminny (New) / L& Add parent / [ JY-20879Enable users to use their new activity typesv DescriptionCurrently when customers create new activity types in their CRM, we ask them to create a new Playbook in order to fetch them. However now with the activity typeautomations that we have - this means they need to copy all of their prompts again. Which takes a huge amount of time.For SF and Hubspot:• when a new activity tvoe is created in the CRM and tetched in Jiminny - add it to all the plavbooks with disabled stateFor SF, Hubspot, Copper, Bullhorn and Pipedrive:• if a customer manually creates an activity type in Jiminny - show them a warning message on the top saying "If you want this activity type to sync to your CRM oneach call - make sure to have it in vour CRM with the exact same name" - use this & httos://www.fiama.com/desian/iXcUe1v9mx5Fiz8KosLAUn/Proiect-Phoenix?node-id=7483-260018&t=uJOZVbpzYIpC5PAy-1 [Connect your Figma account• the messade snould stav oniv while thev are addina the activitv tvoe - it thev leave or retresn the dade it snoula disaodear. use the into messade that we naveSubtasksDrag to record a part of the screen. Press TW to select a window.Add subtaskLinked work itemsAdd linked work itemActivItyHistoryWork loaAdd a comment...Who is working on this..?Status update….I ThanksPro tio: oress Mlto comment+ CreateBacklog* Improve StoryDetailsAssigneeReporterDevelopmentComponentsSub-ProductLabelsStory point estimateStory PointsOrganisationsPriorityFix versionsSprintDaysNeed QACanny Links& UnassignedAssign to meGalya Dimitrova[ Open with VS Code?3 Create branchCreate commitPlatformAdd optionsNoneNoneNoneNone= MediumNonePlatform Sorint 5 05NoneAdd optionOpen Canny Links> More fields Parent, Original estimate, Time tracking> Automation 4 Rule executions> featureOS Open featureOS> Sentry el! Linked Issues•1|...
|
NULL
|
-6166960947344268691
|
NULL
|
click
|
ocr
|
NULL
|
Platform Sprint 4 Q2 - Platform TeService-Desk - Q Platform Sprint 4 Q2 - Platform TeService-Desk - Queues - PlatforniW Usage | WindsurAllow owl© Pipelines - jiminny/app1N1 (SRD-6848) Sidekick SMS issue -CloudWatch I us-east-2fa CloudWatch | us-east-28 Jiminny) Jiminny|Exceptions|SocialAccount• Allow owner's role to be selected !Y (SRD-6862] 'User does not have a* New Tab1 (JY-209121 Fallback mechanism fc÷7 fuY-207711 Call Scoring filter for E(UY-20878] SCIM > Allow custome[JY-20879] Enable users to us: XProject Phoenix - Fig$ (JY-20847] Users can filter Scores(JY-20534] Al Call Scoring quick a— New TabO JIMINNY@ For you@ Recent# Starred0+ AppsQ SpacesJiminny (New)ulu Planorm leamIID Capture TeamI Enterprise Stability I...I Processing TeamIN SE Kanban( Service-Desk= More spaces— FiltersH DashboardsC: Operations2 Confluence88 TeamsU= Customise sidebarsupoont Dally • Zm let0% |52Ask RovoQ SearchSpaces / E Jiminny (New) / L& Add parent / [ JY-20879Enable users to use their new activity typesv DescriptionCurrently when customers create new activity types in their CRM, we ask them to create a new Playbook in order to fetch them. However now with the activity typeautomations that we have - this means they need to copy all of their prompts again. Which takes a huge amount of time.For SF and Hubspot:• when a new activity tvoe is created in the CRM and tetched in Jiminny - add it to all the plavbooks with disabled stateFor SF, Hubspot, Copper, Bullhorn and Pipedrive:• if a customer manually creates an activity type in Jiminny - show them a warning message on the top saying "If you want this activity type to sync to your CRM oneach call - make sure to have it in vour CRM with the exact same name" - use this & httos://www.fiama.com/desian/iXcUe1v9mx5Fiz8KosLAUn/Proiect-Phoenix?node-id=7483-260018&t=uJOZVbpzYIpC5PAy-1 [Connect your Figma account• the messade snould stav oniv while thev are addina the activitv tvoe - it thev leave or retresn the dade it snoula disaodear. use the into messade that we naveSubtasksDrag to record a part of the screen. Press TW to select a window.Add subtaskLinked work itemsAdd linked work itemActivItyHistoryWork loaAdd a comment...Who is working on this..?Status update….I ThanksPro tio: oress Mlto comment+ CreateBacklog* Improve StoryDetailsAssigneeReporterDevelopmentComponentsSub-ProductLabelsStory point estimateStory PointsOrganisationsPriorityFix versionsSprintDaysNeed QACanny Links& UnassignedAssign to meGalya Dimitrova[ Open with VS Code?3 Create branchCreate commitPlatformAdd optionsNoneNoneNoneNone= MediumNonePlatform Sorint 5 05NoneAdd optionOpen Canny Links> More fields Parent, Original estimate, Time tracking> Automation 4 Rule executions> featureOS Open featureOS> Sentry el! Linked Issues•1|...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53521
|
1874
|
25
|
2026-05-18T12:13:28.486425+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106408486_m1.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
+FirefoxViewTools# Support Daily - 2 m leftS18File +FirefoxViewTools# Support Daily - 2 m leftS18FileEditHistoryBookmarksProfilesWindowHelp→meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)FloEditViewHistoryM InboF Prok• Com© app.Allov3 Pioe• JmiZ UY-a (Y-7 tY-a[Y-8 • Mon 18 May 15:13AUY-*httos:/hminny.atiassian.net/browse/JY-207/1l• Jminny0 ProjectsE3 SSH• Home| Salesforce O 8 [ EelDatadog % Claude3 CircleciA Sentry0 Tasks7 Insights & Coachin0 Dev0J Al BookmarksSearch+ CreateAsk Rovog For you© Recent |# Starred8. AppsQ SpacesStarredY Service-DeskJiminny (Old)spacesJminey ONew) / $ JY-18309 / [I 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 on• incluta tha eall scoring fiter in the Exec Reports section in Kiosk• E Define tropdown structure that we have in OD• put it before Recipients• ensure the scores filter applied for the report when fetching the calls for aanalisys1440x900**Assignee& UnassignedAssign to meReporter& Galya DimitrovaJiminny (New)I CD Platform TeamGIFRecord GIFTFSubtasksIID Enterprise Stability L..• Record VideoLSQuick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismiss(ID SE Kanban= More spaces= Filters(B DashboardsOperationsLinked work itemsActivityWork logDevelopmentOpen with VS CodeIJ Create branchCreate commit |Confluence1: TeamsnooacommenWho is working on this.Status update...ComponentsPlatform% Customise sidebarPro tio: press M to colSub-ProductAdd optionsLabelsStory poink estin3:13 PM| [Platform] Refinement ®100% <7*Mon 18 May 15:13:285Nikolay YankoAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
7953178910806555790
|
NULL
|
visual_change
|
ocr
|
NULL
|
+FirefoxViewTools# Support Daily - 2 m leftS18File +FirefoxViewTools# Support Daily - 2 m leftS18FileEditHistoryBookmarksProfilesWindowHelp→meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)FloEditViewHistoryM InboF Prok• Com© app.Allov3 Pioe• JmiZ UY-a (Y-7 tY-a[Y-8 • Mon 18 May 15:13AUY-*httos:/hminny.atiassian.net/browse/JY-207/1l• Jminny0 ProjectsE3 SSH• Home| Salesforce O 8 [ EelDatadog % Claude3 CircleciA Sentry0 Tasks7 Insights & Coachin0 Dev0J Al BookmarksSearch+ CreateAsk Rovog For you© Recent |# Starred8. AppsQ SpacesStarredY Service-DeskJiminny (Old)spacesJminey ONew) / $ JY-18309 / [I 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 on• incluta tha eall scoring fiter in the Exec Reports section in Kiosk• E Define tropdown structure that we have in OD• put it before Recipients• ensure the scores filter applied for the report when fetching the calls for aanalisys1440x900**Assignee& UnassignedAssign to meReporter& Galya DimitrovaJiminny (New)I CD Platform TeamGIFRecord GIFTFSubtasksIID Enterprise Stability L..• Record VideoLSQuick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismiss(ID SE Kanban= More spaces= Filters(B DashboardsOperationsLinked work itemsActivityWork logDevelopmentOpen with VS CodeIJ Create branchCreate commit |Confluence1: TeamsnooacommenWho is working on this.Status update...ComponentsPlatform% Customise sidebarPro tio: press M to colSub-ProductAdd optionsLabelsStory poink estin3:13 PM| [Platform] Refinement ®100% <7*Mon 18 May 15:13:285Nikolay YankoAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53523
|
1875
|
10
|
2026-05-18T12:13:31.540396+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106411540_m2.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
Record Video
⌥S
Record GIF
⌥F
×
1375
827
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Record Video","depth":1,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false},{"role":"AXStaticText","text":"⌥S","depth":1,"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Record GIF","depth":1,"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false},{"role":"AXStaticText","text":"⌥F","depth":1,"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"×","depth":1,"on_screen":true,"role_description":"text"},{"role":"AXTextField","text":"1375","depth":1,"on_screen":true,"value":"1375","role_description":"text field","is_enabled":true,"is_focused":false},{"role":"AXTextField","text":"827","depth":1,"on_screen":true,"value":"827","role_description":"text field","is_enabled":true,"is_focused":false}]...
|
-5098623264530535619
|
3883146986057727108
|
click
|
hybrid
|
NULL
|
Record Video
⌥S
Record GIF
⌥F
×
1375
827
Platform Record Video
⌥S
Record GIF
⌥F
×
1375
827
Platform Sprint 4 Q2 - Platform TeService-Desk - Queues - PlatforniW Usage | WindsurAllow owl© Pipelines - jiminny/app1N1 (SRD-6848) Sidekick SMS issue -CloudWatch I us-east-2fa CloudWatch | us-east-28 Jiminny) Jiminny|Exceptions|SocialAccount• Allow owner's role to be selected !Y (SRD-6862] 'User does not have a* New Tab1 (JY-209121 Fallback mechanism fc÷7 fuY-207711 Call Scoring filter for E(UY-20878] SCIM > Allow custome[JY-20879] Enable users to us: XProject Phoenix - Fig$ (JY-20847] Users can filter Scores(JY-20534] Al Call Scoring quick a— New TabO JIMINNY@ For you@ Recent# Starred84 AppsQ SpacesJiminny (New)ulu Planorm leamIID Capture TeamI Enterprise Stability I...I Processing TeamIN SE Kanban( Service-Desk= More spaces— FiltersH DashboardsC: Operations2 Confluence88 TeamsU= Customise sidebarsupoont Dally • Zm let0% |52Ask RovoQ SearchSpaces / E Jiminny (New) / L& Add parent / [ JY-20879Enable users to use their new activity typesv DescriptionCurrently when customers create new activity types in their CRM, we ask them to create a new Playbook in order to fetch them. However now with the activity typeautomations that we have - this means they need to copy all of their prompts again. Which takes a huge amount of time.For SF and Hubspot:• when a new activity tvoe is created in the CRM and tetched in Jiminny - add it to all the plavbooks with disabled stateFor SF, Hubspot, Copper, Bullhorn and Pipedrive:• if a customer manually creates an activity type in Jiminny - show them a warning message on the top saying "If you want this activity type to sync to your CRM oneach call - make sure to have it in vour CRM with the exact same name" - use this & httos://www.fiama.com/desian/iXcUe1v9mx5Fiz8KosLAUn/Proiect-Phoenix?node-id=7483-260018&t=uJOZVbpzYIpC5PAy-1 [Connect your Figma account• the messade snould stav oniv while thev are addina the activitv tvoe - it thev leave or retresn the dade it snoula disaodear. use the into messade that we naveSubtasksDrag to record a part of the screen. Press TW to select a window.Add subtaskLinked work itemsAdd linked work itemActivItyHistoryWork loaAdd a comment...Who is working on this..?Status update….I ThanksPro tio: oress Mlto comment+ CreateBacklog* Improve StoryDetailsAssigneeReporterDevelopmentComponentsSub-ProductLabelsStory point estimateStory PointsOrganisationsPriorityFix versionsSprintDaysNeed QACanny Links& UnassignedAssign to meGalya Dimitrova[ Open with VS Code?3 Create branchCreate commitPlatformAdd optionsNoneNoneNoneNone= MediumNonePlatform Sorint 5 05NoneAdd optionOpen Canny Links> More fields Parent, Original estimate, Time tracking> Automation 4 Rule executions> featureOS Open featureOS> Sentry el! Linked Issues•1|...
|
53520
|
NULL
|
NULL
|
NULL
|
|
53522
|
1874
|
26
|
2026-05-18T12:13:31.540973+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106411540_m1.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
Record Video
⌥S
Record GIF
⌥F
×
1375
827
|
[{"role":"AXButton","text" [{"role":"AXButton","text":"Record Video","depth":1,"bounds":{"left":0.4340278,"top":0.5927778,"width":0.17638889,"height":0.044444446},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false},{"role":"AXStaticText","text":"⌥S","depth":1,"bounds":{"left":0.5847222,"top":0.605,"width":0.017361112,"height":0.022222223},"on_screen":true,"role_description":"text"},{"role":"AXButton","text":"Record GIF","depth":1,"bounds":{"left":0.4340278,"top":0.5472222,"width":0.17638889,"height":0.044444446},"on_screen":true,"role_description":"button","is_enabled":true,"is_focused":false},{"role":"AXStaticText","text":"⌥F","depth":1,"bounds":{"left":0.5833333,"top":0.5594444,"width":0.01875,"height":0.022222223},"on_screen":true,"role_description":"text"},{"role":"AXStaticText","text":"×","depth":1,"bounds":{"left":0.5076389,"top":0.44444445,"width":0.010763889,"height":0.044444446},"on_screen":true,"role_description":"text"},{"role":"AXTextField","text":"1375","depth":1,"bounds":{"left":0.475,"top":0.45444444,"width":0.031944446,"height":0.024444444},"on_screen":true,"value":"1375","role_description":"text field","is_enabled":true,"is_focused":false},{"role":"AXTextField","text":"827","depth":1,"bounds":{"left":0.51875,"top":0.45444444,"width":0.031944446,"height":0.024444444},"on_screen":true,"value":"827","role_description":"text field","is_enabled":true,"is_focused":false}]...
|
-5098623264530535619
|
3883146986057727108
|
visual_change
|
hybrid
|
NULL
|
Record Video
⌥S
Record GIF
⌥F
×
1375
827
FirefoxFi Record Video
⌥S
Record GIF
⌥F
×
1375
827
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelp→meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)Chrome9SSEditViewHistoryookmatProfilesTabWindowF ProliSchehttps://upiter.staging.jiminny.com/kiosk/automated-reports• JminnyProjectsE AWSE3 SSH• Home | SalesforceKioskAutomated ReportsOrganizationsSetup Accoun:UsersTYPE #Coacrarv ProluesCoscrins PraliiesExoc SumnaryExs. SammaryExes SmmtinyProduct For dhoaxEro bamenaryAllo:P DatadogC (Y-CircleCtA Sentry0 Tasks7 Insights & Coachin.Create Report ®1. Organization details2. Report settings1375827**tc wetdliistet(GIF)Record GIFTF• Record VideoTS# Support Daily - 2 m left100% CMon 18 May 15:13:31 •5a[Y-0 Dev8• Mon 18 May 15:130J Al BookmarksNikolay YankEXPORTASFREQUENC"SelectAneliya AngelovaJtnaniy luptenduleluly tayatJmtons Aup/eCix CHОtECINNikolay IvanovEDua Su maaryLukas Kovalik3:13 PM | [Platform] Refinement®Sộ3...
|
53521
|
NULL
|
NULL
|
NULL
|
|
53524
|
1875
|
11
|
2026-05-18T12:13:33.338431+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106413338_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...
|
[{"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}]...
|
5702448559365621884
|
1875877183642948610
|
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
rirero••0 lPlatform Sprint 4 Q2 - Platform TeService-Desk - Queues - Platfornw Usage | WindsurfAllow owner's role to be selected vPipelines - jiminny/appN1 (SRD-6848] Sidekick SMS issue -CloudWatch I us-east-2CloudWatch | us-east-28 Jiminnys) Jiminny\Exceptions|SocialAccountAllow owner's role to be selectedY [SRD-6862] 'User does not have a* New Tab(JY-209121 Fallback mechanism fcS MIY-207711 Call Scorina filter for &(UY-20878] SCIM > Allow customel[JY-20879] Enable users to us: XProject Phoenix - Figma(UY-20847] Users can filter Scores(JY-20534] Al Call Scoring quicka— New TabProtlles1y.dulassian.nelorowseJt-40o/5O JIMINNY@ For you(• Recent|# Starred8$ AppsQ Spaces+ ...Jiminny (New)+ **IWD Platform TeamIID Capture TeamWD Enterprise Stability I…..IN Processing TeamMl SE KanbanC Service-Desk= More spaces— FiltersCB DashboardsC÷ Operations2 Confluence:: Teams"= Customise sidebarIQ SearchSpaces / E Jiminny (New) / L Add parent / [ JY-20879Enable users to use their new activity types~ DescriptionCurrently when customers create new activity types in their CRM, we ask them to create a new Playbook in order to fetch them. However now with the activity typeautomations that we have - this means they need to copy all of their prompts again. Which takes a huge amount of time.For SF and Hubspot:• when a new activity type is created in the CRM and fetched in Jiminny - add it to all the playbooks with disabled stateFor SF, Hubspot, Copper, Bullhorn and Pipedrive:• if a customer manually creates an activity type in Jiminny - show them a warning message on the top saying "If you want this activity type to sync to your CRM oneach call - make sure to have it in your CRM with the exact same name" - use this [URL_WITH_CREDENTIALS] ..Backlog * Improve StoryHistory Work loaAdd a comment...Who is working on this...? Status update... (Thanks.Pro tio: oress Mlto commentPrioritySprintDaysNeed QACanny Links& UnassignedAssign to meGalya Dimitrova[ Open with VS Code33 Create branch/ Create commitPlatformAdd optionsNoneNoneNoneNone= MediumNonePlatform Sprint 5 Q2NoneAdd optionOpen Canny Linkstimate, Time trackingreos...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53526
|
1875
|
12
|
2026-05-18T12:13:34.656296+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106414656_m2.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_2
|
NULL
|
NULL
|
NULL
|
NULL
|
0:02
|
[{"role":"AXStaticText","text& [{"role":"AXStaticText","text":"0:02","depth":1,"on_screen":true,"role_description":"text"}]...
|
4977811245512971686
|
4977811245512971686
|
click
|
hybrid
|
NULL
|
0:02
rirero••0 lPlatform Sprint 4 Q2 - Platform Te 0:02
rirero••0 lPlatform Sprint 4 Q2 - Platform TeService-Desk - Queues - Platfornw Usage | WindsurfAllow owner's role to be selected vPipelines - jiminny/appN1 (SRD-6848] Sidekick SMS issue -CloudWatch I us-east-2CloudWatch | us-east-28 Jiminnys) Jiminny\Exceptions|SocialAccountAllow owner's role to be selectedY [SRD-6862] 'User does not have a* New Tab(JY-209121 Fallback mechanism fcS MIY-207711 Call Scorina filter for &(UY-20878] SCIM > Allow customel[JY-20879] Enable users to us: XProject Phoenix - Figma(UY-20847] Users can filter Scores(JY-20534] Al Call Scoring quicka— New TabProtlles1y.dulassian.nelorowseJt-40o/5O JIMINNY@ For you(• Recent|# Starred8$ AppsQ Spaces+ ...Jiminny (New)+ **IWD Platform TeamIID Capture TeamWD Enterprise Stability I…..IN Processing TeamMl SE KanbanC Service-Desk= More spaces— FiltersCB DashboardsC÷ Operations2 Confluence:: Teams"= Customise sidebarIQ SearchSpaces / E Jiminny (New) / L Add parent / [ JY-20879Enable users to use their new activity types~ DescriptionCurrently when customers create new activity types in their CRM, we ask them to create a new Playbook in order to fetch them. However now with the activity typeautomations that we have - this means they need to copy all of their prompts again. Which takes a huge amount of time.For SF and Hubspot:• when a new activity type is created in the CRM and fetched in Jiminny - add it to all the playbooks with disabled stateFor SF, Hubspot, Copper, Bullhorn and Pipedrive:• if a customer manually creates an activity type in Jiminny - show them a warning message on the top saying "If you want this activity type to sync to your CRM oneach call - make sure to have it in your CRM with the exact same name" - use this [URL_WITH_CREDENTIALS] ..Backlog * Improve StoryHistory Work loaAdd a comment...Who is working on this...? Status update... (Thanks.Pro tio: oress Mlto commentPrioritySprintDaysNeed QACanny Links& UnassignedAssign to meGalya Dimitrova[ Open with VS Code33 Create branch/ Create commitPlatformAdd optionsNoneNoneNoneNone= MediumNonePlatform Sprint 5 Q2NoneAdd optionOpen Canny Linkstimate, Time trackingreos...
|
53524
|
NULL
|
NULL
|
NULL
|
|
53525
|
1874
|
27
|
2026-05-18T12:13:34.803372+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106414803_m1.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
0:02
|
[{"role":"AXStaticText","text& [{"role":"AXStaticText","text":"0:02","depth":1,"bounds":{"left":0.79479164,"top":0.9527778,"width":0.023611112,"height":0.015555556},"on_screen":true,"role_description":"text"}]...
|
4977811245512971686
|
4977811245512971686
|
visual_change
|
hybrid
|
NULL
|
0:02
FirefoxWindowSupport Daily - 2m left+FileEdit 0:02
FirefoxWindowSupport Daily - 2m left+FileEditViewHistoryBookmarksProfilesToolsHelp→meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)ChromeEditViewHistoryoeumaProfilesF ProliTabAtteWindowHelpSchuapplG Alohttps://upiter.staging.jiminny.com/kiosk/automated-reports• JminnyProjectsE AWSE3 SSH• Home | SalesforceDatadogKioskAutomated ReportsSetup AccourkUsersTYPE +ActivitiesAutemated ReportsProduct FeedbsckMobilo versionJiminny JupiterCosching ProfiiesSJiminsry lupiterCosching ProfiiesSiminny RupiterExоc SunaryJiminny JupiterExec Sammarylinulury taoeeExtc SumenaryJtroinry JopiterProduct FeodbackJiminny JupiterExec Summaryauraluty tasaterExec SumearyJiminny JupitenExec SummaryJiminny JupiterExtc Sumirarymunny oethExec SummaryIininew AoterExec SummaryJiminnw JupiterExec SummuryJutululy AycateeTaed Maretusy3:13 PM| [Platform] Refinement ®Lộ3One-OfOne OHtOne-OttOne OmOne OnOne-OftOne-OHFDoc-OlfOne-OhCoe OllOne OHOre-OfOne-On8• Mon 18 May 15:13a tY-7 шY-a[Y-A tY-* ClaudeCircleCiA Sentry0n0COS0:010 Tasks7 Insights & Coachin…0 Dev0J Al BookmarksCreate Report ®1. Organization detailsTEAM2. Report settingsREPORT TYРEDOPORTASCUSTOM REPORT NAMEFREQUENCYSelect3. Report parametersENWNTEMEDEM WALE MAXACTIVITY TYRECALL TYFEConference *)3art bypans t9 searcn uyernamonato achurWhat should be the focus of the report?The best reports contain between 20-50 activities. For best case scenario estimate activitl100% C8• Mon 18 May 15:13:34=20 5Nikolay YankolAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53527
|
1874
|
28
|
2026-05-18T12:13:37.616373+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106417616_m1.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
0:05
|
[{"role":"AXStaticText","text& [{"role":"AXStaticText","text":"0:05","depth":1,"bounds":{"left":0.7503472,"top":0.9494445,"width":0.023611112,"height":0.015555556},"on_screen":true,"role_description":"text"}]...
|
9140356857219694708
|
9140356857219694708
|
visual_change
|
hybrid
|
NULL
|
0:05
FirefoxFileEditViewHistoryBookmarksProfiles→T 0:05
FirefoxFileEditViewHistoryBookmarksProfiles→ToolsWindowHelpSupport Daily - 2m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)ChromeJiminny kupiterSJiminny JupiterJiminny JupiterJiminny Jupiterinunly oteJiminny JupiterJiminny Jupiterderuluny pagtueJiminny JupiterJiminny Jupiterminny yoteJiminny JupiterJiminey JupiterDeTululy PoE3:13 PM| [Platform] Refinement ®Lộ3EditViewHistoryooumaProfilesTabWindowHelpF Prok‹( AtteSchuhttps://fupiter.staging.jiminny.com/kiosk/automated-reports• JminnyProjects|E AWSE3 SSH• Home | SalesforceKioskAutomated ReportsOrganizationsSetup AccountUsersActivitiesAutomated ReportsMoblle versionTYPE +Product FeedbackCoacrn? ProluesCosching ProfiiesExcc SuntmaryExec SummaryExec SummaryProduct FeedbackExec SummaryExec SumenaryExec SummaryExec SummaryExec SummaryExec SummnaryExcc SumenaryLxC SUTTuryapplG AllovDatadog* ClaudeCircleCIA SentryOne-OftOne OltOne-OftOne OftOne-OftOnc-OMOne-OfOoc-OfOoc-OHOne-OHOne-OnOoe-OlOne-Ort€5%00000COBa (Y-Z tY-7 шY-a[Y-0 Tasks7 Insights & Coachin.0 DevCreate Report ®1. Organization detailsORCANIZATION2. Report settingsCartomtnarEnter austoen namil3. Report parametersDAASDINA ACALSelectEAYALTMOLALYANLMAXCALL TYPESurt typhe to search usersList is empty.What should be the focus of the report?TEAMSeicoCURRENTOEAL STAGESelectSelectCAOUDADONEthwwttroortscont.inbetween%telortwt@awetcenrioeomates8• Mon 18 May 15:130J Al Bookmarks0:04100% C8• Mon 18 May 15:13:37=5Nikolay YankolAneliya AngelovaNikolay IvanovLukas Kovalik...
|
53525
|
NULL
|
NULL
|
NULL
|
|
53528
|
1874
|
29
|
2026-05-18T12:13:43.681902+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106423681_m1.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
0:11
|
[{"role":"AXStaticText","text& [{"role":"AXStaticText","text":"0:11","depth":1,"bounds":{"left":0.7503472,"top":0.9494445,"width":0.023611112,"height":0.015555556},"on_screen":true,"role_description":"text"}]...
|
-7682718085206334917
|
-7682718085206334917
|
visual_change
|
hybrid
|
NULL
|
0:11
FirefoxFileEditViewHistoryBookmarksProfilesTo 0:11
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 2m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)FieEdt Von Hatory2 PalBookmariaProffiesTabWindowF Proli5) ASM& schu• Cort• Соsnttossauotes.staoing.iminnv.com/kosklautomased-reoortd• JminayProjectsE3 SSH= Home | SalesforceAumumated Rosoite5aоpiC Alo3 PіonS DatadogM Claude3 CircicI07055CL.E UY0 Tasks 7 insights & Coachin.Create Report ©1. Organization details2. Report settingsOacONUNA3. Report parametersKAALDIAG AICALCANYOEMNOALYNMA"CALLTIFEConference X)(Dialer xRECIMENTSa py-0 Dev• uxTEAMDEORT ASEREOUENCYCURRINT DEAL STAGEСALOлATIOм.8- Men 18 May 16:19a UY-DJ Al BookmarksSECAL FEQAKCMINTYThe biest reports contain between 20-50 activities. For biest case scenarilo estimate activit)Lộ33:13 PM | [Platform] Refinement ®0:11100% C8• Mon 18 May 15:13:43=5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53529
|
1874
|
30
|
2026-05-18T12:13:46.722056+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106426722_m1.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
0:14
|
[{"role":"AXStaticText","text& [{"role":"AXStaticText","text":"0:14","depth":1,"bounds":{"left":0.7503472,"top":0.9494445,"width":0.023611112,"height":0.015555556},"on_screen":true,"role_description":"text"}]...
|
-8481108720493703974
|
-8481108720493703974
|
visual_change
|
hybrid
|
NULL
|
0:14
FirefoxFileEditViewHistoryBookmarksProfilesTo 0:14
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 2m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com•*Nikolay Yankov (Presenting)ChromeFieEditViewProfilesTabWindowF Prok• AtteSchuhttps://upiter.staging.jiminny.com/kiosk/automated-reports• Sminny• Projects |KioskOrganizationsSetun AccoumMobile verion81E AWSE3 SSH= Home | SalesforceAutomated ReportsIiminy lopiterSimirw SaxewwwlupkeJhww sapiteJininny KusiterJiminny RupiterЛiraку fuasJirrintry JupiterTVTE 4Produci FesdteckCosarrid PrailtesConcrire WralteExs-bienrertiaiS vunarylnsa xt fonlboestxes sumeraryExec SumanayExxe SumaoryExec SummtaryExec SurvanaryExce SumpnaryapplG Alo»Datadog* ClaudeCircleCIA SentryPanarteeOne-CnCie OfOтe Crore CRDw OHOne-OllOce-ClОne-ОhOne-OlOnc OHOrr-OnOre ClOne-Ol190000000COBC tY-a UY-Z tY-a[Y-0 Tasks7 Insights & Coachin…0 DevCreate Report ®1. Organization detailsORCANIZATION2. Report settingsCarWiTay3. Report parametersCAALDINGE AICALCAYALTEMOCALYANEEMAXRECIPENTSStart typine to search usersJCALROAKEHENTYTEAMCURRENT DEAL STAGESelecsSelectCALL DURATION...ttwtteoortscontsinbetweenowwlotws@wwenrioeematesc8• Mon 18 May 16:130J Al Bookmarks3:13 PM| [Platform] Refinement ®Lộ30:14100% C8• Mon 18 May 15:13:46=5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
53528
|
NULL
|
NULL
|
NULL
|
|
53530
|
1874
|
31
|
2026-05-18T12:13:49.747846+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106429747_m1.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
0:17
|
[{"role":"AXStaticText","text& [{"role":"AXStaticText","text":"0:17","depth":1,"bounds":{"left":0.7503472,"top":0.9494445,"width":0.023611112,"height":0.015555556},"on_screen":true,"role_description":"text"}]...
|
5642036370155041061
|
5642036370155041061
|
visual_change
|
hybrid
|
NULL
|
0:17
FirefoxFileEditViewHistoryBookmarksProfilesTo 0:17
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily - 2m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)ehomEditViewHistoryTabWindow8• Mon 18 May 16:13F ProjiAtteSchu€ aрр.G Alo»Z lY-I UUY-7 UY-7 tY-a [Y-• JminnyC Projects |E AWSE3 SSH= Home | SalesforceP Datadog* ClaudeKioskAutomated ReportsSecup AccoureTYPE 4AcivitiesAutomated RebortiProduet Feedbackliminy JopitetCoacuine ProfdesSlminny JupiterCoaching Profiesiminny JupitesExrc SummaryNeminny JupitesIiminny NortelExec SumenaryJiminny JoteProduct FordhachЗUміпиту ЯирйшвкExcc Summaryemlluy netEvec, Sumnaryimiony SupiterExec SummaryJiroinny Jupite)Exec, SannaryExec Sammaryронкну лоiExer SurtmuryJentooy MapitenExec Saranary3:13 PM| [Platform] Refinement ®Lộ3A Sentry0 Tasks7 Insights & Coachin…0 Dev|0J Al BookmarksUXrorRerOne-OmOne-OKtOve-OttOnc-OKOnc OlOre-OtDhc 00Оce-OeOne OitOre-OttCue-OHCre-OKCircleCIKeewit009000000COSCreate Report ®1. Organization detailsTEAM2. Report settingsCarominar3. Report parametersBAASINE ACALSelectCORKENTDENL SINOESelectCAYALTOALYANLMAXRECIPENTSStart typing to search usersAMINNVRECINENTSStart typing to search usersJEСAL REOAKENENTYttttwttroortscontsinbetwtenoscelortucawtemrioeomatesc0:17100% C8• Mon 18 May 15:13:49=5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53531
|
1874
|
32
|
2026-05-18T12:13:52.738458+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106432738_m1.jpg...
|
CleanShot X
|
|
1
|
NULL
|
monitor_1
|
NULL
|
NULL
|
NULL
|
NULL
|
0:20
|
[{"role":"AXStaticText","text& [{"role":"AXStaticText","text":"0:20","depth":1,"bounds":{"left":0.7503472,"top":0.9494445,"width":0.023611112,"height":0.015555556},"on_screen":true,"role_description":"text"}]...
|
-8622594797017880925
|
-8622594797017880925
|
visual_change
|
hybrid
|
NULL
|
0:20
FirefoxFileEditViewHistoryBookmarksProfilesTo 0:20
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpOSupport Daily - 2m left→meet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)ChromeEditViewHistoryTabWindowHelpF ProkAtteSche• Cursi* CiauapplG Allo»7 tY-T UUY-Z UY-7 wYa[Y-8• Mon 18 May 16:13AUY.88• JminnyC Projects |E AWSE3 SSH• Home | SalesforcePe DatadogKioskAutomated ReportsSetup AccountTYPE 4ActivitiesAutomated ReportsProduct FeedbackMobile versionJumariny JuoitehLoachut ProtesSJiminny JupiterCosching ProfiiesJiminny JupiterExec SumenaryJiminny JupiterExec Summarypiniy pprterExec SummaryJiminny JupiterProduct FeedbackJiminny JupiterExec Sumsnarydutututy apaueExec SummaryJiminy SipiterExec SumamaryJiminny JuoiterExec Sammary81llminny JoiterExec SommaryJimincy AupiterExec SummaryIiminny ApiterExec SunmaryDutaluyoetExec Summary3:13 PM| [Platform] Refinement ®* ClaudeCircleCIA Sentry0 Tasks7 Insights & Coachin.0 Der0J Al BookmarksProureYUe UiOnc-OftOne-OftOne-OHOne-OfOce-OltOne-OtOne-OrOne-OkOne-OilOnc-OtOne-OltOne-OH0100000C0SCreate Report ®1. Organization detailsORCANIZATIONTEAM2. Report settingsCaromtar3. Report parametersСААНINA ACACORKENTDEAL SINOESelectCAYALIEMOCALYANLMAXSelectRECIPENTSAMNNVRECINENTSStart typing to search usersУEСAROAKEMENTYvu0o0e o C0ToCUS OEKReTOeeTthtwttroortscontsinbetweenswlot@wewenrioMomateste0:20100% C8• Mon 18 May 15:13:52=5Nikolay YankoAneliya AngelovaNikolay IvanovLukas KovalikLộ3...
|
53530
|
NULL
|
NULL
|
NULL
|
|
53532
|
1875
|
13
|
2026-05-18T12:13:55.450561+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106435450_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...
|
[{"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"}]...
|
-7639540428898992905
|
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...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53533
|
1874
|
33
|
2026-05-18T12:14:07.846360+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106447846_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...
|
[{"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"}]...
|
-7639540428898992905
|
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...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53534
|
1874
|
34
|
2026-05-18T12:14:10.861826+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106450861_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...
|
53533
|
NULL
|
NULL
|
NULL
|
|
53535
|
1874
|
35
|
2026-05-18T12:14:13.904228+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106453904_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…...
|
[{"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}]...
|
7129688197528703292
|
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…...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53537
|
1875
|
14
|
2026-05-18T12:14:25.856720+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106465856_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
}
]...
|
[{"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}]...
|
-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
}
]...
|
53532
|
NULL
|
NULL
|
NULL
|
|
53536
|
1874
|
36
|
2026-05-18T12:14:25.970271+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106465970_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...
|
53535
|
NULL
|
NULL
|
NULL
|
|
53538
|
1874
|
37
|
2026-05-18T12:14:28.998042+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106468998_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
|
|
53539
|
1874
|
38
|
2026-05-18T12:14:32.053891+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106472053_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...
|
53538
|
NULL
|
NULL
|
NULL
|
|
53540
|
1874
|
39
|
2026-05-18T12:14:35.077875+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106475077_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...
|
[{"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}]...
|
3725702452769638982
|
5529508263436062615
|
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...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53541
|
1874
|
40
|
2026-05-18T12:14:38.100566+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106478100_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...
|
53540
|
NULL
|
NULL
|
NULL
|
|
53542
|
1874
|
41
|
2026-05-18T12:14:41.137971+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106481137_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...
|
[{"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}]...
|
-5137194390979529455
|
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...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53543
|
1874
|
42
|
2026-05-18T12:14:44.143759+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106484143_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...
|
[{"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}]...
|
-8399258927190879802
|
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...
|
53542
|
NULL
|
NULL
|
NULL
|
|
53544
|
1875
|
15
|
2026-05-18T12:14:56.316820+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106496316_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
|
|
53545
|
1874
|
43
|
2026-05-18T12:14:59.265076+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106499265_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 • 1 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com•$18Nikolay Yankov (Presenting)ChromeEditod8 JMINY* For you© Recent |# Starred8. AppsQ SpacesStarredS Service-DeskJiminny (Old)Jiminny (New) + ..I CID Platform TeamIID Enterprise Stability L...111 Processina Team(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams% Customise sidebarF ProkSchilCurs* Ciau• Cos:| app.c | Allor | O Pipe• SminnyD Projects|E3 SSH• Home|Salesforce O 88 [ El Datadog * Claude3 CircleclA SentrySearchSpaces/Jmicey ONew) / $ JY-18309 / [ JY-20771Call Scoring filter for Exec reportsDescription|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 lognoocomienWho is working on this.status upoate.Pro tip: press M to comK tY-Z tY-7 UY-a [Y-8• Mon 18 May 15:14A tY-0 TasksInsights & Coachin…0J Dev0J Al Bookmarks+ CreateAsk Rovo•1|Backdog ~** Improve Story• Details |Assignee& UnassignedAssign to meReporter2 Galya DimitrovaP Quick start development|Link 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-Product|Add optionsLabelsStory point estimate3:14 PM | [Platform] Refinement ®1:26• Mon 18 May 15:14:585Nikolay YankoAneliya AngelovaNikolay IvanovLükas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53546
|
1874
|
44
|
2026-05-18T12:15:00.415925+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106500415_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 • 1 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)OChromeFieEdtTabC Soti© Cor* сim• Cos8app.C Alou3 Pipe© Jm• Simi• Amiwnttosslminny.attassian.net/browso/.fY-207/1lC Jminny• Home|Salesforce 0 O 88 [ El Datadog ® Claude O Circleci8 лмnwY® For you• Recent |#7 Starred%. AppsQ SpacesStarred(9 Service-DeskJiminny (Oid)Jiminny (New) + --1 0D Platform TeamiwotueIID Enterprise Stabilty L.181 Procossing Tearmi(I) SE Kanban |= More spaces= FiitersIB DashboardsOperationsConfiuencea Teams |$; Customise sidebarProjectsE3 SSHA SentrySearchSpaces /Jiminey INew) / $ JY-18309 / [ JY-20771Call Scoring filter for Exec reports• Description|Now that we have the cail 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 whien fetching the calls for aanalisys |SubtasksLinked work itemsActivityHistoryWork l0gAeeecomimeWho is working on this.Status update..Pro tio: press M le comenen2 [Y.2 lY-8a UY-Mon 18 May 15:140 Tasksinsights & Coachin…0 Dev D Ux0J Al Bookomarksl+ CreateAsk Rovo@1|Backlog~* Improve Story• Details |Assignee& UnassignedAssign to meReporter2 Gaya Dimitrova• Quick start developmentLink this work itemn to your code byIncluding keys when creatingabranch, commi, or pull requestbelow. Leamn moreDismissDevelopmentOpen with VS Code!J Create branch1 Create commit|ComponentsPiatformSub-Product|Adid optionsLabelsNone3:14 PM| [Platform] Refinement ®1:27• Mon 18 May 15:15:005Nikolay YankoAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
-5048452374230719097
|
NULL
|
click
|
ocr
|
NULL
|
FirefoxFileEditViewHistoryBookmarksProfilesToolsWi FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpSupport Daily • 1 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comNikolay Yankov (Presenting)OChromeFieEdtTabC Soti© Cor* сim• Cos8app.C Alou3 Pipe© Jm• Simi• Amiwnttosslminny.attassian.net/browso/.fY-207/1lC Jminny• Home|Salesforce 0 O 88 [ El Datadog ® Claude O Circleci8 лмnwY® For you• Recent |#7 Starred%. AppsQ SpacesStarred(9 Service-DeskJiminny (Oid)Jiminny (New) + --1 0D Platform TeamiwotueIID Enterprise Stabilty L.181 Procossing Tearmi(I) SE Kanban |= More spaces= FiitersIB DashboardsOperationsConfiuencea Teams |$; Customise sidebarProjectsE3 SSHA SentrySearchSpaces /Jiminey INew) / $ JY-18309 / [ JY-20771Call Scoring filter for Exec reports• Description|Now that we have the cail 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 whien fetching the calls for aanalisys |SubtasksLinked work itemsActivityHistoryWork l0gAeeecomimeWho is working on this.Status update..Pro tio: press M le comenen2 [Y.2 lY-8a UY-Mon 18 May 15:140 Tasksinsights & Coachin…0 Dev D Ux0J Al Bookomarksl+ CreateAsk Rovo@1|Backlog~* Improve Story• Details |Assignee& UnassignedAssign to meReporter2 Gaya Dimitrova• Quick start developmentLink this work itemn to your code byIncluding keys when creatingabranch, commi, or pull requestbelow. Leamn moreDismissDevelopmentOpen with VS Code!J Create branch1 Create commit|ComponentsPiatformSub-Product|Adid optionsLabelsNone3:14 PM| [Platform] Refinement ®1:27• Mon 18 May 15:15:005Nikolay YankoAneliya AngelovaNikolay IvanovLukas Kovalik...
|
53545
|
NULL
|
NULL
|
NULL
|
|
53547
|
1875
|
16
|
2026-05-18T12:15:00.562180+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106500562_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
|
PhpStormVIewINavicarecodeLaravelRefactorTOOISWindo PhpStormVIewINavicarecodeLaravelRefactorTOOISWindowFV faVsco.js?9 master k. vProiect vC ActivityController.ongC BaseService.onp© SoftPhoneManager.phpg constants.ong(C) CoreUserRequest.onpo seimFrovistoning.onpx© CoreUser.php• Scimintertace.ongD SeederW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio• ™ 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 CommandsM Activities>M AnalvticcCalendarsv MCrmM Huhsnotclass Sc1mProv1s10n1ngn assignRolesFromScim(User Suser, CoreUserRequest Sato, Team Steam): void['roles' => SroleIdsl."roles' =>'array")'man:1'new DependentRolesPule(SvisibleRoles)lnew ListenerRoleCannotHaveAdmin0rManagerPermissionRule($visibleRoles),'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): GrcD IntegrationApp• M TraitsC) Addl avoutEntities.nhn© AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountl6 Pullborn Command Ahctrant nhn(e) RullbornDinaCommand nhn1 1 of 4 edits JAccept File &+X Reject File 4%€+ 5 of 8 files →=laravel.log« SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]& console [EU]A console [STAGING] X554555556557558BLTS-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 ceams c on r.ceam 10 = c.10hckE r.trequency = "dallyAND t.status = 'active'AND (r.expices.at >= now() OR r.expices._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 * fromJtomated_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 = 2ªSFLECT * 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 saJOIN users u on u.id = sa.sociable idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idll. "23460 ownen)"supoont Dally • 1m lert100% 1• Mon 18 May 15:15:00AskJiminnyReportActivityServiceTest 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 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/Userl ẞ RoleAttrTest.ohn +224* Reiect alliiAccent alliAsk anvthina 884-L)« Code SWF-1.6WN Windsurf Toams 284-57 UTF.8io 4 spaces...
|
NULL
|
-7230456010349869604
|
NULL
|
click
|
ocr
|
NULL
|
PhpStormVIewINavicarecodeLaravelRefactorTOOISWindo PhpStormVIewINavicarecodeLaravelRefactorTOOISWindowFV faVsco.js?9 master k. vProiect vC ActivityController.ongC BaseService.onp© SoftPhoneManager.phpg constants.ong(C) CoreUserRequest.onpo seimFrovistoning.onpx© CoreUser.php• Scimintertace.ongD SeederW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio• ™ 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 CommandsM Activities>M AnalvticcCalendarsv MCrmM Huhsnotclass Sc1mProv1s10n1ngn assignRolesFromScim(User Suser, CoreUserRequest Sato, Team Steam): void['roles' => SroleIdsl."roles' =>'array")'man:1'new DependentRolesPule(SvisibleRoles)lnew ListenerRoleCannotHaveAdmin0rManagerPermissionRule($visibleRoles),'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): GrcD IntegrationApp• M TraitsC) Addl avoutEntities.nhn© AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountl6 Pullborn Command Ahctrant nhn(e) RullbornDinaCommand nhn1 1 of 4 edits JAccept File &+X Reject File 4%€+ 5 of 8 files →=laravel.log« SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]& console [EU]A console [STAGING] X554555556557558BLTS-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 ceams c on r.ceam 10 = c.10hckE r.trequency = "dallyAND t.status = 'active'AND (r.expices.at >= now() OR r.expices._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 * fromJtomated_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 = 2ªSFLECT * 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 saJOIN users u on u.id = sa.sociable idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idll. "23460 ownen)"supoont Dally • 1m lert100% 1• Mon 18 May 15:15:00AskJiminnyReportActivityServiceTest 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 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/Userl ẞ RoleAttrTest.ohn +224* Reiect alliiAccent alliAsk anvthina 884-L)« Code SWF-1.6WN Windsurf Toams 284-57 UTF.8io 4 spaces...
|
53544
|
NULL
|
NULL
|
NULL
|
|
53548
|
1874
|
45
|
2026-05-18T12:15:03.156795+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106503156_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)...
|
[{"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}]...
|
-3517731617327076516
|
3170609403504383686
|
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)
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$Nikolay Yankov (Presenting)FleEditTabF ProjSchl© Cost5app.C AlO Э Pіфк• Jimiwhttosslminny.atlassian.net/browse/fY-20771l• Jminny• Home|Salesforce O 88 [ El Datadog ® * Claude3 Circieci8 JмInYFor you• Recent |# Starred8. AppsQ SpacesStarred(Y) Service-DeskJiminny (Oid)Jiminny (New) + ...ICD Platform TeamIID Enterprise Stability L...IID Processing TeamIID SE Kanban= More spaces= Filters(B DashboardsOperations3 Confiuence:: Teams%; Customise sidebarProjectsE3 SSHA SentrySearchSpaces/Jminny INew) / $ JY-18309 / [ JY-20771Call 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 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 itemsActivityCommentsWork lognooecomienWho is working on this..status upoate.Pro tios press M to commC EY-2 tY-a[JY-8• Mon 18 May 16:15a UY-0J Tasks|7 insights & Coachin…0 Dev T0J Al Bookomarka+ CreateAsk Rovo@1|Backdog~* Improve Story• DetailsAssignee8 UnassignedAssign to meReporter2 Galya DimitrovaP Quick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismissDevelopmentQ Open with VS CodeIJ Create branch, Create commit |ComponentsPlatformSub-Product|Add optionsLabelsStory point estimate3:15 PM | [Platform] Refinement ®1:30100% <78• Mon 18 May 15:15:02=5Nikolay YankoAneliya AngelovaNikolay IvanovLükas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53549
|
1875
|
17
|
2026-05-18T12:15:05.373205+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106505373_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)...
|
[{"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}]...
|
842196179027237811
|
4467789032698697414
|
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)
PnostormVIewINavicatecodeFV faVsco.js°9 master k >roledey(c) Constants.one• Scimintertace.ong© scimProvisioning.onpD SeederW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio• ™ Conference™ ConferenceHandlerC) SoftPhoneManader.ohd© ConferenceCallbackHandler.php© ConferenceManager.phpIMnTOTM EventD ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onp© TwilioRepository.php0 Uploader0 UrlGeneratora UtilityC Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsM Activities>M AnalvticcCalendarsv MCrmM HuhsnotIntegrationApp• M TraitsC) Addl avoutEntities.nhn© AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountle RullbornCommand Ahctraat nhn(e) RullbornDinaCommand nhnKeтactolCActivityController.ongC BaseService.onp© SoftPhoneManager.php(C) CoreUserRequest.onp© ScimProvisioning.php x © CoreUser.phpn lictonorDoloCannotllavo AdminOriarclass ScimProvisioningprivate function assignRolesFromScim(Usen Susen, ConeUsenRequest Sdto, Tean Steam): void['roles' => SroleIdsl."roles' =>'array")main: 1'0new DependentRolesPule(SvisibleRoles)lnew ListenerRoleCannotHaveAdmin0rManagerPermissionRule(SvisibleRoles),'roles.*' => [anstinet""an.• SvisibleRoles->pluck( value: 'id')->implode( value: ',').now lictononPoloPonuinocl ictonenSostunePule/ctoam)lif (Svalidator->fails0) {return:382384sroles = "viszoleroles->wheren key: "1d', Srolelds):Sdto = new UserRolesSvncoT0roles: Sroles.nublic function deleteGroun(Saroun)• hool..?public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Gro=laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]& console [EU]A 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 = 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') = 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 = 2ªSFLECT * 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 saJOIN users u on u.id = sa.sociable idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idll. "23460 ownen)""idi. ko40m lem• мon 10 May 10.10:04CascadeImplement 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/Userl ẞ RoleAttrTest.ohn +224* Reiect alliiAccent alliAsk anvthing 884-D)« Code SWF-1.6W Windsurf Teams 384:57 UTF-8ío 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53550
|
1874
|
46
|
2026-05-18T12:15:06.544158+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106506544_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 FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$Nikolay Yankov (Presenting)EditHistoryF ProliSch• Cos5app.G Aloo Pioel0 Jm• Jmhttps:/fjminny.atiassian.net/browse/JY-20771• Sminny• Home l Salesforce M O 88 L El Datadog Caude O Circleci8 Лмinиуg For you© Recent|# Starred8: AppsQ SpacesStarredY Service-DeskJiminny (Oid)Jiminny (New)I ( Platform Team(ID Enterprise Stability L...(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams% Customise sidebarProjects |E3 SSHA SentrySearchSpaces/Iminy (New) / $ JY-18308 / [ JY-20771Call Scoring filter for Exec reports• DescriptionNow that we have the call scoring feature, customers are asking for their report to be done only on calts 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 logAooecomnerWho is working on this..?status upoate.Pro tios press M to comeseeMen 18 May 15:15a EY2 LY-a [JY-0 TasksZ Insights & Coachin.CJ Al Bockmarks+ CreateAsk RovoBackdog~* Improve StoryDetailsAssignee& UnassignedAssign to meReporter2 Galya DimitrovaP Quick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or puli requestbelow. Learn moreDismissDevelopmentOpen with VS CodeIJ Create branchCreate commit |ComponentsPlatformSub-Product|Add optionsLabelsStory point estimate3:15 PM | [Platform] Refinement ®1:33100% <78• Mon 18 May 15:15:06=5Nikolay YankovAneliya AngelovaNikolay IvanovLükas Kovalik11I...
|
NULL
|
-8837635831130069365
|
NULL
|
visual_change
|
ocr
|
NULL
|
FirefoxFileEditViewHistoryBookmarksProfilesToolsWi FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$Nikolay Yankov (Presenting)EditHistoryF ProliSch• Cos5app.G Aloo Pioel0 Jm• Jmhttps:/fjminny.atiassian.net/browse/JY-20771• Sminny• Home l Salesforce M O 88 L El Datadog Caude O Circleci8 Лмinиуg For you© Recent|# Starred8: AppsQ SpacesStarredY Service-DeskJiminny (Oid)Jiminny (New)I ( Platform Team(ID Enterprise Stability L...(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams% Customise sidebarProjects |E3 SSHA SentrySearchSpaces/Iminy (New) / $ JY-18308 / [ JY-20771Call Scoring filter for Exec reports• DescriptionNow that we have the call scoring feature, customers are asking for their report to be done only on calts 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 logAooecomnerWho is working on this..?status upoate.Pro tios press M to comeseeMen 18 May 15:15a EY2 LY-a [JY-0 TasksZ Insights & Coachin.CJ Al Bockmarks+ CreateAsk RovoBackdog~* Improve StoryDetailsAssignee& UnassignedAssign to meReporter2 Galya DimitrovaP Quick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or puli requestbelow. Learn moreDismissDevelopmentOpen with VS CodeIJ Create branchCreate commit |ComponentsPlatformSub-Product|Add optionsLabelsStory point estimate3:15 PM | [Platform] Refinement ®1:33100% <78• Mon 18 May 15:15:06=5Nikolay YankovAneliya AngelovaNikolay IvanovLükas Kovalik11I...
|
53548
|
NULL
|
NULL
|
NULL
|
|
53551
|
1874
|
47
|
2026-05-18T12:15:09.568256+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106509568_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...
|
[{"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}]...
|
3657525577202427294
|
3314779464157905542
|
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
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•18Nikolay Yankov (Presenting)ChrorssFleEditM inboF ProiCos. app. Allor O Pioe• Smi• Jmlhttps:/fiminny.atlassian.net/browse/JY-2077188• Jminny• Home | Salestorce O 88 L El Datadog X Clude O Circieci8 ЛмINNY* For you© Recent# Starred8. AppsQ SpacesStarred(9 Service-DeskJiminny (Old)Jiminny (New) + -.I0D Platform TeamIID Capture TeamIID Enterprise Stablity L.181 Procossing TeamCID SE Kanban |— More soacesi= Fiiters(B DashboardsOperationsConfluence:: Teams%; Customise sidebarD Projects|E3 SSHA SentrySearchspaces/CJminey (vew)/ Jy-19309[ лY-20771Call Scoring filter for Exec reports• DescriptionNow 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).tnciude the con scoring tinee tn the cxoc koports secton in kosk• 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 calis for aanalisys |SubtasksLinked work itemsActivityWork lognooo comiienWho is working on this..status upoate.Pro tip: press M to conT tJYK UY-0 Tasksa Insights & Coachin Dev+ CreateAsk RovoBackdog x $X Improve StoryDetailsAssignee8 UnassignedAssign to meReporter2 Galya DimitrovaB Quick start developmentLink this work itern to your code byincluding keys when creatingabranch, commit, or pull requestbelow. Learn moreDismissDevelopmentÇ Open with VS CodeIJ Create branch? Create commit |ComponentsPlattormSub-Product|Add optionsLabelsStory point estimate8• Mon 18 May 15:16CJ Al Bookmarka3:15 PM | [Platform] Refinement ®1:36Lộ3100% <78• Mon 18 May 15:15:09=5Nikolay YankovAneliya AngelovaNikolay IvanovLükas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53552
|
1874
|
48
|
2026-05-18T12:15:12.569135+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106512569_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...
|
[{"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}]...
|
1571556155985306178
|
1875880482177963522
|
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
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$Nikolay Yankov (Presenting)ChromeEditF Prok• Cos: spp. Alor O Pipe• J[URL_WITH_CREDENTIALS] Improve StoryDetailsAssignee& UnassignedAssign to meReporter& Galya DimitrovaQuick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismissDevelopmentQ Open with VS CodeIJ Create branchCreate commit |ComponentsPlatformSub-Product|Add optionsLabeisStory point estimate3:15 PM | [Platform] Refinement ®..•1:39100% <78• Mon 18 May 15:15:12=5Nikolay Yanko)Aneliya AngelovaNikolay IvanovLükas Kovalik...
|
53551
|
NULL
|
NULL
|
NULL
|
|
53553
|
1874
|
49
|
2026-05-18T12:15:15.598944+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106515598_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
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$Nikolay Yankov (Presenting)enhomtEdittonetTabF Prok• Con: app. | Allor O Pipe:httos:/minny.atiassian.net/browse/JY-20771l• Sminny888 JMINY* For you© Recent|# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Jiminny (New) + ...I CD Platform TeamIID Enterprise Stabillty L...111 Processing Team(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuencei: Teams%; Customise sidebarProjects |E3 SSH• Home | Salesforce O 88 El Datadoo © # Ciaude3 CircleciA SentrySearchSpaces/Imicay ONew) / $ JY-18309 / [ 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 can scoring taser tn the cxoc koports secuon in nosk• 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 aanalisys|SubtasksLinked work itemsActivityWork logRooacommenWho is working on this.?Status update...Pro tio: press M to conK [JY-0J Tasks+ CreateZ Y-7 [Y-a [JY-8• Mon 18 May 15:16AUY-7 Insights & Coachin…0J DevDJ Al BookmarkalAsk Rovo•1|Backdog~** Improve StoryDetailsAssignee8 UnassignedAssign to meReporter& Galya DimitrovaQuick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismissDevelopmentQ Open with VS CodeJJ Create branchCreate commit |ComponentsPlatformSub-ProductAdd optionsLabelsStory point estimate3:15 PM | [Platform] Refinement ®..•1:42100% <78• Mon 18 May 15:15:155=Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53554
|
1874
|
50
|
2026-05-18T12:15:21.637068+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106521637_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:15
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...
|
[{"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:15","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.02048611,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07430556,"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.108333334,"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.108333334,"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}]...
|
4109083569181373775
|
2220406936271385398
|
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:15
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
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+$0))18Nikolay Yankov (Presenting)ChromeFleEditHistoryTabF Proj• Schi• Cos© app.Q Allovo Pon• Jimlhttps:/iminny.atlassian.net/browse/JY-20771• Sminny• Home|Salesforce O 88 [ El Datadog * Clause8 JMINYg For you© Recent |# Starred8. AppsQ SpacesStarredY Service-DeskJiminny (Old)Jiminny (New) + ..I CD Platform TeamIID Enterprise Stabilty L.111 Procossing TeamCID SE Kanban= More spaces(B DashboardsOperations* Confiuencee: Teams|% Customise sidebarProjects |E3 SSH3 CircleciA SentrySearchSpaces/Iminey ONeal) / $ Jy-18309 / [ JY-20771Call Scoring filter for Exec reportsDescriptionNow that we have the call scoring feature, customers are asking for their report to be done only on calts with certain scores (either high or low).|• Inciude the call scoring fiter in the Exec Reports section in Kiosk• use the same dropdown structure that we have in OD• put it before Reciplents• ensure the scores filter applied for the report when fetching the calls for sanalisys |SubtasksLinked work itemsActivityWork l0gnooecomnerWho is working on this..status upoate..Pro tio: press Mi to comT[JY-0J Tasks+ Create8• Mon 18 May 16:16Z UY-7 шY.7 Insights & Coachin.0 Dev0D Al BookmarioAsk Rovo•1|Backdog~* Improve StoryDetailsAssignee8 UnassignedAssign to meReporter2 Galya DimitrovaQuick start developmentLink this work itemn to your code byincluding keys when creating abranch, commit, or pull requestecow. LodtttosDismissDevelopment[ Open with VS Code!J Create branch1 Create commit|ComponentsPlatformSub-Product|Add optionsLabelsStory point estimate3:15 PM | [Platform] Refinement ®..•1:48100% <478• Mon 18 May 15:15:21=5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
53553
|
NULL
|
NULL
|
NULL
|
|
53555
|
1874
|
51
|
2026-05-18T12:15:24.699920+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106524699_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:15
PM
[Platform] Refinement 🔍
[Platform] Refinement 🔍...
|
[{"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:15","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.02048611,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07430556,"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.108333334,"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.108333334,"top":0.9438889,"width":0.12881945,"height":0.023333333},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
8148150199782350926
|
-7457695738269541870
|
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:15
PM
[Platform] Refinement 🔍
[Platform] Refinement 🔍
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$18Nikolay Yankov (Presenting)ChromeEdtM Inbo2 PlatiF Prok• AtteSchi• Curs|• Cos: app.Q Allov3 Pipel• Jimilihttps://jminny.atlassian.net/browse/JY-20771C Sminny8 JMINNY* For you© Recent# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Oid)Jiminny (New)I CD Platform TeamIID Enterprise Stabllity I...111 Processing TeamCID SE Kanban |— More soacesi= Filters(B DashboardsOperationsx Confiuenceaz Teams|% Customise sidebarCo ProjectsE3 SSH• Home | Salesforce O 8 L E Datadog © * Claude|3 CircieciA SentrySearchSpaces/LIminey (New) / $ Jy-18309 / A JY-20771Call 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 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 aanalisys |SubtasksLinked work itemsActivityCommentsWork logAooecomierWho is working on this.?Status update.Pro tioc press M to conT[JY-a ur.a wY.a(Y-8• Mon 18 May 15:15C [Y-- Taske2l Insights & Coachin..[J Dev|C Al Bookmarka+ CreateAsk Rovo•1|Backdog~* Improve StoryDetailsAssignee& UnassignedAssign to meReporter2 Galya DimitrovaQuick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestocow, Loart toreDismissDevelopmentQ Open with VS CodeIJ Create branchCreate commit |ComponentsPlatformSub-Product|Add optionsLabelsStory point estimate3:15 PM | [Platform] Refinement ®1:51100% <478• Mon 18 May 15:15:24=20 5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53556
|
NULL
|
0
|
2026-05-18T12:15:24.933109+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106524933_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
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.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":"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 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}]...
|
6772014133629545213
|
-7457836480052864494
|
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
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.
PnostormVIewINavicatecodeFV faVsco.js°9 master k >roledey(c) Constants.one• Scimintertace.ong© scimProvisioning.onpD SeederW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio• ™ Conference™ ConferenceHandlerC) SoftPhoneManader.ohd© ConferenceCallbackHandler.php© ConferenceManager.phpIMnTOTM EventD ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onp© TwilioRepository.php0 Uploader0 UrlGeneratora UtilityC Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsM Activities>M Analvticc• Calendarsv MCrmM HuhsnotIntegrationApp• M TraitsC) Addl avoutEntities.nhn© AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountle RullbornCommand Ahctraat nhn(e) RullbornDinaCommand nhnKeтactolCActivityController.ongC BaseService.onp© SoftPhoneManager.php(C) CoreUserRequest.onp© ScimProvisioning.php x © CoreUser.phpn lictonorDoloCannotllavo AdminOriarclass 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 lictononPoloPonuinocl ictonenSostunePule/ctoam)lif (Svalidator->fails0) {return?382384sroles = "viszoleroles->wheren key: "1d', Srolelds):Sdto = new UserRolesSvncoT0roles: Sroles.nublic function deleteGroun(Saroun)• hool..?public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Gro=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: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') = 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 = 2ªSFLECT * 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 saJOIN users u on u.id = sa.sociable idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idll. "23460 ownen)""idi. ko40m lem• мon 10 May 10.10-24CascadeImplement 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 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/Userl ẞ RoleAttrTest.ohn +224* Reiect alliiAccent alliAsk anvthina 884-L)« Code SWF-1.6W Windsurf Teams 384:57 UTF-8ío 4 spaces...
|
53549
|
NULL
|
NULL
|
NULL
|
|
53557
|
1874
|
52
|
2026-05-18T12:15:27.684468+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106527684_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:15
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
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":"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:15","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.02048611,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07430556,"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.108333334,"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.108333334,"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":"Your microphone is off.","depth":8,"on_screen":false,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
-8634052456545708958
|
-8588090173769000398
|
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:15
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
Your microphone is off.
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$18Nikolay Yankov (Presenting)ChromeEditM Inbo2 PlatiF ProjiC Schi• Curs|O Cos: app..Q Allo3 Pipehttps://iminny.atlassian.net/browse/JY-20771C Sminny |od8 JMINNY* For you© Recent |# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Jiminny (New) + .ICID Platform TeamID Enterprise Stability L...IID Processing Team(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuenceaz Teams|% Customise sidebarDo ProjectsE3 SSH• Home| Salesforce • O 8 El E4 Datadog ©* Claude3 CircleCiSearchSpaces/Imicey ONew) / $ JY-18309 / [ JY-20771Call Scoring filter for Exec reports• DescriptionNow 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 aanalisysSubtasksLinked work itemsActivityWork logRooacomienWho is working on this.?status upoate.Pro tip: press M to col8• Mon 18 May 15:15Z [Y-a UY.D Taske7l Insights & Coachin.0 Der0 UxC Al Bookmarics+ CreateAsk Rovo•1|Backdog~** Improve StoryDetailsAssignee& UnassignedAssign to meReporter2 Galya Dimitrova® Quick start developmentLink this work iter to your code byincluding keys when creating abranch, commit, or pull requestbeiow. Learn moreDismissDevelopmentQ Open with VS CodeJ Create branchCreate commit |ComponentsPlatformSub-Product|Add optionsLabelsStory point estimate3:15 PM | [Platform] Refinement ®1:54100% <78• Mon 18 May 15:15:27=5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
53555
|
NULL
|
NULL
|
NULL
|
|
53558
|
NULL
|
0
|
2026-05-18T12:15:30.724920+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106530724_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.
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$оті18Nikolay Yankov (Presenting)ChromeEditM InboPlatiF ProkSchil• curs• Cos: app. | C AlloroPiot#httossvmC Sminny |o Circiec8 JMINNY® For youRecent |# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Jiminny (New) + ..ICD Platform TeamAID Capture TeamIID Enterprise Stability L...111 Processing Team(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams% Customise sidebarDo ProjectsE3 SSH• Home| Salesforce• O 8 L E4 Datadog ©* ClaudeSearchSpaces/Imicey ONew) / $ JY-18309 / [ JY-20771Call Scoring filter for Exec reports• DescriptionNow 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 aanalisys|SubtasksLinked work itemsActivityWork lognoeacomierWho is working on this.?status upoate.Pro tip: press M to comK [JY.Z UY.a wYea [Y-8• Mon 18 May 15:15A (Y-5 Tasie7 Insights & Coachin..0J Dev0 uxC Al Bookomaris+ CreateAsk Rovo•1|Backdog~** Improve StoryDetailsAssignee& UnassignedAssign to meReporter2 Galya Dimitrova® Quick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismissDevelopmentQ Open with VS CodeIJ Create branch, Create commit |ComponentsPlatformSub-Product|Add optionsLabelsStory point estimate3:15 PM | [Platform] Refinement ®1:57100% <78• Mon 18 May 15:15:30=5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53560
|
1877
|
0
|
2026-05-18T12:15:44.207710+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106544207_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...
|
[{"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}]...
|
45539928409304178
|
3177421873742628514
|
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
PnostormVIewINavicatecodeFV faVsco.js°9 master k >roledey(c) Constants.one• Scimintertace.ong© scimProvisioning.onpD SeederW sentryW senlalizerSettingsSidekickW Slackw Transcriptionaaiwillio• ™ Conference™ ConferenceHandlerC) SoftPhoneManader.ohd© ConferenceCallbackHandler.php© ConferenceManager.phpIMnTOTM EventD ExceptionD JobTh Recolverm CorvicoDvO(c) TwilioConstants.onp© TwilioRepository.php0 Uploader0 UrlGeneratora UtilityC Uuid_ Waverorm_WeohooksM Workflow> M ConfigurationM Consolev CommandsM Activities>M Analvticc• Calendarsv MCrmM HuhsnotIntegrationApp• M TraitsC) Addl avoutEntities.nhn© AutologDelayedCommand.php9 Pockfill@nnortunitvllcorSromAccountle RullbornCommand Ahctraat nhn(e) RullbornDinaCommand nhnKeтactolCActivityController.ongC BaseService.onp© SoftPhoneManager.php(C) CoreUserRequest.onp© ScimProvisioning.php x © CoreUser.phpn lictonorDoloCannotllavo AdminOriarclass 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 lictononPoloPonuinocl ictonenSostunePule/ctoam)lif (Svalidator->fails0) {return?382384sroles = "viszoleroles->wheren key: "1d', Srolelds):Sdto = new UserRolesSvncoT0roles: Sroles.nublic function deleteGroun(Saroun)• hool..?public function createNewGroup(CoreGroupRequest $dto, Team $team): ?Group{...}public function updateGroupAttributesIfChanged(Group $group, CoreGroupRequest $dto, Team $team): Gro=laravel.log4 SF jiminny@localhost]4 HS_local [jiminny@localhost]& console [PROD]& console [EU]A 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 = 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') = 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 = 2ªSFLECT * 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 saJOIN users u on u.id = sa.sociable idWHEPE uteam id = 1029 and sa-nnoviden = 'ninednive'."usen idll. "23460 ownen)""idi. ko40m lem• мon 10 May 10.10.48CascadeImplement 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 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/Userl ẞ RoleAttrTest.ohn +224* Reiect alliiAccent alliAsk anvthina 884-L)« Code SWF-1.6W Windsurf Teams 384:57 UTF-8ío 4 spaces...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53559
|
1876
|
0
|
2026-05-18T12:15:44.236184+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106544236_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...
|
[{"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}]...
|
6754512188518343561
|
3321541459855561858
|
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
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$18Nikolay Yankov (Presenting)ChromeEditM Inbo2 PlatiF ProkC Schi• curs• Cos: app. | C Allor | 3 Picel#httosmC Sminny |od8 JMINAY® For you© Recent|# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Jiminny (New) + ...ICD Platform TeamIID Enterprise Stabillty L...111 Processing Team(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams% Customise sidebarCo ProjectsE3 SSH• Home | Salesforce • O 8 L Ee Datadog ©* Claude3 CircleCiSearchSpaces/Imicey ONew) / $ JY-18309 / [ JY-20771Call 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 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 aanalisys |SubtasksLinked work itemsActivityWork lognocomieWho is working on this.status upoate.Pro tip: press M to conK [JY.a UY-1a wY-a [Y-8• Mon 18 May 15:15C UY-- Tasiol7 Insights & Coachin.0J Der0 uxC All Bookomarks+ CreateAsk RovoBackdog~** Improve StoryDetailsAssignee& UnassignedAssign to meReporter2 Galya DimitrovaP Quick 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 branchCreate commit |ComponentsPlatformSub-Product|Add optionsLabelsStory point estimate3:15 PM | [Platform] Refinement ®2:11Lộ3100% <78• Mon 18 May 15:15:43=5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik11I...
|
53558
|
NULL
|
NULL
|
NULL
|
|
53561
|
1876
|
1
|
2026-05-18T12:15:45.866683+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106545866_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
You can't unmute someone else...
|
[{"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":"You can't unmute someone else","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":false,"is_focused":false,"is_selected":false}]...
|
4961428285407893000
|
1729507034658690578
|
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
You can't unmute someone else
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$оті|18Nikolay Yankov (Presenting)ChromeEditM Inbo2 PlatiF ProjtC Schi• Curs• Cos: app. | C Allov | 3 Picel#httosmC Sminny |8 JMINAY® For you© Recent |# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Jiminny (New) + ...ICD Platform TeamIID Enterprise Stabillty L...111 Processing Team(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams% Customise sidebarCo ProjectsE3 SSH• Home| Salesforce O 8 [l Ee Datadog % Claude3 CircleCiSearchSpaces/Imicey ONew) / $ JY-18309 / [ JY-20771Call 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 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 aanalisys |SubtasksLinked work itemsActivityWork lognoocomieWho is working on this.status upoate.Pro tip: press M to con8• Mon 18 May 15:15K [Y.a UY-1a wY-a [Y-- Tasiol7 Insights & Coachin.0J Der0 ux+ CreateAsk RovoBackdog~** 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 moreDismissDevelopmentQ Open with VS Code!J Create branchCreate commit |ComponentsPlatformSub-Product|Add optionsLabelsStory point estimate3:15 PM | [Platform] Refinement ®2:12100% <78• Mon 18 May 15:15:45=5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53562
|
1876
|
2
|
2026-05-18T12:15:48.887327+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106548887_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
You can't unmute someone else
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...
|
[{"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":"You can't unmute someone else","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":false,"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"}]...
|
-4388541853401521273
|
-7455443663636669934
|
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
You can't unmute someone else
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
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelpPreparation for Refi... 45 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$оті|18Nikolay Yankov (Presenting)ChromeEditM Inbo2 PlatiF ProkC Schi• Curs• Cos: app. | C Allov | 3 Picel#httosmC Sminny |8 JMINAY® For you© Recent|# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Jiminny (New) + ...ICD Platform TeamIID Enterprise Stabillty L...111 Processing Team(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams% Customise sidebarCo ProjectsE3 SSH• Home| Salesforce O 8 [l Ee Datadog % Claude3 CircleCiSearchSpaces/Imicey ONew) / $ JY-18309 / [ JY-20771Call 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 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 aanalisys |SubtasksLinked work itemsActivityWork lognoocomieWho is working on this.status upoate.Pro tip: press M to conK [Y.a UY-12 wY-a [Y-8• Mon 18 May 15:15C UY-- Tasiol7 Insights & Coachin.0J Der0 uxC All Bookomarks+ CreateAsk RovoBackdog~** Improve StoryDetailsAssignee& UnassignedAssign to meReporter2 Galya DimitrovaP Quick 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 branchCreate commit |ComponentsPlatformSub-Product|Add optionsLabelsStory point estimate3:15 PM | [Platform] Refinement ®2:15100% <78• Mon 18 May 15:15:485=Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
53561
|
NULL
|
NULL
|
NULL
|
|
53563
|
1876
|
3
|
2026-05-18T12:16:04.006422+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106564006_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
3:16
PM
[Platform] Refinement 🔍
[Platform] Refinement 🔍
Audio settings
Turn on microphone
Video settings
Turn on camera
Nikolay Yankov is presenting...
|
[{"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":"AXStaticText","text":"3:16","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.02048611,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07430556,"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.108333334,"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.108333334,"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":false,"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 on 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":true,"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}]...
|
1252494501695766185
|
-7455434867487287278
|
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
3:16
PM
[Platform] Refinement 🔍
[Platform] Refinement 🔍
Audio settings
Turn on microphone
Video settings
Turn on camera
Nikolay Yankov is presenting
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelp• 0§ Preparation for Refi... 44 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$Nikolay Yankov (Presenting)ChromeEditTabM InboF ProkSchilCost app.xAllovo Piod• Jm• Jminny• Home|Salesforce M O 8 [ El Datadog * Claude3 Circleci8 JiMINNY® For you© Recent |# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Old)Jiminny (New)I(ID Platform TeamIID Enterprise Stabillty L...111 Processing Team(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams% Customise sidebarProjects |E3 SSHA SentrySearchSpaces/Imicey ONew) / $ JY-18309 / [ JY-20771Call 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 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 sanalisysSubtasksLinked work itemsActivityWork lognooacommiienWho is working on this.status upoate.ThanksPro tip: press M to conK [JY-0 Tasks+ CreateZ UY-K tY.a [Y-8 • Mon 18 May 15:16A UY-7 Insights & Coachin.0 DevDD Al BookmarkaAsk RovoBackdog~** Improve Story• Details |Assignee& UnassignedAssign to meReporter2 Galya DimitrovaP Quick 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 branchCreate commit |ComponentsPlatformSub-Product|Add optionsLabelsStory point estimate3:16 PM | [Platform] Refinement ®2:31100% <8• Mon 18 May 15:16:03=20 5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik...
|
NULL
|
NULL
|
NULL
|
NULL
|
|
53564
|
1876
|
4
|
2026-05-18T12:16:07.008043+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106567008_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...
|
[{"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}]...
|
1571556155985306178
|
1875880482177963522
|
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
FirefoxFileEditViewHistoryBookmarksProfilesToolsWindowHelp• 0§ Preparation for Refi... 44 m leftmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.com+•$Nikolay Yankov (Presenting)ChromeEditHistoryTabM InboF ProjtSchiCurs* Claul• Cos:| app.: | C AlloroPiot• Jmil• Sminny• Home | Salesforce M O 8 El Datadog ® * Claude3 Circleci8 JIMINNY® For you© Recent|# Starred8. AppsQ SpacesStarred(9) Service-DeskJiminny (Oid)Jiminny (New) + ..ICD Platform TeamIID Enterprise Stability L...IID Processing Team(ID SE Kanban= More spaces= Filters(B DashboardsOperationsx Confiuence:: Teams% Customise sidebarProjects |E3 SSHA Sentry|SearchSpaces/Iminey ONew) / $ JY-18309 / [ JY-20771Call Scoring filter for Exec reports• DescriptionNow 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).|inciude the can scoring taver tn the cxec koports secuon in mosk• use the same dropdown structure that we have in OD• put it before Recipients• ensure the scores filter applied for the report winen fetching the calls for aanalisysSubtasksLinked work itemsActivityWork lognoocomneWho is working on this.Status upoate.Pro tip: press M to com7 tY-0 Tasks+ CreateZ Y-a (Y-8• Mon 18 May 15:16a UY-7 Insights & Coachin…0 Dev0J Al BookmarkaAsk Rovo•1|Backdog ~** Improve StoryDetailsAssignee& UnassignedAssign to meReporter¿ Calya DimitrovaQuick start developmentLink this work item to your code byincluding keys when creating abranch, commit, or pull requestbelow. Learn moreDismissDevelopmentQ Open with VS CodeIJ Create branchCreate commit |ComponentsPlatformSub-ProductAdd optionsLabelsStory point estimate3:16 PM | [Platform] Refinement ®2:34100% <8• Mon 18 May 15:16:06=20 5Nikolay YankovAneliya AngelovaNikolay Ivanov)Lukas Kovalik...
|
53563
|
NULL
|
NULL
|
NULL
|
|
53565
|
1876
|
5
|
2026-05-18T12:16:10.036106+00:00
|
/Users/lukas/.screenpipe/data/data/2026-05-18/1779 /Users/lukas/.screenpipe/data/data/2026-05-18/1779106570036_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
3:16
PM
[Platform] Refinement 🔍
[Platform] Refinement 🔍
Audio settings
Turn on microphone
Video settings
Turn on 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 camera 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":"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":"AXStaticText","text":"3:16","depth":12,"bounds":{"left":0.050347224,"top":0.9444444,"width":0.02048611,"height":0.022777777},"on_screen":true,"help_text":"","role_description":"text","subrole":"AXUnknown"},{"role":"AXStaticText","text":"PM","depth":12,"bounds":{"left":0.07430556,"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.108333334,"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.108333334,"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":false,"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 on 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":true,"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 camera is off.","depth":8,"on_screen":false,"help_text":"","role_description":"text","subrole":"AXUnknown"}]...
|
-3681742096078528527
|
-8585909842213086704
|
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
3:16
PM
[Platform] Refinement 🔍
[Platform] Refinement 🔍
Audio settings
Turn on microphone
Video settings
Turn on 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 camera is off.
+FirefoxProfilesToolsWindow§ Preparation for Refi... 44 m leftFileEditViewHistory→Nikolay Yankov (Presenting)ehomoEditViewHistoryoetmat7 PlatiF Projt• JminnyBookmarksHelpmeet.google.com/cxs-eips-npt?authuser=lukas.kovalik%40jiminny.comTabAtteD ProjectsKioskapplG AllovPe DatadogSC Schio Curs* ClauE AWSE3 SSH• Home | SalesforceCreate Report ©1. Organization details2. Report settingsCOATOMKINOKTME3. Report parametersSelect report type to see parametersIOFORTAS8 • Mon 18 May 15:16Z UY-7 шY-a [Y-0 Tasks7 Insights & Coachin…0 Der0J Al BookmarksК ГО036 41 B2т. q2 Preserve loctDisable cache |O Invert|FetchyOHR Dec© Big request rowsOverviewManitestSocket WasmOther• Group by frame© ScreenshotsCoocos0) i7a=ponxaf%2Fplattor.…6 Rasponxar%2Fplattor...00 form-datawtrerporuaineroo09 i2a=porxa1%2F platto...ttresportatnerpuooe« l2a=ponxa1%2F plattor._esportarreooe0) i2атрonnesssts- (fields: (id: "report_enabler".Cookiesocttosnsoitweu werales or selt anpasoree() I?arponxaf%2Fplattor0) Razponxat%2F plattornane: "Conference"), (id: "dialer*, nase: "Diater)theu coll Duratio o Zoutlyses anteyereredaeoptaod W13122 reguest12.5 k8Lộ33:16 PM | [Platform] Refinement ®2:37100% C8• Mon 18 May 15:16:0920 5Nikolay YankovAneliya AngelovaNikolay IvanovLukas Kovalik11I...
|
NULL
|
NULL
|
NULL
|
NULL
|