diff --git a/CHANGELOG.md b/CHANGELOG.md index f39d16738..f691609dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Removed +- queryable + - removed [extension](https://pnp.github.io/pnpjs/queryable/extensions/) capabilities from core library + - graph - paged method removed from IGraphQueryableCollection - ./operations.ts methods moved to ./graphqueryable.ts @@ -32,6 +35,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed +- testing + - SPA application now has a button to trigger the code vs running on page load + - queryable - moved add-props.ts and request-builders.ts to index.ts diff --git a/debug/serve/main.ts b/debug/serve/main.ts index f9ad2ef42..20a059f61 100644 --- a/debug/serve/main.ts +++ b/debug/serve/main.ts @@ -1,14 +1,43 @@ -import { MSAL, MSALOptions } from "@pnp/msaljsclient/index.js"; +import { MSAL } from "@pnp/msaljsclient/index.js"; import { spfi, SPBrowser } from "@pnp/sp"; import "@pnp/sp/webs"; import { settings } from "../../settings.js"; // import { graph } from "@pnp/graph/presets/all"; // ****** -// Please edit this file and do any testing required. Please do not submit changes as part of a PR. +// Please edit the main function and do any testing required. Please do not submit changes as part of a PR. // ****** -// ensure our DOM is ready for us to do stuff +/** + * The testing function whose code is executed + * + * @param resultDiv The div into which you can write your result + */ +async function main(resultDiv: HTMLDivElement) { + + const html = []; + + try { + + // Make sure to add `https://localhost:8080/spa.html` as a Redirect URI in your testing's AAD App Registration + const sp = spfi().using( + SPBrowser({ baseUrl: settings.testing.sp.url }), + MSAL({ configuration: settings.testing.sp.msal.init, authParams: { scopes: settings.testing.sp.msal.scopes } }) + ); + + const r = await sp.web(); + + html.push(``); + + } catch (err) { + + html.push(`Error:
${JSON.stringify(err.message, null, 4)}`); + } + + resultDiv.innerHTML = html.join("
${JSON.stringify(e.message, null, 4)}`); + // id not in the spa, just run it (old script editor webpart test) + await main(resultDiv); } - - e.innerHTML = html.join("
This page can be used to test SPA application access / issues locally.
- + +