Skip to content

Commit

Permalink
Merge pull request #2748 from patrick-rodgers/version-4
Browse files Browse the repository at this point in the history
adding pnpTest WIP
  • Loading branch information
patrick-rodgers authored Aug 11, 2023
2 parents 50fe177 + b6cf032 commit d8aaaae
Show file tree
Hide file tree
Showing 126 changed files with 1,077 additions and 550 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Fixed

- graph
- limitation on chaining site operations from sites.getByUrl

### Added

- graph
- explict error thrown if SPFx context is null or undefined when needed
- followed sites support for users
- ISite now supports `async rebase()` to ensure any ISite is represented by the url pattern /sites/{site id} regardless of how it was first loaded
- ISites.getAllSites()
- support for operations for ISite and IList

- sp
- explict error thrown if SPFx context is null or undefined when needed
Expand All @@ -21,18 +28,22 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- graph
- paged method removed from IGraphQueryableCollection
- ./operations.ts methods moved to ./graphqueryable.ts

- sp
- getPaged method removed from _Items/IItems
- PagedItemCollection removed from library
- removed /items/get-all import, unneeded, use async iterator patterns
- ./operations.ts methods moved to ./spqueryable.ts

### Changed

- graph
- IGraphQueryableCollection now supports async iterator pattern
- IGraphQueryableCollection count method now returns -1 if the collection does not support counting
- All GraphQueryable*, _GraphQueryable*, and IGraphQueryable* have been renamed to remove "Queryable" (ex: GraphQueryableCollection is now GraphCollection)
- @pnp/graph/onedrive renamed to @pnp/graph/files
- ISites.getByUrl is now async

- sp
- _Items and IItems now supports async iterator pattern
Expand Down
22 changes: 11 additions & 11 deletions debug/launch/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ declare var process: { exit(code?: number): void };

export async function Example(settings: any) {

const graph = graphSetup(settings);
const graph = graphSetup(settings);

const users = await graph.users();
Logger.log({
data: users,
level: LogLevel.Info,
message: "List of Users Data",
});
process.exit(0);
}
const users = await graph.users();

Logger.log({
data: users,
level: LogLevel.Info,
message: "List of Users Data",
});

process.exit(0);
}
68 changes: 34 additions & 34 deletions docs/graph/onedrive.md → docs/graph/files.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @pnp/graph/onedrive
# @pnp/graph/files

The ability to manage drives and drive items in Onedrive is a capability introduced in version 1.2.4 of @pnp/graph. Through the methods described
you can manage drives and drive items in Onedrive.
Expand All @@ -16,7 +16,7 @@ import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/groups";
import "@pnp/graph/sites";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -38,7 +38,7 @@ import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/groups";
import "@pnp/graph/sites";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -59,7 +59,7 @@ Using the drives.getById() you can get one of the available drives in Outlook
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -78,7 +78,7 @@ Using the list() you get the associated list information
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -94,7 +94,7 @@ Form more infomration about acting on the IList object see [@pnpjs/graph/lists](
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";
import "@pnp/graph/lists";

const graph = graphfi(...);
Expand All @@ -113,7 +113,7 @@ Using the recent() you get the recent files
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -130,7 +130,7 @@ Using the sharedWithMe() you get the files shared with the user
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -152,7 +152,7 @@ List the items that have been followed by the signed in user.
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -169,7 +169,7 @@ import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/sites";
import "@pnp/graph/groups";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -194,7 +194,7 @@ Using the children() you get the children
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -215,7 +215,7 @@ Using the drive.getItemsByPath() you can get the contents of a particular folder
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -231,9 +231,9 @@ Using the add you can add an item, for more options please user the upload metho

```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";
import "@pnp/graph/users";
import {IDriveItemAddResult} from "@pnp/graph/onedrive";
import {IDriveItemAddResult} from "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -247,9 +247,9 @@ Using the .upload method you can add or update the content of an item.

```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";
import "@pnp/graph/users";
import {IFileOptions, IDriveItemAddResult} from "@pnp/graph/onedrive";
import {IFileOptions, IDriveItemAddResult} from "@pnp/graph/files";

const graph = graphfi(...);

Expand Down Expand Up @@ -282,7 +282,7 @@ Using addFolder you can add a folder

```TypeScript
import { graph } from "@pnp/graph";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";
import "@pnp/graph/users"
import {IDriveItemAddResult} from "@pnp/graph/ondrive";

Expand All @@ -300,7 +300,7 @@ Using the search() you can search for items, and optionally select properties
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -320,7 +320,7 @@ Using the items.getById() you can get a specific item from the current drive
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -337,7 +337,7 @@ Using the drive.getItemByPath() you can get a specific item from the current dri
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -354,7 +354,7 @@ Using the item.getContent() you can get the content of a file.
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand Down Expand Up @@ -385,7 +385,7 @@ Using the item.convertContent() you can get a PDF version of the file. See [offi
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand Down Expand Up @@ -414,7 +414,7 @@ Using the thumbnails() you get the thumbnails
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -431,7 +431,7 @@ Using the delete() you delete the current item
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -448,7 +448,7 @@ Using the update() you update the current item
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -465,7 +465,7 @@ Using the move() you move the current item, and optionally update it
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -491,7 +491,7 @@ Using the copy() you can copy the current item to a new location, returns the pa
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -517,8 +517,8 @@ Using the users default drive you can get special folders, including: Documents,
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import { SpecialFolder, IDriveItem } from "@pnp/graph/onedrive";
import "@pnp/graph/files";
import { SpecialFolder, IDriveItem } from "@pnp/graph/files";

const graph = graphfi(...);

Expand All @@ -540,8 +540,8 @@ If you want to obtain long-lived embeddable links, use the createLink API instea
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import { IPreviewOptions, IDriveItemPreviewInfo } from "@pnp/graph/onedrive";
import "@pnp/graph/files";
import { IPreviewOptions, IDriveItemPreviewInfo } from "@pnp/graph/files";
import { ItemPreviewInfo } from "@microsoft/microsoft-graph-types"

const graph = graphfi(...);
Expand All @@ -566,7 +566,7 @@ Track changes in a driveItem and its children over time.
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import "@pnp/graph/files";
import { IDeltaItems } from "@pnp/graph/ondrive";

const graph = graphfi(...);
Expand Down Expand Up @@ -596,8 +596,8 @@ Using the analytics() you get the ItemAnalytics for a DriveItem
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/users";
import "@pnp/graph/onedrive";
import { IAnalyticsOptions } from "@pnp/graph/onedrive";
import "@pnp/graph/files";
import { IAnalyticsOptions } from "@pnp/graph/files";

const graph = graphfi(...);

Expand Down
22 changes: 22 additions & 0 deletions docs/graph/operations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# @pnp/graph/operations

Provides capabilities related to rich long-running operations.

[![Selective Imports Banner](https://img.shields.io/badge/Selective%20Imports-informational.svg)](../concepts/selective-imports.md)

## list site operations

```TypeScript
import "@pnp/graph/sites";
import "@pnp/graph/operations";

const graph = graphfi(...);

// using getByUrl
const site = await graph.sites.getByUrl("tenant.sharepoint.com", "/sites/dev");

const ops = await site.operations();

// using site id
const ops2 = await graph.sites.getById("{site id}").operations();
```
Loading

0 comments on commit d8aaaae

Please sign in to comment.