Skip to content

Commit

Permalink
Merge branch 'version-3' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
juliemturner committed Oct 16, 2023
2 parents 0e3fcfd + cbf5782 commit 5f3f675
Show file tree
Hide file tree
Showing 25 changed files with 605 additions and 350 deletions.
88 changes: 88 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,91 @@ body:
required: true


=======
name: 🐞 Bug or Error Report
description: Submit a bug or error report.
labels: ["type: something isn't working", "status: investigate"]

body:
- type: markdown
attributes:
value: |
This issue type is for submitting bugs or errors you believe you have found with the PnPjs library. If your submission references permission errors or 5xx status code responses, this is almost certainly not a bug with PnPjs but rather and issue with your configuration, please refer to other support options listed on the [new issue chooser page](https://github.dev/juliemturner/pnpjs/issues/new/choose). Please provide as much information as possible so we can best address your submission. Thanks!
- Follow our guidance on [How To Create Good Issues](https://github.dev/juliemturner/pnpjs/wiki/How-to-Create-Good-Issues).
- Remember to include sufficient details and context.
- If you have multiple questions, suggestions, or bugs, please submit them in separate issues.
- type: dropdown
attributes:
label: Major Version
options:
- 4.x
- 3.x
- 2.x (No longer supported)
- 1.x (No longer supported)
validations:
required: true
- type: input
id: minorver
attributes:
label: Minor Version Number
description: Include the minor and patch version numbers, e.g. for 4.1.0
placeholder: '1.0'
validations:
required: true
- type: dropdown
attributes:
label: Target environment
options:
- All
- SharePoint Framework
- NodeJS
- Browser App (Hosted external to Microsoft 365 platform)
- other (enter in the "Additional environment details" area below)
validations:
required: true
- type: textarea
attributes:
label: Additional environment details
description: Please describe the environment you're working in and how you're authenticating.
placeholder: |
I'm using NodeJS and certificate based MSAL for authentication.
validations:
required: true
- type: textarea
attributes:
label: Expected or Desired Behavior
description: Describe what you are trying to accomplish.
placeholder: |
I'm trying to get items from a list in a site.
validations:
required: true
- type: textarea
attributes:
label: Observed Behavior
description: Describe the results you're getting.
placeholder: |
I'm getting an empty response
validations:
required: true
- type: textarea
attributes:
label: Steps to Reproduce
description: Please included code fenced example code, OR a link to a code snippet using GitHub or CodePen or the like to show how your code is structured. See the sample above.
placeholder: |
Here is the code I'm running
```TypeScript
import { spfi } from "@pnp/sp";
import "@pnp/sp/webs";
import "@pnp/sp/lists";
import "@pnp/sp/items";
const sp = spfi(...);
// get all the items from a list
const items: any[] = await sp.web.lists.getByTitle("My List").items();
console.log(items);
```
validations:
required: true
50 changes: 50 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,56 @@ name: 🏗 Enhancement
description: Suggest an enhancement
labels: ["type: enhancement", "status: investigate"]

body:
- type: markdown
attributes:
value: |
This issue type is for suggesting or discussing enhancements to the library.
- Follow our guidance on [How To Create Good Issues](https://github.dev/juliemturner/pnpjs/wiki/How-to-Create-Good-Issues).
- Remember to include sufficient details and context.
- If you have multiple questions, suggestions, or bugs, please submit them in separate issues.
- type: dropdown
attributes:
label: Target environment
options:
- All
- SharePoint Framework
- NodeJS
- Browser App (Hosted external to Microsoft 365 platform)
- other (enter in the "Additional environment details" area below)
validations:
required: false
- type: textarea
attributes:
label: Additional environment details
description: Please describe the environment you're working in and how you're authenticating.
placeholder: |
I'm using NodeJS and certificate based MSAL for authentication.
- type: textarea
attributes:
label: Enhancement Idea
description: Please included details to describe your situation, code fenced example code OR a link to a code snippet using GitHub or CodePen or the like to show how your code is structured and get you the right help more quickly.
placeholder: |
I'm struggling to get a list item. Here is the code I'm running. Can anyone help me figure out what's wrong?
```TypeScript
import { spfi } from "@pnp/sp";
import "@pnp/sp/webs";
import "@pnp/sp/lists";
import "@pnp/sp/items";
const sp = spfi(...);
// get all the items from a list
const items: any[] = await sp.web.lists.getByTitle("My List").items();
console.log(items);
```
=======
name: 🏗 Enhancement
description: Suggest an enhancement
labels: ["type: enhancement", "status: investigate"]

body:
- type: markdown
attributes:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/question.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ body:
console.log(items);
```
validations:
required: true
required: true
13 changes: 11 additions & 2 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).

## 3.19.0 - 2023-Oct-16

- sp
- Addresses #2762 - Adds orderby to getall's allowed query params.
- Addresses #2783 - Fixed a bug where the field type mapping was incorrect for adding image fields.
- Add AllowIncrementalResults parameter to the getItemsByCAMLQuery function.

- graph
- Addresses #2789 - Fixes the typing on the sendmail method. It appears to be implemented incorrectly. Updated the sendMail definition to only take a Graph message Object.

## 3.18.0 - 2023-Sept-11

- queryable
Expand Down Expand Up @@ -551,5 +561,4 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Dropped entire package, no longer needed

- config-store:
- Dropped entire package.

- Dropped entire package.
2 changes: 1 addition & 1 deletion debug/launch/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ export async function Example(settings: any) {
});

process.exit(0);
}
}
2 changes: 1 addition & 1 deletion docs/core/timeline.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const h = await tl.go(0);
const h2 = await tl.go(5);
```

## Understanding the Timline Lifecycle
## Understanding the Timeline Lifecycle

Now that you implemented a simple timeline let's take a minute to understand the lifecycle of a timeline execution. There are four moments always defined for every timeline: init, dispose, log, and error. Of these init and dispose are used within the lifecycle, while log and error are used as you need.

Expand Down
10 changes: 10 additions & 0 deletions docs/graph/onedrive.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,16 @@ const delta: IDeltaItems = await graph.users.getById("[email protected]

// Get the changes for the drive items from token
const delta: IDeltaItems = await graph.me.drive.root.delta("{token}")();

// consume all the values using async iterator
for await (const val of delta.next.paged()) {
console.log(JSON.stringify(val, null, 2));
}

// consume all the values using async iterator in pages of 20
for await (const val of delta.next.top(20).paged()) {
console.log(JSON.stringify(val, null, 2));
}
```

## Get Drive Item Analytics
Expand Down
29 changes: 29 additions & 0 deletions docs/graph/planner.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,20 @@ const updPlan = await graph.planner.plans.getById('planId').update({title: 'New

```

## Get All My Tasks from all plans

Using the tasks() you can get the Tasks across all plans

```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/planner";

const graph = graphfi(...);

const planTasks = await graph.me.tasks()

```

## Get Task by Id

Using the planner.tasks.getById() you can get a specific Task.
Expand Down Expand Up @@ -247,3 +261,18 @@ const graph = graphfi(...);
const bucketTasks = await graph.planner.buckets.getById('bucketId').tasks();

```

## Get Plans for a group

Gets all the plans for a group

```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/groups";
import "@pnp/graph/planner";

const graph = graphfi(...);

const plans = await graph.groups.getById("b179a282-9f94-4bb5-a395-2a80de5a5a78").plans();

```
30 changes: 29 additions & 1 deletion docs/graph/teams.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ channels.getById('19:[email protected]').tabs.getByI

```

## Add a new Tab
## Add a new Tab to Channel

```TypeScript
import { graphfi } from "@pnp/graph";
Expand All @@ -286,6 +286,34 @@ channels.getById('19:[email protected]').tabs.add('T

```

## Update a Tab

```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/teams";

const graph = graphfi(...);

const tab = await graph.teams.getById('3531f3fb-f9ee-4f43-982a-6c90d8226528').
channels.getById('19:[email protected]').tabs.getById('Id').update({
displayName: "New tab name"
});

```

## Remove a Tab from channel

```TypeScript
import { graphfi } from "@pnp/graph";
import "@pnp/graph/teams";

const graph = graphfi(...);

const tab = await graph.teams.getById('3531f3fb-f9ee-4f43-982a-6c90d8226528').
channels.getById('19:[email protected]').tabs.getById('Id').delete();

```

## Team Membership

Get the members and/or owners of a group.
Expand Down
25 changes: 25 additions & 0 deletions docs/sp/fields.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,31 @@ const r = await field.field.select("Id")();
console.log(r.Id);
```

### Add an Image Field

Use the addImageField method to create a new image field.

```TypeScript
import { spfi } from "@pnp/sp";
import { IFieldAddResult, FieldTypes } from "@pnp/sp/fields/types";
import "@pnp/sp/webs";
import "@pnp/sp/lists";
import "@pnp/sp/fields";

const sp = spfi(...);

// create a new image field called 'My Field' in web.
const field: IFieldAddResult = await sp.web.fields.addImageField("My Field");
// create a new image field called 'My Field' in the list 'My List'.
const field2: IFieldAddResult = await sp.web.lists.getByTitle("My List").fields.addImageField("My Field");

// we can use this 'field' variable to run more queries on the field:
const r = await field.field.select("Id")();

// log the field Id to console
console.log(r.Id);
```

### Add a Multi-line Text Field

Use the addMultilineText method to create a new multi-line text field.
Expand Down
2 changes: 1 addition & 1 deletion docs/sp/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const user = await sp.web.currentUser();
const r = await list.roleAssignments.add(user.Id, defs[0].Id);

// remove a role assignment
const { Id: fullRoleDefId } = await list.roleDefinitions.getByName('Full Control')();
const { Id: fullRoleDefId } = await sp.web.roleDefinitions.getByName('Full Control')();
const ras = await list.roleAssignments();
// filter/find the role assignment you want to remove
// here we just grab the first
Expand Down
Loading

0 comments on commit 5f3f675

Please sign in to comment.