Skip to content

basalt / drives-microsoft/src / toDriveItem

Function: toDriveItem() ​

> toDriveItem(item): DriveItem

Defined in: drives-microsoft/src/metadata.ts:144

Maps one driveItem.

  • version is cTag, not eTag. Graph bumps eTag for any change, including a rename or a permission edit; cTag moves only when the content does. The dedup ledger prefers version, so using eTag would re-download a file every time somebody renamed it.
  • contentType is file.mimeType and is untrusted by contract — Graph echoes what the uploading client declared, and @basaltkit/files sniffs the bytes regardless.
  • externalUrl is webUrl — stored and shown, never fetched.
  • raw carries the drive id and nothing else. Not the download URL (see GraphItem), and not the whole payload: raw is persisted by sinks, and a Graph item carries user names, email addresses and sharing state that an app did not ask to store.

Parameters ​

item ​

GraphItem

Returns ​

DriveItem

Released under the MIT License.