Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 4.4.0 #3111

Merged
merged 12 commits into from
Aug 12, 2024
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## 4.4.0 - 2024-Aug-12

- sp
- Addresses #3091 - Update return types from Shares
- Addresses #3104 - Replaces an in-function await to just return the promise.

- graph
- Addresses #3083 - Adds the ability to pass in retrieveProperties to getAllChildrenAsTree. V2 and V3 had this functionality. Only supports Shared Custom Properties, not Local Custom Properties.


## 4.3.0 - 2024-July-15

- sp
Expand Down
2 changes: 2 additions & 0 deletions docs/graph/shares.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ const shareLinkInfo = {
encodedSharingUrl: shareLink,
redeemSharingLink: false
};
// default shared drive item response (id, name)
const sharedDriveItem = await graph.shares.useSharingLink(shareLinkInfo);

```

## Create Sharing Link
Expand Down
17 changes: 7 additions & 10 deletions docs/graph/taxonomy.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@ This method will get all of a set's child terms in an ordered array. It is a cos
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/taxonomy";
import { ITermInfo } from "@pnp/graph/taxonomy";
import { dateAdd, PnPClientStorage } from "@pnp/core";

const graph = graphfi(...);
Expand Down Expand Up @@ -276,12 +275,11 @@ Access term set information
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/taxonomy";
import { ITermInfo } from "@pnp/graph/taxonomy";

import { TermStore } from '@microsoft/microsoft-graph-types';
const graph = graphfi(...);

// list all the terms that are direct children of this set
const infos: ITermInfo[] = await graph.termStore.groups.getById("338666a8-1111-2222-3333-f72471314e72").sets.getById("338666a8-1111-2222-3333-f72471314e72").children();
const infos: TermStore.Term[] = await graph.termStore.groups.getById("338666a8-1111-2222-3333-f72471314e72").sets.getById("338666a8-1111-2222-3333-f72471314e72").children();
```

### List (terms)
Expand All @@ -291,36 +289,35 @@ You can use the terms property to get a flat list of all terms in the set. These
```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/taxonomy";
import { ITermInfo } from "@pnp/graph/taxonomy";
import { TermStore } from '@microsoft/microsoft-graph-types';

const graph = graphfi(...);

// list all the terms available in this term set by group id then by term set id
const infos: ITermInfo[] = await graph.termStore.groups.getById("338666a8-1111-2222-3333-f72471314e72").sets.getById("338666a8-1111-2222-3333-f72471314e72").terms();
const infos: TermStore.Term[] = await graph.termStore.groups.getById("338666a8-1111-2222-3333-f72471314e72").sets.getById("338666a8-1111-2222-3333-f72471314e72").terms();

// list all the terms available in this term set by term set id
const infosByTermSetId: ITermInfo[] = await graph.termStore.sets.getById("338666a8-1111-2222-3333-f72471314e72").terms();
const infosByTermSetId: TermStore.Term[] = await graph.termStore.sets.getById("338666a8-1111-2222-3333-f72471314e72").terms();
```

### Get By Id

```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/taxonomy";
import { ITermInfo } from "@pnp/graph/taxonomy";
import { TermStore } from '@microsoft/microsoft-graph-types';

const graph = graphfi(...);

// get term set data
const info: ITermInfo = await graph.termStore.groups.getById("338666a8-1111-2222-3333-f72471314e72").sets.getById("338666a8-1111-2222-3333-f72471314e72").getTermById("338666a8-1111-2222-3333-f72471314e72")();
const info: TermStore.Term = await graph.termStore.groups.getById("338666a8-1111-2222-3333-f72471314e72").sets.getById("338666a8-1111-2222-3333-f72471314e72").getTermById("338666a8-1111-2222-3333-f72471314e72")();
```

### Add

```TypeScript
import { graphfi, SPFxToken, SPFx } from "@pnp/graph";
import "@pnp/graph/taxonomy";
import { ITermInfo } from "@pnp/graph/taxonomy";

const graph = graphfi(...);

Expand Down
13 changes: 7 additions & 6 deletions docs/sp/files.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,11 @@ if (file.size <= 10485760) {
result = await sp.web.getFolderByServerRelativePath("Shared Documents").files.addUsingPath(fileNamePath, file, { Overwrite: true });
} else {
// large upload
result = await sp.web.getFolderByServerRelativePath("Shared Documents").files.addChunked(fileNamePath, file, data => {
console.log(`progress`);
}, true);
result = await sp.web.getFolderByServerRelativePath("Shared Documents").files.addChunked(fileNamePath, file,
{ progress: data => { console.log(`progress`); },
Overwrite: true
}
);
}

console.log(`Result of file upload: ${JSON.stringify(result)}`);
Expand Down Expand Up @@ -186,7 +188,7 @@ const stream = createReadStream("c:/temp/file.txt");
// now add the stream as a new file
const sp = spfi(...);

const fr = await sp.web.lists.getByTitle("Documents").rootFolder.files.addChunked( "new.txt", stream, undefined, true );
const fileInfo = await sp.web.lists.getByTitle("Documents").rootFolder.files.addChunked("new.txt", stream, { progress: data => { console.log(`progress`); }, Overwrite: true });
```

### Setting Associated Item Values
Expand All @@ -200,7 +202,7 @@ import "@pnp/sp/files";
import "@pnp/sp/folders";

const sp = spfi(...);
const file = await sp.web.getFolderByServerRelativePath("/sites/dev/Shared%20Documents/test/").files.addUsingPath("file.name", "content", {Overwrite: true});
const fileInfo = await sp.web.getFolderByServerRelativePath("/sites/dev/Shared%20Documents/test/").files.addUsingPath("file.name", "content", {Overwrite: true});
const item = await file.file.getItem();
await item.update({
Title: "A Title",
Expand Down Expand Up @@ -560,4 +562,3 @@ import "@pnp/sp/files";
const sp = spfi(...);
const user = await sp.web.getFolderByServerRelativePath("{folder relative path}").files.getByUrl("name.txt").getLockedByUser();
```

Loading
Loading