Determining media type and RAW+JPEG status in Photos.app

I am trying to do the following two things for items selected in Photos.app:

  • get the media type (ideally jpeg, heic, mov, etc)
  • get the RAW+JPEG pair status: does it have a paired RAW, is the RAW or JPEG selected for editing

I can’t find anything that seems to help in the surprisingly limited AS dictionary provided by Photos. Does anyone have any experience or workarounds with this? Thanks!