msgraphapi
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

Microsoft Fluent GraphAPI

Install

pnpm i msgraphapi

Docs(VitePress)

pnpm run docs:dev

Build

pnpm run build

Usage

Login

import { GraphAPI , ConflictBehavior } from "msgraphapi"
const graphAPI = new GraphAPI({
    clientId: '{clientId}',
    scoped: [PermissionScope.UserReadWrite,PermissionScope.FilesReadWriteAll]
})
// login first: redirect or popup
graphAPI.loginAsync().then(res=>{
    console.log(res)
})

OneDrive

let drive = graphAPI.drive("{driveId|me}")
// fluent call
drive.item("{itemId}").path("{relative path}").getAsync()
// clone context, get FileOrFolder info
drive.clone().item("{itemId2}").path("{relative path}").getAsync()
console.log(drive.itemId)
// cnosole result: {itemId}
// create folder
drive.clone().item().createListAsync({
    name: "folder",
    conflict: ConflictBehavior.Fail
})

LICENSE

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i msgraphapi

Weekly Downloads

0

Version

0.0.1

License

none

Unpacked Size

784 kB

Total Files

10

Last publish

Collaborators

  • minskiter