diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b327a67a..010d3094e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ 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.3.0 - 2024-July-15 + +- sp + - Addresses #3082 - Improves functionality of alias parameters + +- graph + - Adds new AdvancedQuery behavior + ## 4.2.0 - 2024-June-17 - Only documentation and package updates diff --git a/docs/getting-started.md b/docs/getting-started.md index 782361b75..eccbbb1fb 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -415,6 +415,10 @@ The new factory function allows you to create a connection to a different web ma const web = Web([sp.web, {Other Web URL}]); ``` +## Multi-Geo / Cross tenant calls in SharePoint Framework (SPFx) + +If you are working in a multi-geo tenant or trying to work across tenants (essentially the same thing) then the [normal configuration](#using-pnpsp-spfi-factory-interface-in-spfx) in SPFx will not work. To connect cross tenants in the browser you will need to us the [@pnp/msaljsclient](./msaljsclient/index.md) to make the connection to the other tenant or geo. + ## Next Steps For more complicated authentication scenarios please [review the article describing all of the available authentication methods](./concepts/authentication.md). diff --git a/docs/graph/behaviors.md b/docs/graph/behaviors.md index cbdbcb670..80366e001 100644 --- a/docs/graph/behaviors.md +++ b/docs/graph/behaviors.md @@ -194,3 +194,18 @@ const graph = graphfi().using(ConsistencyLevel("{level value}")); await graph.users(); ``` + +## AdvancedQuery + +Using this behaviour, you can enable [advanced query capabilities](https://learn.microsoft.com/en-us/graph/aad-advanced-queries?tabs=http) when filtering supported collections. + +This sets the consistency level to eventual and enables the `$count` query parameter. + +```TypeScript +import { graphfi, AdvancedQuery } from "@pnp/graph"; +import "@pnp/graph/users"; + +const graph = graphfi().using(AdvancedQuery()); + +await graph.users.filter("companyName ne null and NOT(companyName eq 'Microsoft')")(); +``` diff --git a/docs/sp/folders.md b/docs/sp/folders.md index 88df71f50..a56987d49 100644 --- a/docs/sp/folders.md +++ b/docs/sp/folders.md @@ -42,10 +42,15 @@ import { folderFromServerRelativePath } from "@pnp/sp/folders"; const sp = spfi(...); +// URL CANNOT BE ENCODED, URL CANNOT END IN "/" const url = "/sites/dev/documents/folder4"; -// file is an IFile and supports all the file operations -const folder = folderFromServerRelativePath(sp.web, url); +// folder is an IFolder and supports all the folder operations +const folder: IFolder = folderFromServerRelativePath(sp.web, url); + +// for example +const folderInfo = await folder(); +const files = await folder.files(); ``` ### folderFromAbsolutePath @@ -65,11 +70,13 @@ const sp = spfi(...); const url = "https://tenant.sharepoint.com/sites/dev/documents/folder"; -// file is an IFile and supports all the file operations -const folder = folderFromAbsolutePath(sp.web, url); +// folder is an IFolder and supports all the folder operations +// Unlike folderFromServerRelativePath, this method must be await'd to resolve folder from absolute Url. +const folder: IFolder = await folderFromAbsolutePath(sp.web, url); // for example const folderInfo = await folder(); +const files = await folder.files(); ``` ### folderFromPath @@ -89,7 +96,7 @@ const sp = spfi(...); const url = "https://tenant.sharepoint.com/sites/dev/documents/folder"; -// file is an IFile and supports all the file operations +// folder is an IFolder and supports all the folder operations const folder = folderFromPath(sp.web, url); // for example @@ -97,7 +104,7 @@ const folderInfo = await folder(); const url2 = "/sites/dev/documents/folder"; -// file is an IFile and supports all the file operations +// folder is an IFolder and supports all the folder operations const folder2 = folderFromPath(sp.web, url2); // for example @@ -115,13 +122,18 @@ import "@pnp/sp/folders"; const sp = spfi(...); -// creates a new folder for web with specified url -const folderAddResult = await sp.web.folders.addUsingPath("folder url"); +// URL CANNOT BE ENCODED +const url = "/sites/dev/Shared Documents/MyFolder" + +// creates a new folder for web with specified server relative url +const folderAddResult = await sp.web.folders.addUsingPath(url); ``` ### getByUrl -Gets a folder instance from a collection by folder's name +Gets a folder instance from a collection by folder's name. +This call is the equivalent of getting the document libraries root folder. +e.g. `const listFolders = await sp.web.lists.getByTitle("Documents").rootFolder();` ```TypeScript import { spfi } from "@pnp/sp"; @@ -130,7 +142,8 @@ import "@pnp/sp/folders"; const sp = spfi(...); -const folder = await sp.web.folders.getByUrl("folder name")(); +// pass the name of the document library, cannot include relative paths for subfolders. +const folder = await sp.web.folders.getByUrl("Shared Documents")(); ``` ## IFolder @@ -187,10 +200,13 @@ import "@pnp/sp/folders"; const sp = spfi(...); -const metrics = await sp.web.getFolderByServerRelativePath("/sites/dev/shared documents/target").storageMetrics(); +// URL CANNOT BE ENCODED +const url = "/sites/dev/shared documents/target"; + +const metrics = await sp.web.getFolderByServerRelativePath(url).storageMetrics(); // you can also select specific metrics if desired: -const metrics2 = await sp.web.getFolderByServerRelativePath("/sites/dev/shared documents/target").storageMetrics.select("TotalSize")(); +const metrics2 = await sp.web.getFolderByServerRelativePath(url).storageMetrics.select("TotalSize")(); ``` ### move by path @@ -206,6 +222,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); +// URL CANNOT BE ENCODED - will get "Access is denied" error. // destination is a server-relative url of a new folder const destinationUrl = `/sites/my-site/SiteAssets/new-folder`; @@ -223,6 +240,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); +// URL CANNOT BE ENCODED - will get "Access is denied" error. // destination is a server-relative url of a new file const destinationUrl = `/sites/dev2/SiteAssets/folder`; @@ -244,6 +262,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); +// URL CANNOT BE ENCODED - will get "Access is denied" error. // destination is a server-relative url of a new folder const destinationUrl = `/sites/my-site/SiteAssets/new-folder`; @@ -261,6 +280,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); +// URL CANNOT BE ENCODED - will get "Access is denied" error. // destination is a server-relative url of a new file const destinationUrl = `/sites/dev2/SiteAssets/folder`; @@ -282,7 +302,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); -await sp.web.rootFolder.folders.getByUrl("My Folder").delete(); +await sp.web.rootFolder.folders.getByUrl("Shared Documents").delete(); ``` ### delete with params @@ -296,7 +316,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); -await sp.web.rootFolder.folders.getByUrl("My Folder").deleteWithParams({ +await sp.web.rootFolder.folders.getByUrl("Shared Documents").deleteWithParams({ BypassSharedLock: true, DeleteIfEmpty: true, }); @@ -313,7 +333,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); -await sp.web.rootFolder.folders.getByUrl("My Folder").recycle(); +await sp.web.rootFolder.folders.getByUrl("Shared Documents").recycle(); ``` ### serverRelativeUrl @@ -386,6 +406,7 @@ import "@pnp/sp/files/folder"; const sp = spfi(...); +// URL CANNOT BE ENCODED const files = await sp.web.getFolderByServerRelativePath("Shared Documents").files(); ``` @@ -400,6 +421,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); +// URL CANNOT BE ENCODED const itemFields = await sp.web.getFolderByServerRelativePath("Shared Documents/My Folder").listItemAllFields(); ``` @@ -414,6 +436,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); +// URL CANNOT BE ENCODED const parentFolder = await sp.web.getFolderByServerRelativePath("Shared Documents/My Folder").parentFolder(); ``` @@ -428,6 +451,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); +// URL CANNOT BE ENCODED const properties = await sp.web.getFolderByServerRelativePath("Shared Documents/Folder2").properties(); ``` @@ -442,6 +466,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); +// URL CANNOT BE ENCODED const contentTypeOrder = await sp.web.getFolderByServerRelativePath("Shared Documents/Folder2").select('uniqueContentTypeOrder')(); ``` @@ -456,6 +481,7 @@ import "@pnp/sp/folders"; const sp = spfi(...); +// URL CANNOT BE ENCODED const folder = sp.web.getFolderByServerRelativePath("Shared Documents/My Folder"); const item = await folder.getItem(); @@ -475,6 +501,7 @@ import "@pnp/sp/lists"; const sp = spfi(...); +// URL CANNOT BE ENCODED const newFolderResult = await sp.web.rootFolder.folders.getByUrl("Shared Documents").folders.addUsingPath("My New Folder"); const item = await sp.web.rootFolder.folders.getByUrl("Shared Documents").folders.getByUrl(newFolderResult.Name).listItemAllFields(); @@ -497,8 +524,10 @@ import { IFolder } from "@pnp/sp/folders"; const sp = spfi(...); +// URL CANNOT BE ENCODED and cannot include sub-paths. +const url = "Folder Name"; // add a folder to site assets -const folder: IFolder = await sp.web.rootFolder.folders.getByUrl("SiteAssets").addSubFolderUsingPath("folder name"); +const folder: IFolder = await sp.web.rootFolder.folders.getByUrl("SiteAssets").addSubFolderUsingPath(url); ``` ### getFolderById diff --git a/docs/sp/items.md b/docs/sp/items.md index 26c331953..bb2b08cfc 100644 --- a/docs/sp/items.md +++ b/docs/sp/items.md @@ -31,7 +31,7 @@ console.log(items2); ### Get Paged Items -Working with paging can be a challenge as it is based on skip tokens and item ids, something that is hard to guess at runtime. To simplify things you can use the Async Iterator functionality on the Items class to assist. For advanced paging techniques using the Async Iterator, please review [Async Paging]('/concepts/async-paging.md') +Working with paging can be a challenge as it is based on skip tokens and item ids, something that is hard to guess at runtime. To simplify things you can use the Async Iterator functionality on the Items class to assist. For advanced paging techniques using the Async Iterator, please review [Async Paging]('../concepts/async-paging.md') ```TypeScript import { spfi } from "@pnp/sp"; diff --git a/package-lock.json b/package-lock.json index 94af282ca..ed5ab6bdc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,25 +1,25 @@ { "name": "@pnp/monorepo", - "version": "4.2.0", + "version": "4.3.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@pnp/monorepo", - "version": "4.2.0", + "version": "4.3.0", "license": "MIT", "devDependencies": { - "@azure/identity": "4.2.1", - "@azure/msal-browser": "3.17.0", - "@azure/msal-node": "2.9.2", + "@azure/identity": "4.3.0", + "@azure/msal-browser": "3.19.0", + "@azure/msal-node": "2.11.0", "@microsoft/microsoft-graph-types": "2.40.0", "@pnp/buildsystem": "^4.0.1", - "@pnp/logging": "^4.1.1", + "@pnp/logging": "^4.2.0", "@types/chai": "4.3.16", "@types/chai-as-promised": "7.1.8", "@types/core-js": "2.5.8", "@types/findup-sync": "4.0.5", - "@types/mocha": "10.0.6", + "@types/mocha": "10.0.7", "@types/node": "18.11.9", "@types/webpack": "5.28.5", "@types/yargs": "17.0.32", @@ -30,14 +30,14 @@ "del-cli": "5.1.0", "eslint": "8.57.0", "findup-sync": "5.0.0", - "globby": "^14.0.1", - "mocha": "10.4.0", + "globby": "14.0.2", + "mocha": "10.6.0", "node-fetch": "3.3.2", "prettyjson": "1.2.5", "string-replace-loader": "3.1.0", "tslib": "2.6.3", "typescript": "4.9.5", - "webpack": "5.92.0", + "webpack": "5.93.0", "webpack-cli": "5.1.4", "webpack-dev-server": "5.0.4", "yargs": "17.7.2" @@ -115,9 +115,9 @@ } }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.16.0.tgz", - "integrity": "sha512-CeuTvsXxCUmEuxH5g/aceuSl6w2EugvNHKAtKKVdiX915EjJJxAwfzNNWZreNnbxHZ2fi0zaM6wwS23x2JVqSQ==", + "version": "1.16.2", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.16.2.tgz", + "integrity": "sha512-Hnhm/PG9/SQ07JJyLDv3l9Qr8V3xgAe1hFoBYzt6LaalMxfL/ZqFaZf/bz5VN3pMcleCPwl8ivlS2Fjxq/iC8Q==", "dev": true, "dependencies": { "@azure/abort-controller": "^2.0.0", @@ -158,9 +158,9 @@ } }, "node_modules/@azure/core-util": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.9.0.tgz", - "integrity": "sha512-AfalUQ1ZppaKuxPPMsFEUdX6GZPB3d9paR9d/TTL7Ow2De8cJaC7ibi7kWVlFAVPCYo31OcnGymc0R89DX8Oaw==", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@azure/core-util/-/core-util-1.9.1.tgz", + "integrity": "sha512-OLsq0etbHO1MA7j6FouXFghuHrAFGk+5C1imcpQ2e+0oZhYF07WLA+NW2Vqs70R7d+zOAWiWM3tbE1sXcDN66g==", "dev": true, "dependencies": { "@azure/abort-controller": "^2.0.0", @@ -183,14 +183,14 @@ } }, "node_modules/@azure/identity": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.2.1.tgz", - "integrity": "sha512-U8hsyC9YPcEIzoaObJlRDvp7KiF0MGS7xcWbyJSVvXRkC/HXo1f0oYeBYmEvVgRfacw7GHf6D6yAoh9JHz6A5Q==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@azure/identity/-/identity-4.3.0.tgz", + "integrity": "sha512-LHZ58/RsIpIWa4hrrE2YuJ/vzG1Jv9f774RfTTAVDZDriubvJ0/S5u4pnw4akJDlS0TiJb6VMphmVUFsWmgodQ==", "dev": true, "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-auth": "^1.5.0", - "@azure/core-client": "^1.4.0", + "@azure/core-client": "^1.9.2", "@azure/core-rest-pipeline": "^1.1.0", "@azure/core-tracing": "^1.0.0", "@azure/core-util": "^1.3.0", @@ -208,9 +208,9 @@ } }, "node_modules/@azure/logger": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.1.2.tgz", - "integrity": "sha512-l170uE7bsKpIU6B/giRc9i4NI0Mj+tANMMMxf7Zi/5cKzEqPayP7+X1WPrG7e+91JgY8N+7K7nF2WOi7iVhXvg==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@azure/logger/-/logger-1.1.3.tgz", + "integrity": "sha512-J8/cIKNQB1Fc9fuYqBVnrppiUtW+5WWJPCj/tAokC5LdSTwkWWttN+jsRgw9BLYD7JDBx7PceiqOBxJJ1tQz3Q==", "dev": true, "dependencies": { "tslib": "^2.6.2" @@ -220,33 +220,33 @@ } }, "node_modules/@azure/msal-browser": { - "version": "3.17.0", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.17.0.tgz", - "integrity": "sha512-csccKXmW2z7EkZ0I3yAoW/offQt+JECdTIV/KrnRoZyM7wCSsQWODpwod8ZhYy7iOyamcHApR9uCh0oD1M+0/A==", + "version": "3.19.0", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-3.19.0.tgz", + "integrity": "sha512-3unHlh3qWtXbqks/TLq3qGWzxfmwRfk9tXSGvVCcHHnCH5QKtcg/JiDIeP/1B2qFlqnSgtYY0JPLy9EIVoZ7Ag==", "dev": true, "dependencies": { - "@azure/msal-common": "14.12.0" + "@azure/msal-common": "14.13.0" }, "engines": { "node": ">=0.8.0" } }, "node_modules/@azure/msal-common": { - "version": "14.12.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.12.0.tgz", - "integrity": "sha512-IDDXmzfdwmDkv4SSmMEyAniJf6fDu3FJ7ncOjlxkDuT85uSnLEhZi3fGZpoR7T4XZpOMx9teM9GXBgrfJgyeBw==", + "version": "14.13.0", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-14.13.0.tgz", + "integrity": "sha512-b4M/tqRzJ4jGU91BiwCsLTqChveUEyFK3qY2wGfZ0zBswIBZjAxopx5CYt5wzZFKuN15HqRDYXQbztttuIC3nA==", "dev": true, "engines": { "node": ">=0.8.0" } }, "node_modules/@azure/msal-node": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.9.2.tgz", - "integrity": "sha512-8tvi6Cos3m+0KmRbPjgkySXi+UQU/QiuVRFnrxIwt5xZlEEFa69O04RTaNESGgImyBBlYbo2mfE8/U8Bbdk1WQ==", + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-2.11.0.tgz", + "integrity": "sha512-yNRCp4Do4CGSBe1WXq4DWhfa/vYZCUgGrweYLC5my/6eDnYMt0fYGPHuTMw0iRslQGXF3CecGAxXp7ab57V4zg==", "dev": true, "dependencies": { - "@azure/msal-common": "14.12.0", + "@azure/msal-common": "14.13.0", "jsonwebtoken": "^9.0.0", "uuid": "^8.3.0" }, @@ -387,9 +387,9 @@ } }, "node_modules/@eslint-community/regexpp": { - "version": "4.10.1", - "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.10.1.tgz", - "integrity": "sha512-Zm2NGpWELsQAD1xsJzGQpYfvICSsFkEpU0jxBjfdC6uNEWXcHnfs9hScFWtXVDVl+rBQJGrl4g1vcKIejpH9dA==", + "version": "4.11.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz", + "integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==", "dev": true, "engines": { "node": "^12.0.0 || ^14.0.0 || >=16.0.0" @@ -645,9 +645,9 @@ } }, "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.15", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", "dev": true }, "node_modules/@jridgewell/trace-mapping": { @@ -699,9 +699,9 @@ } }, "node_modules/@jsonjoy.com/util": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@jsonjoy.com/util/-/util-1.1.3.tgz", - "integrity": "sha512-g//kkF4kOwUjemValCtOc/xiYzmwMRmWq3Bn+YnzOzuZLHq2PpMOxxIayN3cKbo7Ko2Np65t6D9H81IvXbXhqg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@jsonjoy.com/util/-/util-1.2.0.tgz", + "integrity": "sha512-4B8B+3vFsY4eo33DMKyJPlQ3sBMpPFUZK2dr3O3rXrOGKKbYG44J0XSFkDo1VOQiri5HFEhIeVvItjR2xcazmg==", "dev": true, "engines": { "node": ">=10.0" @@ -795,12 +795,12 @@ } }, "node_modules/@pnp/core": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@pnp/core/-/core-4.1.1.tgz", - "integrity": "sha512-0I16pc0r7rQOj/9xuXM8ts5+BwP49GmS21/OFn8QySRbQzNBCQb5JGjOLhxBXkqYz+83G8Q2WMC9Q7lE1/fQlQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@pnp/core/-/core-4.2.0.tgz", + "integrity": "sha512-6dewgrUxl2wavAWZAWDQzmEmvztI6dXoMJOfcgdxX+MUhF83YYtjLCJaRfxMJsrnHmMJbTiIhnIAsZbaO5IczQ==", "dev": true, "dependencies": { - "tslib": "2.6.2" + "tslib": "2.6.3" }, "engines": { "node": ">=18.12.0" @@ -810,19 +810,13 @@ "url": "https://github.com/sponsors/patrick-rodgers/" } }, - "node_modules/@pnp/core/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true - }, "node_modules/@pnp/logging": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@pnp/logging/-/logging-4.1.1.tgz", - "integrity": "sha512-xXJTRmFjUNWYjZomzwDB3MRatypUmLwOrYaMJBJ207MPzGbTfVxjzoiFEL2ZJ55/rumjAK/jqw6a5ccMS6S+Eg==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@pnp/logging/-/logging-4.2.0.tgz", + "integrity": "sha512-/i0hipGGeje7+iSoIfjjaYqbtLDFRKA2jxC/AmXLink2/Yl5IvcahLagNUGeLAOx43A63jM/FW0XPeMCsCXfMQ==", "dev": true, "dependencies": { - "tslib": "2.6.2" + "tslib": "2.6.3" }, "engines": { "node": ">=18.12.0" @@ -832,12 +826,6 @@ "url": "https://github.com/sponsors/patrick-rodgers/" } }, - "node_modules/@pnp/logging/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "dev": true - }, "node_modules/@sindresorhus/merge-streams": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.3.0.tgz", @@ -954,9 +942,9 @@ } }, "node_modules/@types/express-serve-static-core": { - "version": "4.19.3", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.3.tgz", - "integrity": "sha512-KOzM7MhcBFlmnlr/fzISFF5vGWVSvN6fTd4T+ExOt08bA/dA5kpSzY52nMsI1KDFmUREpJelPYyuslLRSjjgCg==", + "version": "4.19.5", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", + "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", "dev": true, "dependencies": { "@types/node": "*", @@ -996,9 +984,9 @@ "dev": true }, "node_modules/@types/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/@types/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-C/FMQ8HJAZhTsDpl4wDKZdMeeW5USjgzOczUwTGbRc1ZopPgOhIEnxY2ZgUrsuyy4DwK1JVOJZKFakv3TbCKiA==", + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/micromatch/-/micromatch-4.0.9.tgz", + "integrity": "sha512-7V+8ncr22h4UoYRLnLXSpTxjQrNUXtWHGeMPRJt1nULXI57G9bIcpyrHlmrQ7QK24EyyuXvYcSSWAM8GA9nqCg==", "dev": true, "dependencies": { "@types/braces": "*" @@ -1017,9 +1005,9 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "10.0.6", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", - "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", + "version": "10.0.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.7.tgz", + "integrity": "sha512-GN8yJ1mNTcFcah/wKEFIJckJx9iJLoMSzWcfRRuxz/Jk+U6KQNnml+etbtxFK8lPjzOw3zp4Ha/kjSst9fsHYw==", "dev": true }, "node_modules/@types/node": { @@ -1118,9 +1106,9 @@ } }, "node_modules/@types/ws": { - "version": "8.5.10", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.10.tgz", - "integrity": "sha512-vmQSUcfalpIq0R9q7uTo2lXs6eGIpt9wtnLdMv9LVpIjCA/+ufZRozlVoVelIYixx1ugCBKDhn89vnsEGOCx9A==", + "version": "8.5.11", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.11.tgz", + "integrity": "sha512-4+q7P5h3SpJxaBft0Dzpbr6lmMaqh0Jr2tbhJZ/luAwvD7ohSCniYkwz/pLxuT2h0EOa6QADgJj1Ko+TzRfZ+w==", "dev": true, "dependencies": { "@types/node": "*" @@ -1582,9 +1570,9 @@ } }, "node_modules/acorn": { - "version": "8.12.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.0.tgz", - "integrity": "sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1673,15 +1661,15 @@ } }, "node_modules/ajv-formats/node_modules/ajv": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", - "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.4.1" + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -1704,9 +1692,9 @@ } }, "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", "dev": true, "engines": { "node": ">=6" @@ -1937,9 +1925,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.23.1", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.1.tgz", - "integrity": "sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==", + "version": "4.23.2", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.2.tgz", + "integrity": "sha512-qkqSyistMYdxAcw+CzbZwlBy8AGmS/eEWs+sEV5TnLRGDOL+C5M2EnH6tlZyg0YoAxGJAFKh61En9BR941GnHA==", "dev": true, "funding": [ { @@ -1956,10 +1944,10 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001629", - "electron-to-chromium": "^1.4.796", + "caniuse-lite": "^1.0.30001640", + "electron-to-chromium": "^1.4.820", "node-releases": "^2.0.14", - "update-browserslist-db": "^1.0.16" + "update-browserslist-db": "^1.1.0" }, "bin": { "browserslist": "cli.js" @@ -2075,9 +2063,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001636", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001636.tgz", - "integrity": "sha512-bMg2vmr8XBsbL6Lr0UHXy/21m84FTxDLWn2FSqMd5PrlbMxwJlQnC2YWYxVgp66PZE+BBNF2jYQUBKCo1FDeZg==", + "version": "1.0.30001642", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001642.tgz", + "integrity": "sha512-3XQ0DoRgLijXJErLSl+bLnJ+Et4KqV1PY6JJBGAFlsNsz31zeAIncyeZfLCabHK/jtSh+671RM9YMldxjUPZtA==", "dev": true, "funding": [ { @@ -2153,16 +2141,10 @@ } }, "node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -2175,6 +2157,9 @@ "engines": { "node": ">= 8.10.0" }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, "optionalDependencies": { "fsevents": "~2.3.2" } @@ -2680,9 +2665,9 @@ "dev": true }, "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", "dev": true, "engines": { "node": ">=0.3.1" @@ -2755,9 +2740,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.803", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.803.tgz", - "integrity": "sha512-61H9mLzGOCLLVsnLiRzCbc63uldP0AniRYPV3hbGVtONA1pI7qSGILdbofR7A8TMbOypDocEAjH/e+9k1QIe3g==", + "version": "1.4.827", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.827.tgz", + "integrity": "sha512-VY+J0e4SFcNfQy19MEoMdaIcZLmDCprqvBtkii1WTCTQHpRvf5N8+3kTYCgL/PcntvwQvmMJWTuDPsq+IlhWKQ==", "dev": true }, "node_modules/emoji-regex": { @@ -2840,9 +2825,9 @@ } }, "node_modules/es-module-lexer": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.3.tgz", - "integrity": "sha512-i1gCgmR9dCl6Vil6UKPI/trA69s08g/syhiDK9TG0Nf1RJjjFI+AzoWW7sPufzkgYAn861skuCwJa0pIIHYxvg==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.5.4.tgz", + "integrity": "sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw==", "dev": true }, "node_modules/escalade": { @@ -3004,9 +2989,9 @@ } }, "node_modules/esquery": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", - "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.6.0.tgz", + "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "dependencies": { "estraverse": "^5.1.0" @@ -3213,6 +3198,12 @@ "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true }, + "node_modules/fast-uri": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", + "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "dev": true + }, "node_modules/fastest-levenshtein": { "version": "1.0.16", "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", @@ -3693,9 +3684,9 @@ } }, "node_modules/globby": { - "version": "14.0.1", - "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.1.tgz", - "integrity": "sha512-jOMLD2Z7MAhyG8aJpNOpmziMOP4rPLcc95oQPKXBazW82z+CEgPFBQvEpRUa1KeIMUJo4Wsm+q6uzO/Q/4BksQ==", + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-14.0.2.tgz", + "integrity": "sha512-s3Fq41ZVh7vbbe2PN3nrW7yC7U7MFVc5c98/iTl9c2GawNMKx/J648KQRW6WKkuU8GIbbh2IXfIRQjOZnXcTnw==", "dev": true, "dependencies": { "@sindresorhus/merge-streams": "^2.1.0", @@ -4003,9 +3994,9 @@ } }, "node_modules/https-proxy-agent": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", - "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", "dev": true, "dependencies": { "agent-base": "^7.0.2", @@ -4183,12 +4174,15 @@ } }, "node_modules/is-core-module": { - "version": "2.13.1", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.1.tgz", - "integrity": "sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.14.0.tgz", + "integrity": "sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A==", "dev": true, "dependencies": { - "hasown": "^2.0.0" + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4426,16 +4420,13 @@ } }, "node_modules/jackspeak": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.0.tgz", - "integrity": "sha512-JVYhQnN59LVPFCEcVa2C3CrEKYacvjRfqIQl+h8oi91aLYQVWRYbxjPcv1bUiUy/kLmQaANrYfNMCO3kuEDHfw==", + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", "dev": true, "dependencies": { "@isaacs/cliui": "^8.0.2" }, - "engines": { - "node": ">=14" - }, "funding": { "url": "https://github.com/sponsors/isaacs" }, @@ -4609,9 +4600,9 @@ } }, "node_modules/launch-editor": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.7.0.tgz", - "integrity": "sha512-KAc66u6LxWL8MifQ94oG3YGKYWDwz/Gi0T15lN//GaQoZe08vQGFJxrXkPAeu50UXgvJPPaRKVGuP1TRUm/aHQ==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/launch-editor/-/launch-editor-2.8.0.tgz", + "integrity": "sha512-vJranOAJrI/llyWGRQqiDM+adrw+k83fvmmx3+nV47g3+36xM15jE+zyZ6Ffel02+xSvuM0b2GDRosXZkbb6wA==", "dev": true, "dependencies": { "picocolors": "^1.0.0", @@ -5026,31 +5017,31 @@ } }, "node_modules/mocha": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz", - "integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==", - "dev": true, - "dependencies": { - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "8.1.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" + "version": "10.6.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.6.0.tgz", + "integrity": "sha512-hxjt4+EEB0SA0ZDygSS015t65lJw/I2yRCS3Ae+SJ5FrbzrXgfYwJr96f0OvIXdj7h4lv/vLCrH3rkiuizFSvw==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" }, "bin": { "_mocha": "bin/_mocha", @@ -5071,33 +5062,10 @@ "wrap-ansi": "^7.0.0" } }, - "node_modules/mocha/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/mocha/node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, "node_modules/mocha/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -5145,15 +5113,6 @@ "node": ">=10" } }, - "node_modules/mocha/node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -5283,10 +5242,13 @@ } }, "node_modules/object-inspect": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.1.tgz", - "integrity": "sha512-5qoj1RUiKOMsCCNLV1CBiPYE10sziTsnmNxkAI/rZhiD63CF7IqdFGC/XzjWjpSgLf0LxXX3bDFIh0E18f6UhQ==", + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", "dev": true, + "engines": { + "node": ">= 0.4" + }, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5487,6 +5449,12 @@ "node": ">=6" } }, + "node_modules/package-json-from-dist": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.0.tgz", + "integrity": "sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==", + "dev": true + }, "node_modules/parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", @@ -5620,13 +5588,10 @@ } }, "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.2.2", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.2.2.tgz", - "integrity": "sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==", - "dev": true, - "engines": { - "node": "14 || >=16.14" - } + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true }, "node_modules/path-to-regexp": { "version": "0.1.7", @@ -6316,9 +6281,9 @@ "dev": true }, "node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", "dev": true, "dependencies": { "randombytes": "^2.1.0" @@ -6775,9 +6740,9 @@ } }, "node_modules/terser": { - "version": "5.31.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.1.tgz", - "integrity": "sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg==", + "version": "5.31.2", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.2.tgz", + "integrity": "sha512-LGyRZVFm/QElZHy/CPr/O4eNZOZIzsrQ92y4v9UJe/pFJjypje2yI3C2FmPtvUEnhadlSbmG2nXtdcjHOjCfxw==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -6826,15 +6791,6 @@ } } }, - "node_modules/terser-webpack-plugin/node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" - } - }, "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -6881,9 +6837,9 @@ } }, "node_modules/tree-dump": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.1.tgz", - "integrity": "sha512-WCkcRBVPSlHHq1dc/px9iOfqklvzCbdRwvlNfxGZsrHqf6aZttfPrd7DJTt6oR10dwUfpFFQeVTkPbBIZxX/YA==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/tree-dump/-/tree-dump-1.0.2.tgz", + "integrity": "sha512-dpev9ABuLWdEubk+cIaI9cHwRNNDjkBBLXTwI4UCUFdQ5xXKqNXoK4FEciw/vxf+NQ7Cb7sGUyeUtORvHIdRXQ==", "dev": true, "engines": { "node": ">=10.0" @@ -7016,9 +6972,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.16", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", - "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz", + "integrity": "sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==", "dev": true, "funding": [ { @@ -7129,9 +7085,9 @@ } }, "node_modules/webpack": { - "version": "5.92.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.92.0.tgz", - "integrity": "sha512-Bsw2X39MYIgxouNATyVpCNVWBCuUwDgWtN78g6lSdPJRLaQ/PUVm/oXcaRAyY/sMFoKFQrsPeqvTizWtq7QPCA==", + "version": "5.93.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.93.0.tgz", + "integrity": "sha512-Y0m5oEY1LRuwly578VqluorkXbvXKh7U3rLoQCEO04M97ScRr44afGVkI0FQFsXzysk5OgFAxjZAb9rsGQVihA==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -7259,15 +7215,15 @@ } }, "node_modules/webpack-dev-middleware/node_modules/ajv": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", - "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.4.1" + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -7371,15 +7327,15 @@ } }, "node_modules/webpack-dev-server/node_modules/ajv": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.16.0.tgz", - "integrity": "sha512-F0twR8U1ZU67JIEtekUcLkXkoO5mMMmgGD8sK/xUFzJ805jxHQl92hImFAqqXMyMYjSPOyUPAwHYhB72g5sTXw==", + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "dependencies": { "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", - "require-from-string": "^2.0.2", - "uri-js": "^4.4.1" + "require-from-string": "^2.0.2" }, "funding": { "type": "github", @@ -7398,30 +7354,6 @@ "ajv": "^8.8.2" } }, - "node_modules/webpack-dev-server/node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dev": true, - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, "node_modules/webpack-dev-server/node_modules/define-lazy-prop": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", @@ -7435,39 +7367,25 @@ } }, "node_modules/webpack-dev-server/node_modules/glob": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.1.tgz", - "integrity": "sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==", + "version": "10.4.5", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", "dev": true, "dependencies": { "foreground-child": "^3.1.0", "jackspeak": "^3.1.2", "minimatch": "^9.0.4", "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", "path-scurry": "^1.11.1" }, "bin": { "glob": "dist/esm/bin.mjs" }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, "funding": { "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/webpack-dev-server/node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, "node_modules/webpack-dev-server/node_modules/is-wsl": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.0.tgz", @@ -7490,9 +7408,9 @@ "dev": true }, "node_modules/webpack-dev-server/node_modules/minimatch": { - "version": "9.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", - "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", "dev": true, "dependencies": { "brace-expansion": "^2.0.1" @@ -7523,9 +7441,9 @@ } }, "node_modules/webpack-dev-server/node_modules/rimraf": { - "version": "5.0.7", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.7.tgz", - "integrity": "sha512-nV6YcJo5wbLW77m+8KjH8aB/7/rxQy9SZ0HY5shnwULfS+9nmTtVXAJET5NdZmCzA4fPI/Hm1wo/Po/4mopOdg==", + "version": "5.0.9", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.9.tgz", + "integrity": "sha512-3i7b8OcswU6CpU8Ej89quJD4O98id7TtVM5U4Mybh84zQXdrFmDLouWBEEaD/QfO3gDDfH+AGFCGsR7kngzQnA==", "dev": true, "dependencies": { "glob": "^10.3.7" @@ -7534,7 +7452,7 @@ "rimraf": "dist/esm/bin.mjs" }, "engines": { - "node": ">=14.18" + "node": "14 >=14.20 || 16 >=16.20 || >=18" }, "funding": { "url": "https://github.com/sponsors/isaacs" @@ -7658,9 +7576,9 @@ } }, "node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", "dev": true }, "node_modules/wrap-ansi": { @@ -7705,9 +7623,9 @@ "dev": true }, "node_modules/ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", "dev": true, "engines": { "node": ">=10.0.0" diff --git a/package.json b/package.json index 01c1358de..fe2b886c5 100644 --- a/package.json +++ b/package.json @@ -2,20 +2,20 @@ "name": "@pnp/monorepo", "private": true, "type": "module", - "version": "4.2.0", + "version": "4.3.0", "description": "A JavaScript library for SharePoint & Graph development.", "devDependencies": { - "@azure/identity": "4.2.1", - "@azure/msal-browser": "3.17.0", - "@azure/msal-node": "2.9.2", + "@azure/identity": "4.3.0", + "@azure/msal-browser": "3.19.0", + "@azure/msal-node": "2.11.0", "@microsoft/microsoft-graph-types": "2.40.0", "@pnp/buildsystem": "^4.0.1", - "@pnp/logging": "^4.1.1", + "@pnp/logging": "^4.2.0", "@types/chai": "4.3.16", "@types/chai-as-promised": "7.1.8", "@types/core-js": "2.5.8", "@types/findup-sync": "4.0.5", - "@types/mocha": "10.0.6", + "@types/mocha": "10.0.7", "@types/node": "18.11.9", "@types/webpack": "5.28.5", "@types/yargs": "17.0.32", @@ -26,14 +26,14 @@ "del-cli": "5.1.0", "eslint": "8.57.0", "findup-sync": "5.0.0", - "globby": "^14.0.1", - "mocha": "10.4.0", + "globby": "14.0.2", + "mocha": "10.6.0", "node-fetch": "3.3.2", "prettyjson": "1.2.5", "string-replace-loader": "3.1.0", "tslib": "2.6.3", "typescript": "4.9.5", - "webpack": "5.92.0", + "webpack": "5.93.0", "webpack-cli": "5.1.4", "webpack-dev-server": "5.0.4", "yargs": "17.7.2" diff --git a/packages/azidjsclient/package.json b/packages/azidjsclient/package.json index 97be8b550..ba73e9636 100644 --- a/packages/azidjsclient/package.json +++ b/packages/azidjsclient/package.json @@ -7,7 +7,7 @@ "dependencies": { "@pnp/core": "0.0.0-PLACEHOLDER", "@pnp/queryable": "0.0.0-PLACEHOLDER", - "@azure/identity": "4.2.1", + "@azure/identity": "4.3.0", "tslib": "2.6.3" } } \ No newline at end of file diff --git a/packages/graph/behaviors/advanced-query.ts b/packages/graph/behaviors/advanced-query.ts new file mode 100644 index 000000000..975195e10 --- /dev/null +++ b/packages/graph/behaviors/advanced-query.ts @@ -0,0 +1,14 @@ +import { TimelinePipe } from "@pnp/core"; +import { Queryable } from "@pnp/queryable"; +import { ConsistencyLevel } from "@pnp/graph"; + +export function AdvancedQuery(): TimelinePipe { + + return (instance: Queryable) => { + + instance.using(ConsistencyLevel()); + instance.query.set("$count", "true"); + + return instance; + }; +} diff --git a/packages/graph/index.ts b/packages/graph/index.ts index d57ce90e8..fd1be6296 100644 --- a/packages/graph/index.ts +++ b/packages/graph/index.ts @@ -2,6 +2,7 @@ export { graphfi as graphfi, GraphFI as GraphFI } from "./fi.js"; export * from "./graphqueryable.js"; +export * from "./behaviors/advanced-query.js"; export * from "./behaviors/consistency-level.js"; export * from "./behaviors/defaults.js"; export * from "./behaviors/endpoint.js"; diff --git a/packages/msaljsclient/package.json b/packages/msaljsclient/package.json index 7b689fa31..9b1955e23 100644 --- a/packages/msaljsclient/package.json +++ b/packages/msaljsclient/package.json @@ -5,7 +5,7 @@ "main": "./index.js", "typings": "./index", "dependencies": { - "@azure/msal-browser": "3.17.0", + "@azure/msal-browser": "3.19.0", "@pnp/queryable": "0.0.0-PLACEHOLDER", "tslib": "2.6.3" } diff --git a/packages/nodejs/package.json b/packages/nodejs/package.json index b4da2c0c5..ec8ac90ad 100644 --- a/packages/nodejs/package.json +++ b/packages/nodejs/package.json @@ -5,7 +5,7 @@ "main": "./index.js", "typings": "./index", "dependencies": { - "@azure/msal-node": "2.9.2", + "@azure/msal-node": "2.11.0", "@pnp/core": "0.0.0-PLACEHOLDER", "@pnp/logging": "0.0.0-PLACEHOLDER", "@pnp/queryable": "0.0.0-PLACEHOLDER", diff --git a/packages/sp/spqueryable.ts b/packages/sp/spqueryable.ts index 7c8cc0a97..0eaa0669a 100644 --- a/packages/sp/spqueryable.ts +++ b/packages/sp/spqueryable.ts @@ -75,17 +75,11 @@ export class _SPQueryable extends Queryable { const aliasedParams = new URLSearchParams(this.query); - // this regex is designed to locate aliased parameters within url paths. These may have the form: - // /something(!@p1::value) - // /something(!@p1::value, param=value) - // /something(param=value,!@p1::value) - // /something(param=value,!@p1::value,param=value) - // /something(param=!@p1::value) - // there could be spaces or not around the boundaries - let url = this.toUrl().replace(/([( *| *, *| *= *])'!(@.*?)::(.*?)'([ *)| *, *])/ig, (match, frontBoundary, labelName, value, endBoundary) => { + // this regex is designed to locate aliased parameters within url paths + let url = this.toUrl().replace(/'!(@.+?)::((?:[^']|'')+)'/ig, (match, labelName, value) => { this.log(`Rewriting aliased parameter from match ${match} to label: ${labelName} value: ${value}`, 0); aliasedParams.set(labelName, `'${value}'`); - return `${frontBoundary}${labelName}${endBoundary}`; + return labelName; }); const query = aliasedParams.toString(); diff --git a/test/graph/contacts.ts b/test/graph/contacts.ts index 06b6ef7c9..c56668402 100644 --- a/test/graph/contacts.ts +++ b/test/graph/contacts.ts @@ -183,30 +183,30 @@ describe("Contacts", function () { return expect(folderAfterUpdate?.displayName).equals(folderDisplayName); }); - // This logs to the console when it passes, ignore those messages it("Delete Contact Folder", async function () { // Add a folder that we can then delete const testFolderName = `TestFolder_${getRandomString(4)}`; const folder = await this.pnp.graph.users.getById(testUserName).contactFolders.add(testFolderName, rootFolderID); - await this.pnp.graph.users.getById(testUserName).contactFolders.getById(folder.id).delete(); - let deletedFolderFound = false; - try { - // This passes the first time through, expecting it to fail on second pass. - // If we try to find a folder that doesn't exist this returns a 404 - const deletedFolder = await this.pnp.graph.users.getById(testUserName).contactFolders.getById(folder.id)(); - deletedFolderFound = (deletedFolder?.id.length> 0); - } catch (e) { - if (e?.isHttpRequestError) { - if ((e).status === 404) { - // do nothing - } - } else { - console.log(e.message); - } - } + // await this.pnp.graph.users.getById(testUserName).contactFolders.getById(folder.id).delete() + // let deletedFolderFound = false; + + // try { + // // This passes the first time through, expecting it to fail on second pass. + // // If we try to find a folder that doesn't exist this returns a 404 + // const deletedFolder = await this.pnp.graph.users.getById(testUserName).contactFolders.getById(folder.id)(); + // deletedFolderFound = (deletedFolder?.id.length> 0); + // } catch (e) { + // if (e?.isHttpRequestError) { + // if ((e).status === 404) { + // // do nothing + // } + // } else { + // console.log(e.message); + // } + // } - return expect(deletedFolderFound).is.false; + return expect(this.pnp.graph.users.getById(testUserName).contactFolders.getById(folder.id).delete()).to.eventually.be.fulfilled; }); it("Get Contacts In Folder", async function () { diff --git a/test/graph/querable.ts b/test/graph/querable.ts index 5c1e79bba..12e333ecf 100644 --- a/test/graph/querable.ts +++ b/test/graph/querable.ts @@ -45,10 +45,10 @@ describe("Queryable", function () { const drives = await this.pnp.graph.users.getById(testUserName).drives.orderBy("lastModifiedBy/user/displayName")(); const drivesClone: Drive[] = JSON.parse(JSON.stringify(drives)); const drivesResort: Drive[] = drivesClone.sort((a, b) => { - if (a.lastModifiedBy.user.displayName.toUpperCase() < b.lastModifiedBy.user.displayName.toUpperCase()) { + if (a.lastModifiedBy?.user?.displayName?.toUpperCase() < b.lastModifiedBy?.user?.displayName?.toUpperCase()) { return -1; } - if (a.lastModifiedBy.user.displayName.toUpperCase() > b.lastModifiedBy.user.displayName.toUpperCase()) { + if (a.lastModifiedBy?.user?.displayName?.toUpperCase() > b.lastModifiedBy?.user?.displayName?.toUpperCase()) { return 1; } return 0; diff --git a/test/graph/query-params.ts b/test/graph/query-params.ts index 1c2b0e824..609794181 100644 --- a/test/graph/query-params.ts +++ b/test/graph/query-params.ts @@ -2,7 +2,7 @@ import { expect } from "chai"; import { pnpTest } from "../pnp-test.js"; import "@pnp/graph/groups"; import "@pnp/graph/users"; -import { ConsistencyLevel } from "@pnp/graph/index.js"; +import { ConsistencyLevel, AdvancedQuery } from "@pnp/graph/index.js"; describe("Graph Query Params", function () { @@ -41,4 +41,27 @@ describe("Graph Query Params", function () { return expect(query()).to.eventually.be.fulfilled; })); + + describe("AdvancedQuery", () => { + it("NOT groupTypes/any(c:c eq 'Unified')", pnpTest("d24d9b36-d5dc-4a6c-81fa-2e9a73911372", async function () { + + const query = this.pnp.graph.groups.using(AdvancedQuery()).filter("NOT groupTypes/any(c:c eq 'Unified')"); + + return expect(query()).to.eventually.be.fulfilled; + })); + + it("companyName ne null and NOT(companyName eq 'Microsoft')", pnpTest("33791988-de36-4a6d-88e1-23f6838236ac", async function () { + + const query = this.pnp.graph.users.using(AdvancedQuery()).filter("companyName ne null and NOT(companyName eq 'Microsoft')"); + + return expect(query()).to.eventually.be.fulfilled; + })); + + it("not(assignedLicenses/$count eq 0)", pnpTest("fe202c37-e10e-4b1c-b410-99cf059a491b", async function () { + + const query = this.pnp.graph.users.using(AdvancedQuery()).filter("not(assignedLicenses/$count eq 0)"); + + return expect(query()).to.eventually.be.fulfilled; + })); + }); }); diff --git a/test/sp/alias.ts b/test/sp/alias.ts index 4264fa141..c2efc49b0 100644 --- a/test/sp/alias.ts +++ b/test/sp/alias.ts @@ -6,6 +6,7 @@ import "@pnp/sp/files/web"; import "@pnp/sp/files/folder"; import "@pnp/sp/lists/web"; import { combine } from "@pnp/core"; +import { SPQueryable } from "@pnp/sp"; describe("Alias Parameters", function () { @@ -29,6 +30,49 @@ describe("Alias Parameters", function () { await list.rootFolder.files.addUsingPath("text.txt", "Some file content!"); }); + it("Parameter parsing", function() { + /** Values to test */ + const values = [ + "value", + "value's", + "value with space", + "value with space' and apostrophe", + "ending with apostrophe'", + "'staring with apostrophe", + "'staring and ending with apostrophe'", + "with,' comma", + ]; + /** Aliased parameters to test */ + const tests = values.reduce>>((obj, value)=>{ + // Escape apostrophe in value + value = value.replace(/'/g, "''"); + + obj[`something('!@p1::${value}')`] = {"@p1": `'${value}'`}; + obj[`something('!@p1::${value}','!@p2::${value}2')`] = {"@p1": `'${value}'`, "@p2": `'${value}2'`}; + obj[`something('!@p1::${value}', param=value)`] = {"@p1": `'${value}'`}; + obj[`something('!@p1::${value}', param=value, '!@p2::${value}2')`] = {"@p1": `'${value}'`, "@p2": `'${value}2'`}; + obj[`something(param=value,'!@p1::${value}')`] = {"@p1": `'${value}'`}; + obj[`something(param=value,'!@p1::${value}','!@p2::${value}2')`] = {"@p1": `'${value}'`, "@p2": `'${value}2'`}; + obj[`something(param=value,'!@p1::${value}',param=value)`] = {"@p1": `'${value}'`}; + obj[`something(param=value,'!@p1::${value}',param=value,'!@p2::${value}2')`] = {"@p1": `'${value}'`, "@p2": `'${value}2'`}; + obj[`something(param='!@p1::${value}')`] = {"@p1": `'${value}'`}; + obj[`something(param='!@p1::${value}',param2='!@p2::${value}2')`] = {"@p1": `'${value}'`, "@p2": `'${value}2'`}; + return obj; + }, {}); + + // Test all aliased parameters + for(const [alias, params] of Object.entries(tests)) { + const requestUrl = SPQueryable(this.pnp.sp.web, alias).toRequestUrl(); + const searchParams = Object.fromEntries(new URL(requestUrl).searchParams.entries()); + + // eslint-disable-next-line guard-for-in + for(const param in params) { + expect(searchParams, `Failed to parse "${alias}"`).to.have.property(param); + expect(searchParams[param], `Failed to parse "${alias}"`).to.equal(params[param]); + } + } + }); + it("Folders", function () { return expect(this.pnp.sp.web.getFolderByServerRelativePath(`!@p1::/${combine(webRelativeUrl, "AliasTestLib/MyTestFolder")}`)()).to.eventually.be.fulfilled;