Skip to content

Commit

Permalink
Merge pull request #3184 from juliemturner/version-4
Browse files Browse the repository at this point in the history
Updates for release 4.8.0
  • Loading branch information
juliemturner authored Dec 23, 2024
2 parents d4b42d5 + c9517a5 commit f280c21
Show file tree
Hide file tree
Showing 15 changed files with 1,391 additions and 717 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ site
# allow folks to add things to the debug /launch and /serve folder, but don't include them in git
debug/launch/*
!debug/launch/main.ts
!debug/launch/spadmin.ts
!debug/launch/sp.ts
!debug/launch/graph.ts
!debug/launch/tsconfig.json
Expand Down
23 changes: 17 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,30 @@ 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.8.0 - 2024-Dec-23

- graph
- Fixed issue with resumableUpload

- nodejs
- Removed node-fetch as minimum supported NodeJS version support native fetch.

- queryable
- reversed removal of .clone()

## 4.7.0 - 2024-Nov-18

- sp
- Introduces new filter lamda patterns as beta
- Introduces new filter lamda patterns as beta

- graph
- Renamed OneNote Pages to OneNotePages
- Basic Pages API support as beta
- Site Open Extensions as beta
- Fixed #3136 for improving paging support for query params
- Renamed OneNote Pages to OneNotePages
- Basic Pages API support as beta
- Site Open Extensions as beta
- Fixed #3136 for improving paging support for query params

- queryable
- Introduced DebugHeaders behavior
- Introduced DebugHeaders behavior

## 4.6.0 - 2024-Oct-14

Expand Down
1 change: 1 addition & 0 deletions debug/launch/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { ITestingSettings } from "../../test/load-settings.js";
// will allow you to keep all your debugging files locally
// comment out the example
import { Example } from "./sp.js";
// import { Example } from "./spadmin.js";
// import { Example } from "./graph.js";

// setup the connection to SharePoint using the settings file, you can
Expand Down
22 changes: 22 additions & 0 deletions debug/launch/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,28 @@ export function spSetup(settings: ITestingSettings): SPFI {
return sp;
}

export function spAdminSetup(settings: ITestingSettings): SPFI {

const sp = spfi(settings.testing.spadmin.url).using(SPDefault({
msal: {
config: settings.testing.spadmin.msal.init,
scopes: settings.testing.spadmin.msal.scopes,
},
})).using(
PnPLogging(LogLevel.Verbose),
function (instance: Queryable) {

instance.on.pre(async (url, init, result) => {

// we remove telemetry for debugging
delete init.headers["X-ClientService-ClientTag"];
return [url, init, result];
});
});

return sp;
}

export function graphSetup(settings: ITestingSettings): GraphFI {

const graph = graphfi().using(
Expand Down
2 changes: 2 additions & 0 deletions debug/launch/sp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ export async function Example(settings: ITestingSettings) {

process.exit(0);
}


21 changes: 21 additions & 0 deletions debug/launch/spadmin.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ITestingSettings } from "../../test/load-settings.js";
import { Logger, LogLevel } from "@pnp/logging";
import { spAdminSetup } from "./setup.js";
import "@pnp/sp-admin/index.js";

declare var process: { exit(code?: number): void };

export async function Example(settings: ITestingSettings) {

const spAdmin = spAdminSetup(settings);

const s = await spAdmin.admin.tenant.getSitePropertiesByUrl('https://sympjt.sharepoint.com/sites/pnpjsteam', true);

Logger.log({
data: s,
level: LogLevel.Info,
message: "Web Data",
});

process.exit(0);
}
18 changes: 12 additions & 6 deletions docs/sp-admin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,27 @@ The `tenant` node represents calls to the `_api/Microsoft.Online.SharePoint.Tena
import { spfi } from "@pnp/sp";
import "@pnp/sp-admin";

const sp = spfi("https://{tenant}-admin.sharepoint.com");
const spAdmin = spfi("https://{tenant}-admin.sharepoint.com");

// The MSAL scope will be: "https://{tenant}-admin.sharepoint.com/.default"

// default props
const defaultProps = await sp.admin.tenant();
const defaultProps = await spAdmin.admin.tenant();

// all props
const allProps = await sp.admin.tenant.select("*")();
const allProps = await spAdmin.admin.tenant.select("*")();

// select specific props
const selectedProps = await sp.admin.tenant.select("AllowEditing", "DefaultContentCenterSite")();
const selectedProps = await spAdmin.admin.tenant.select("AllowEditing", "DefaultContentCenterSite")();

// call method
const templates = await sp.admin.tenant.getSPOTenantAllWebTemplates();
const templates = await spAdmin.admin.tenant.getSPOTenantAllWebTemplates();

// get site properties by url
const props = await spAdmin.admin.tenant.getSitePropertiesByUrl("https://contoso.sharepoint.com/sites/dev", true);

// set site properties by id -- GUID of SharePoint site (not root web)
await spAdmin.admin.tenant.setSitePropertiesById("{siteId}", {LockedState: "ReadOnly"});
```

## office365Tenant
Expand Down Expand Up @@ -116,7 +122,7 @@ await sp.admin.siteProperties.clearSharingLockDown("https://tenant.sharepoint.co
## call

All those nodes support a `call` method to easily allow calling methods not explictly added to the library. If there is a method you use often that would be a good candidate to add, please open an issue or submit a PR. The call method is meant to help unblock folks before methods are added.
All those nodes support a `call` method to easily allow calling methods not explicitly added to the library. If there is a method you use often that would be a good candidate to add, please open an issue or submit a PR. The call method is meant to help unblock folks before methods are added.

This sample shows using call to invoke the "AddTenantCdnOrigin" method of office365Tenant. While we already support for this method, it helps to show the relationship between `call` and an existing method.

Expand Down
Loading

0 comments on commit f280c21

Please sign in to comment.