@@ -191,6 +191,14 @@ paths:
191191 responses:
192192 "200":
193193 description: OK
194+ patch:
195+ operationId: me.UpdateUser
196+ security:
197+ - azureAdDelegated:
198+ - User.ReadWrite
199+ responses:
200+ "200":
201+ description: OK
194202 /me/photo:
195203 get:
196204 operationId: me.photo.GetProfilePhoto
@@ -230,6 +238,36 @@ const noWorkloadSelection = {
230238 tagPrefixes : [ ] ,
231239} as const ;
232240
241+ const profileSelection = {
242+ coversFullGraph : false ,
243+ presetIds : [ "profile" ] ,
244+ customScopes : [ ] ,
245+ exactPaths : [ "/me" , "/me/photo" , "/me/photo/$value" ] ,
246+ pathPrefixes : [ ] ,
247+ tagPrefixes : [ ] ,
248+ } as const ;
249+
250+ type MicrosoftGraphKeepPathItemSelection = Parameters < typeof microsoftGraphKeepPathItem > [ 0 ] ;
251+
252+ const keptIdentityFixturePaths = (
253+ selection : MicrosoftGraphKeepPathItemSelection ,
254+ ) : Map < string , Record < string , unknown > > => {
255+ const structure = structuralSplit ( identityPathFixture ) ;
256+ expect ( structure ) . not . toBeNull ( ) ;
257+ const keepPathItem = microsoftGraphKeepPathItem ( selection ) ;
258+ const kept = new Map < string , Record < string , unknown > > ( ) ;
259+
260+ for ( const range of structure ! . pathItems ) {
261+ const entry = parseEntry ( structure ! . text , range , 2 ) ;
262+ expect ( entry ) . not . toBeNull ( ) ;
263+ const [ path , rawPathItem ] = entry ! ;
264+ const pathItem = keepPathItem ( path , rawPathItem as Record < string , unknown > ) ;
265+ if ( pathItem ) kept . set ( path , pathItem as Record < string , unknown > ) ;
266+ }
267+
268+ return kept ;
269+ } ;
270+
233271const keptPathItem = ( fixture : string ) : Record < string , unknown > => {
234272 const structure = structuralSplit ( fixture ) ;
235273 expect ( structure ) . not . toBeNull ( ) ;
@@ -285,22 +323,19 @@ const responseFileHintKind = (
285323 return Option . getOrUndefined ( hint ) ?. kind ;
286324} ;
287325
288- it ( "keeps bare /me for identity health checks without keeping /me child paths" , ( ) => {
289- const structure = structuralSplit ( identityPathFixture ) ;
290- expect ( structure ) . not . toBeNull ( ) ;
291- const keepPathItem = microsoftGraphKeepPathItem ( noWorkloadSelection ) ;
292- const kept = new Map < string , Record < string , unknown > > ( ) ;
293-
294- for ( const range of structure ! . pathItems ) {
295- const entry = parseEntry ( structure ! . text , range , 2 ) ;
296- expect ( entry ) . not . toBeNull ( ) ;
297- const [ path , rawPathItem ] = entry ! ;
298- const pathItem = keepPathItem ( path , rawPathItem as Record < string , unknown > ) ;
299- if ( pathItem ) kept . set ( path , pathItem as Record < string , unknown > ) ;
300- }
326+ it ( "keeps only GET /me for identity health checks without selected workloads" , ( ) => {
327+ const kept = keptIdentityFixturePaths ( noWorkloadSelection ) ;
301328
302329 expect ( [ ...kept . keys ( ) ] ) . toEqual ( [ "/me" ] ) ;
303330 expect ( kept . get ( "/me" ) ?. get ) . toMatchObject ( { operationId : "me.GetUser" } ) ;
331+ expect ( kept . get ( "/me" ) ?. patch ) . toBeUndefined ( ) ;
332+ } ) ;
333+
334+ it ( "keeps all /me operations when profile selects the path" , ( ) => {
335+ const kept = keptIdentityFixturePaths ( profileSelection ) ;
336+
337+ expect ( kept . get ( "/me" ) ?. get ) . toMatchObject ( { operationId : "me.GetUser" } ) ;
338+ expect ( kept . get ( "/me" ) ?. patch ) . toMatchObject ( { operationId : "me.UpdateUser" } ) ;
304339} ) ;
305340
306341it ( "keeps already-binary drive content responses untouched" , ( ) => {
0 commit comments